neosemantics
neosemantics copied to clipboard
A question about ’n10s.nsprefixes.add‘
Hey , @jbarrasa
Thanks for your import tool, its very useful.
But i have a question now that when I try to import rdf to neo4j, the namespace be set in advance by 'n10s.nsprefixes.add'.
The example : " call n10s.nsprefixes.add( "equipment_clas", "localhost://military.namespace/equipment_clas#") ", but when the import process was completed, neo4j brower display : {"ns1":"localhost://military.namespace/equipment_clas#"}.
So how I can use the n10s. to set the namespace name by myself?
Rdf example: <rdf:RDF xmlns:equipment_clas="localhost://military.namespace/equipment_clas#"
<rdf:Description ......> .............
Import code: call n10s.rdf.import.fetch( "file:///E:/rdf_knowledgefusion/data/military.rdf", "RDF/XML", {shortenUrls: false,typesToLabels: true})
Neo4j version: neo4j-community-4.0.7
Look at https://neo4j.com/docs/labs/nsmntx/current/import/#custom-prefixes-for-namespaces
Hi @xiaowenzh630, you seem to be using the prefix definition correctly. Can you share the RDF doc you're loading so I can try to reproduce? A fragment of it would do.
The thing I notice is that the params you're passing to the n10s.rdf.import.fetch
method are 3.5 syntax, from 4.0 they go in the Graph Config as follows (it did work for you because you happened to choose the default options) :
call n10s.graphconfig.init();
call n10s.graphconfig.set( { handleVocabUris: "SHORTEN", handleRDFTypes: "LABELS" });
call n10s.rdf.import.fetch( "file:///E:/rdf_knowledgefusion/data/military.rdf", "RDF/XML");
Cheers,
JB.