2015-12-11 58 views

回答

0

我很驚訝網絡無法返回關於如何使用neo4j和特別寫入查詢的一些信息。

爲GraphDatabaseService的API文檔都位於這裏:

http://neo4j.com/docs/stable/javadocs/org/neo4j/graphdb/GraphDatabaseService.html

此外,手冊中部分將介紹如何在Java中使用的Neo4j以嵌入模式:

http://neo4j.com/docs/stable/tutorials-java-embedded-hello-world.html

基本上,您需要在交易中包裝您的操作:

try (Transaction tx = database.beginTx()) { 
    database.createNode(); 
    tx.success(); 
} 

尋找通過標籤和屬性點是之前的操作一樣簡單:

try (Transaction tx = database.beginTx()) { 
    Node user = database.findNode(DynamicLabel.label("User"), "login", "[email protected]"); 
    tx.success(); 
} 

如果在服務器模式下運行的Neo4j,你其實可以寫的Cypher查詢,拿起一個驅動程序的語言你選擇:

http://neo4j.com/developer/language-guides/

和完整的暗號指南是爲你準備好閱讀:

http://neo4j.com/docs/stable/cypher-query-lang.html

您也可以按照免費在線課程:

http://neo4j.com/graphacademy/online-training/

您還可以在這裏發現一個巨大的策劃Neo4j的資源列表:

https://github.com/GraphGeeks/awesome-neo4j

+0

其實,我一直在尋找如何查詢通過批量插入構建的neo4j db。我無法在那裏使用GraphDatabaseService,因此發佈了這個問題。 –

+0

所以插入是正確的? –

+0

是的,插入是好的 –