Class: Neo4j::Relationship
- Inherits:
-
Object
- Object
- Neo4j::Relationship
- Extended by:
- Core::Index::ClassMethods, Core::Relationship::ClassMethods, Core::Wrapper::ClassMethods
- Includes:
- Core::Equal, Core::Index, Core::Property, Core::Property::Java, Core::Relationship, Core::Wrapper
- Defined in:
- lib/neo4j/relationship.rb
Overview
A relationship between two nodes in the graph. A relationship has a start node, an end node and a type. You can attach properties to relationships like Neo4j::Node.
The fact that the relationship API gives meaning to start and end nodes implicitly means that all relationships have a direction. In the example above, rel would be directed from node to otherNode. A relationship’s start node and end node and their relation to outgoing and incoming are defined so that the assertions in the following code are true:
Furthermore, Neo4j guarantees that a relationship is never “hanging freely,” i.e. start_node, end_node and other_node are guaranteed to always return valid, non-nil nodes.
Wrapping
Notice that the Neo4j::Relationship.new does not create a Ruby object. Instead, it returns a Java Java::OrgNeo4jGraphdb::Relationship object which has been modified to feel more rubyish (like Neo4j::Node).
Instance Attribute Summary
Attributes included from Core::Index::ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rel_type, start_node, end_node, props = {}) ⇒ Neo4j::Relationship
constructor
Returns a Java::OrgNeo4jGraphdb::Relationship java object which include the Neo4j::Relationship mixins.
Methods included from Core::Relationship::ClassMethods
Methods included from Core::Wrapper::ClassMethods
Methods included from Core::Index::ClassMethods
_config, add_index, find, has_index_type?, index, index?, index_for_type, index_name_for_type, index_type, indexer, node_indexer, put_if_absent, rel_indexer, rm_index, rm_index_config, rm_index_type, trigger_on
Methods included from Core::Index
Methods included from Core::Property::Java
#get_property, #graph_database, #property_keys, #remove_property, #set_property
Methods included from Core::Wrapper
Methods included from Core::Relationship
#_end_node, #_java_entity, #_java_rel, #_other_node, #_start_node, #class, #del, #end_node, #exist?, #other_node, #rel_type, #start_node
Methods included from Core::Equal
Methods included from Core::Property
#[], #[]=, #neo_id, #property?, #props, #update
Constructor Details
#initialize(rel_type, start_node, end_node, props = {}) ⇒ Neo4j::Relationship
Returns a Java::OrgNeo4jGraphdb::Relationship java object which include the Neo4j::Relationship mixins. Will trigger a event that the relationship was created.
55 56 |
# File 'lib/neo4j/relationship.rb', line 55 def initialize(rel_type, start_node, end_node, props={}) end |
Class Method Details
.extend_java_class(java_clazz) ⇒ Object
:nodoc:
64 65 66 67 68 69 70 71 72 |
# File 'lib/neo4j/relationship.rb', line 64 def extend_java_class(java_clazz) #:nodoc: java_clazz.class_eval do include Neo4j::Core::Property include Neo4j::Core::Equal include Neo4j::Core::Relationship include Neo4j::Core::Wrapper include Neo4j::Core::Index end end |