While traversing a Neo4j graph, I want to set some key-val pair against every property of the graph. It is easy to do using meta-properties, but in Neo4j graph feature, "Meta-property" feature is false(not there).Is there any other way possible to do the same?
Asked
Active
Viewed 165 times
1 Answers
1
As Neo4j does not support that feature natively in their graph database, meta-properties can only be simulated as part of the neo4j-graph implementation. They are disabled by default and therefore you must explicitly turn them on as part of your configuration when constructing the graph using the gremlin.neo4j.metaProperties
option:
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration.BaseConfiguration@6c99bc97
gremlin> conf.setProperty('gremlin.neo4j.directory','/tmp/neo4j')
gremlin> conf.setProperty('gremlin.neo4j.metaProperties',true)
gremlin> graph = Neo4jGraph.open(conf)
==>neo4jgraph[community single [/tmp/neo4j]]
You can read more about this here

stephen mallette
- 45,298
- 5
- 67
- 135
-
mallete how do we set this property when using the neo4j-java-driver? By default the meta properties and variable features are set as false and hence we aren't able to use these features. Can you please let us know? – Anand Apr 04 '18 at 07:15
-
hmmm...i'm not sure what would work in that situation. i think you should ask the developers of that library directly if anything can be done. – stephen mallette Apr 04 '18 at 10:26