通過jruby使用neo4j:Cadet
Cadet 可以讓你方便的在 JRuby 應用中使用 Neo4j。只需要添加這個gem就能夠使用neo4j。支持Batchinsert模式。 Neo4j 是一個高性能的 NoSQL 圖形數據庫。Neo4j 使用圖(graph)相關的概念來描述數據模型,把數據保存為圖中的節點以及節點之間的關系。很多應用中數據之間的關系,可以很直接地使用圖中節點和關系的概念來建模。對于這樣的應用,使用 Neo4j 來存儲數據會非常的自然,要優于使用關系數據庫。
Open a session
require 'cadet'Cadet::Session.open "path/to/graph.db/" do
for a batch inserter session:
Cadet::BatchInserter::Session.open "path/to/graph.db/" do
bear in mind that, the database directory needs to be clean before establishing a BatchInserter session.
transaction do Person_by_name("Javad").lives_in_to City_by_name("Chicago") end end</pre>https://github.com/karabijavad/cadet
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!