Only one relation between two types of nodes
pkej - July 11, 2008 - 10:29
| Project: | Node2Node |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I tried to make more than one relationship between the two same nodes, which wasn denied me by the system. There are times when I would need to have differently renamed relationships between two node types, so that I can associate one node of Type A with two nodes of Type B, but each association to Type B are different.
An example would be where Type A and Type B are the same; People. Paul is the father of Anna and the husband of Cristina. When I tried to model this it wasn't possible, even though the relationships have different names.

#1
Additionally, some relationships aren't just parent-child. Some are siblings. Some are one-way only. Some are transient (ie. if you belong to department A of corporation B, you also belong to corporation B).
Just to rattle the cage a bit.
Of course, saying all this, it starts to look more like a...prototyping tool for a database, which I would think is a good thing.
#2
I also remembered this nice little module: http://drupal.org/project/term_relation_types
It lets me create different types of named relationships. The terms already have synonyms (siblings) and hierarchy (parent/children), I've also added "antonyms" for terms with opposite meaning.
The admin/settings/node2node form would have the current default available, but in another form you could create the following relationship types (just two examples here):
Relationship type name: Hierarchy
Left side name: Parent
Right side name: Child
Relationship type name: Siblings
Left side name: Older
Right side name: Younger
With those I could in the admin/settins/node2node form select:
Relationship type: Siblings
Name of relationship: has a younger brother
Reverse of relationship: has an older sister
ID: Sister-Brother
Relationship type: Siblings
Name of relationship: has a younger sister
Reverse of relationship: has an older sister
ID: Sister-Sister
And by that create a pretty long list of relationships which in the end could in this case create a genealogical database. Connect that with my wish for each relationship creating a node upon creation and we could forsee something like this, again in the admin/settings/node2node page:
Relationship type: Married
Name of relationship: is the husband of
Reverse of relationship: is the wife of
ID: Marriage
Creates node of type: Marriage
Reltaionship type: Siblings
Name of relationship: was in effect from
Reverse of relationship: was held in
ID: Marriage-Place
Creates node of type: None created
Both must be created: Yes
Just to contrive a little :)
#3
Subscribing. I would also like to be able to have at least two relationships between story nodes (e.g., is related to and is superseded by).
#4
You know that strictly none of us need node2node or node hierarchy? It is possible to create these relations with nodereference, nodereferrer, nodereferrer popup, views and cck.
It should also be possible to create relations in RDF, but frankly it has been a bit daunting to create anything there. Of course, if I actually did manage to create stuff in RDF, the sparqle module really shines, it is fantastic, I've tried it out.
Yet, as long as RDF isn't as simple to understand as node2node, node relativity, node hierarchy etc, it will not be of much help.
#5
Thanks for the hint, that works really well! I configured the field to use an autocomplete input box, which makes it really easy to add nodes. Beautiful!