Customize the default Neo4j namespace and prefix

Can I customize what prefixes and namespaces are used by default instead of?:
"n4sch" : "neo4j://graph.schema#",
"n4ind" : "neo4j://graph.individuals#"

Thanks for your help!

1 Like

@jesus.barrasa - I have been using neo4j for a while now to build several knowledge graphs. We recently have a request to have the graph export to rdf/xml with very specific structure. With namespace mapping we can solve most of the issues. However, we are currently stuck with this autogenerated namespace and prefix above. Can you help how to change this? Plus, can we use custom unique id that we created for our own database instead the node id from neo4j?

For the schema elements you can define mappings (see section in manual).

For the individual's uris I'm afraid they are not configurable. It's just adding that namespace to the internal neo4j ids. I guess you could RDFize your graph (although it would be a bit hacky) by labeling all individuals as :Resource and setting a uri property on them with your preferred one (you would need to guarantee uniqueness, so probably creating a constraint would be a good idea). Then you can play with your GraphConfig and make it behave the way you want. Does this make sense?

Cheers,

JB.

Hi @duncandam86 glad to hear you're finding n10s useful :)

I think what you suggest sounds reasonable,

What would a useful solution look like? Something like setting a property as the preferred uri and maybe in the absence of that property default to the current behavior and generate based on node id?

Or would you rather keep the current behavior but just have the option to define the namespace for uris instead of "neo4j://graph.individuals#"

Or maybe any other suggestion?

JB.

Hi JB,

Thanks for responding. I think an option to define the namespace for the uris would be great. I think it would make the graphs retrieved from Neo4j as RDF feels a bit less generic when there isn't a mapping for a property or properties.