Sha256: 07f72e641ecf9d4ed049925e0e0d7701ead77f756f11ce2b83bff7b54c7bde26

Contents?: true

Size: 1.85 KB

Versions: 1

Compression:

Stored size: 1.85 KB

Contents

= neo4jr-simple

A simple, ready to go JRuby wrapper for the Neo4j graph database engine which provides:
* The Neo4j Core Java Library (required and ready to use)
* Raw access to the Java API (using Neo4j::DB.instance )
* Extensions to the Java API to make node manipulation and traversal more rubyesque
* Working specs
* Loaded Neo4j sample database with IMDB data
* Nothing more then Neo4j goodness

== Prerequisites

* Java
* JRuby

== Recommend way of installing JRuby

1. Install RVM: http://rvm.beginrescueend.com/
2. Install Jruby using rvm: rvm install jruby
3. Switch ruby to JRuby: rvm use jruby

== Getting Started

* functional_example_spec includes examples of basic operations in neo4j like creating, retrieving and updating nodes along with simple traversal examples.
* Neo4j API: http://api.neo4j.org/current/org/neo4j/api/core/package-summary.html

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
  
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_of_type)
     traverser.each do |node|
       #...
     end
   end


== Contributors

====Matthew Deiters
* Twitter  : http://twitter.com/mdeiters
* GitHub   : https://github.com/mdeiters
* LinkedIn : http://www.linkedin.com/in/matthewdeiters
* Blog     : http://www.theagiledeveloper.com
  
== Copyright

Copyright (c) 2009 Matthew Deiters. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neo4jr-simple-0.1.0 README.rdoc