Neomodel provides the following classes in the neomodel
package for defining relationships between nodes or entities:
Relationship
: This class is used to define a bi-directional relationship in which the "direction" of the relationship does not matter. It can be in any direction. For example, in our social data model we are using theFRIEND
relationship in which direction does not matter, because if one person declares being a friend to another then vice-versa is also true.RelationshipTo
: It is used to define the outgoing relationship.RelationshipFrom
: It is used to define the incoming relationship.
All of these classes accept four parameters and expose the connect()
method to establish a relationship with the given node. The following is the explanation of each parameter required by the relationship classes:
Class name: This is the name of the class that enjoys the relationship with the class in which the relationship is defined.
Relationship type: This is...