質問

I'm new in Gremlin. And I want to connect Gremlin to Neo4j Database and I already tried the way to connect to Neo4j database.

gremlin> g = new neo4jgraph[EmbeddedGraphDatabase[C:\Users\Olivia Stella\Documents\Neo4j\default.graphdb]]

and before it's connected to Gremlin, an error message shown up:

java.util.prefs.WindowsPreferences <init> Warning: Could not open/create prefs root node Software\JavaSoft\prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.

Note:

-Gremlin 2.4.0

-Java SDK 7

-Neo4j 2.0.1

役に立ちましたか?

解決

That doesn't look like valid Gremlin syntax from the REPL:

gremlin> g = new Neo4jGraph('/tmp/neo4j')
==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
gremlin> g.addVertex([name:'stephen'])
==>v[0]
gremlin> g.V.map
==>{name=stephen}
gremlin> g.commit()
==>null
gremlin> g.shutdown()
==>null
gremlin> g = new Neo4jGraph('/tmp/neo4j')
==>neo4jgraph[EmbeddedGraphDatabase [/tmp/neo4j]]
gremlin> g.V.map                         
==>{name=stephen}

Alternatively, if you have an existing org.neo4j.graphdb.GraphDatabaseService instance that you would like to use you can pass that into the Neo4jGraph constructor instead of the path to where the db files are (or where you would like them to be).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top