Fix #256: add customProps parameter to tag all imported nodes with custom properties#359
Open
jexp wants to merge 1 commit into
Open
Fix #256: add customProps parameter to tag all imported nodes with custom properties#359jexp wants to merge 1 commit into
jexp wants to merge 1 commit into
Conversation
…stom properties All n10s.rdf.import.* and n10s.onto.import.* procedures now accept a customProps map in their params argument. Every node created or updated during the import gets those key-value pairs written as properties after RDF-derived properties, so custom metadata (importId, version, source) can be attached per-call. The reserved 'uri' key is silently skipped. Adds 4 tests and documentation section with example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
customPropsmap parameter to all RDF/ontology import procedures. Any key-value pairs in this map are applied to every node created or updated during import, after the RDF-derived properties.n10s.rdf.import.inline,n10s.rdf.import.fetch,n10s.onto.import.inline,n10s.onto.import.fetch,n10s.skos.import.inline,n10s.skos.import.fetch, and the quadRDF variants all supportcustomPropsurikey is excluded fromcustomPropsto prevent accidental overwrite of the node's URI identifiercustomPropsis echoed in the config summary returned by the procedureCloses #256
Test plan
testImportWithCustomProps— verifies custom properties are set on imported nodestestImportWithoutCustomProps— regression: normal import unaffectedtestImportCustomPropsDoNotOverwriteUri— uri key in customProps is silently ignoredtestImportFetchWithCustomProps— same behaviour via fetch variantDocs
Added
[[custom-node-properties]]section todocs/modules/ROOT/pages/import.adocwith usage example.