| Path: | README.rdoc |
| Last Update: | Thu Dec 22 22:42:30 +0000 2016 |
A simple, ready to go JRuby wrapper for the Neo4j graph database engine which provides:
Basic Node creation:
Neo4jr::DB.execute do |neo|
node = neo.createNode
node[:name] = 'Deiters, Matt'
end
Retrieve a Node:
Neo4jr::DB.execute do |neo|
node = neo.getNodeById(1234)
end
Find a Node by some value you control:
Neo4jr::DB.execute do |neo|
# If you add a property 'identifier' to a node, the value can be used to retrieve the node by
# This can by an id or string but the value must be unique to this node
# e.g. node[:identifier] = user.id
node = neo.find_node_by_identifier(user.id)
end
Traverse Database from a node:
Neo4jr::DB.execute do |neo|
philip_seymour_hoffman = neo.getNodeById(1102)
order = Neo4jr::Order::BREADTH_FIRST
stop_when = Neo4jr::StopEvaluator::END_OF_GRAPH
return_when = Neo4jr::ReturnableEvaluator::ALL
relationships = Neo4jr::RelationshipType.outgoing(:acted_in)
traverser = philip_seymour_hoffman.traverse(order, stop_when, return_when, relationships)
traverser.each do |node|
#...
end
end
Use command line shell to query and modify the graph:
neosh -path <path_to_neo_db>
https://github.com/mdeiters https://github.com/klobuczek https://github.com/gregormelhorn
Copyright (c) 2009 Matthew Deiters. See LICENSE for details.