Contains wrapper for Neo4j Java object defined in the neo4j-core gem.
Ruby
Latest commit 00e5665 Feb 23, 2014 @andreasronge Merge pull request #13 from subvertallchris/master
added String to to_java
Permalink
Failed to load latest commit information.
lib
spec added test for neo4jrb/neo4j-core#27 May 19, 2013
.gitignore
.travis.yml
CHANGELOG release 2.3.0 Jun 18, 2013
Gemfile Just edited Changelog and made it work better on Travis build server Apr 22, 2013
LICENSE release 2.0.0.rc1 May 3, 2012
README.rdoc
Rakefile First commit Mar 20, 2012
neo4j-wrapper.gemspec release 2.3.0 Jun 18, 2013

README.rdoc

Neo4j-wrapper

This contains the Ruby wrapper of the Neo4j::Node and Neo4j::Relationship java object defined in the neo4j-core gem. This gem is included in neo4j.

Docs

The public API

{Neo4j::NodeMixin} The Java Neo4j Node

{Neo4j::RelationshipMixin} The Java Relationship

{Neo4j::IdentityMap} The Identity Map (should be disabled for batch imports and Rake scripts)

Example

class Company
  include Neo4j::NodeMixin
  has_n(:employees)
end

class Person
  include Neo4j::NodeMixin
  property :name
  property :age, :size, :type => Fixnum, :index => :exact
  property :description, :index => :fulltext

  has_one(:best_friend)
  has_n(:employed_by).from(:employees)
end

Neo4j::Transaction.run do
  Person.new(:name => 'jimmy', :age => 35)
end

person = Person.find(:age => (10..42)).first

Neo4j::Transaction.run do
  person.best_friend = Person.new
  person.employed_by << Company.new(:name => "Foo ab")
end

# find by navigate incoming relationship
company = person.employed_by.find { |p| p[:name] == 'Foo ab' }
puts "Person #{person.name} employed by #{company[:name]}"
# navigate the outgoing relationship:
company.employees.each {|x| puts x.name}

Changes

Changes from the neo4j.rb

  • Use of YARD instead of RDoc

  • Some tidy up of the API and code

  • Change of Ruby module structure.

  • More RSpecs and more use of mocking combined with real testing of the Java layer

  • Make sure that we retrieve relationships and nodes lazy if possible.

This gem contains two modules: Neo4j and Neo4j::Wrapper The Neo4j module is public and the Neo4j::Wrapper(::*) are private modules.

License

Notice there are different license for the neo4j-community, neo4j-advanced and neo4j-enterprise jar gems. Only the neo4j-community gem is by default required.