简体   繁体   English

如何逐步将Gremlin连接到Neo4j数据库?

[英]How to connect Gremlin to Neo4j database step by step?

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连接到Neo4j数据库,我已经尝试了连接到Neo4j数据库的方法。

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: 在将其连接到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.

Note: 注意:

-Gremlin 2.4.0 -克里姆林宫2.4.0

-Java SDK 7 -Java SDK 7

-Neo4j 2.0.1 -Neo4j 2.0.1

That doesn't look like valid Gremlin syntax from the REPL: 这看起来不像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}

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). 或者,如果您要使用现有的org.neo4j.graphdb.GraphDatabaseService实例,则可以将其传递到Neo4jGraph构造函数中,而不是传递到db文件所在位置(或您希望它们位于何处)的路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM