[英]How to connect Gremlin to Neo4j database step by step?
我是格雷姆林的新手。 我想將Gremlin連接到Neo4j數據庫,我已經嘗試了連接到Neo4j數據庫的方法。
gremlin> g = new neo4jgraph[EmbeddedGraphDatabase[C:\Users\Olivia Stella\Documents\Neo4j\default.graphdb]]
在將其連接到Gremlin之前,顯示了一條錯誤消息:
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.
注意:
-克里姆林宮2.4.0
-Java SDK 7
-Neo4j 2.0.1
這看起來不像REPL中的有效Gremlin語法:
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}
或者,如果您要使用現有的org.neo4j.graphdb.GraphDatabaseService
實例,則可以將其傳遞到Neo4jGraph
構造函數中,而不是傳遞到db文件所在位置(或您希望它們位於何處)的路徑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.