#91 ✓resolved
Andreas Ronge

Support for Index and Declaration of Properties on Relationships

Reported by Andreas Ronge | November 20th, 2009 @ 08:56 AM | in 0.4.0

The following example should work:

class Student
  include Neo4j::RelationshipMixin
  property :from , :type => Date
  property :to , :type => Date
  property :diploma
  index :diploma
end

# Create a relationship between person and school
rel = Student.new(:student, person, school)
rel.diploma = "yes"
Student.find(:diploma => "yes") # => rel
Student.all # => all students

Notice, the normal way of creating relationships (instead of Student.new) is by using the Neo4j::NodeMixin#has_n and #has_one
The Neo4j::NodeMixin and Neo4j::RelationshipMixin should reuse the same code for this.
The reindexer Neo4j.rb extesion should work on Relationships as well (giving us the #all method)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket

Attachments

Referenced by

Pages