[英]How to connect to Neo4j server with blueprints api?
我在我的Neo4j服務器上安裝了Tinkerpop Gremlin插件。
我想從Java連接到它並執行Gremlin查詢,我正在遵循此指南: https : //github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Java
我陷入第一行:
Graph g = ... // a reference to a Blueprints graph
我應該在這里給出實例化g
什么?
我有工作的Cypher
示例,嘗試將g
實例化為RestAPIFacade。 但是它不會那樣工作。
編輯:我現在看到Neo4jGraph是我所缺少的實現(我錯過了依賴項blueprints-neo4j-graph)。
Graph g = new Neo4jGraph(GraphDatabaseService)
我仍然缺少有關如何使用GraphDatabaseService的信息。
因此,如果我理解您的問題並正確編輯,您想知道如何獲取GraphDatabaseService
實例的GraphDatabaseService
以便可以在Neo4jGraph
的構造函數中傳遞它?
您可以執行以下操作:
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "path/to/neo4j/data" );
其中path/to/neo4j/data
是現有Neo4j數據庫的路徑。 更多信息在這里
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.