通过jruby使用neo4j:Cadet

jopen 10年前

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
https://github.com/karabijavad/cadet