Node Relativity
The Relativity module provides a comprehensive mechanism within the Drupal framework to manage relationships between nodes.
N.B.: It is not the mandate of this module (version 3.0 for Drupal 6) to solve issues relating to semantic web. To implement the RDF spec, further discussion and development will be required; yet this goes far beyond the initial scope of this module.
Documentation and instructions are available in the separate Relativity Handbook.
Summary - Why you might need Relativity?
If you find yourself in a situation where Drupal's core taxonomy functionality or the book.module do not seem to fulfill deeper relationship needs between nodes, this module may provide the solution for you. The following is a set of case studies to demonstrate what Relativity could do for you.
Example #1: Books
The most basic hierarchy between any two nodes is a 1 to 1 relationship. In this example we essentially provide the identical functionality of the book module (core Drupal module). Though inherently this module is not extensible, with Node Relativity, the hierarchy can be expanded upon. Any content type you create can essentially be used as a parent (book node) and child (page node) for the basic structure of your relationship.
The following graph highlights the connection between these two content types.
Book
(parent)
|
|___ Page
(child)Since we are providing a mechanism to define these relationships, it is possible to create a 1 to many and have the hierarchy develop a more complex structure.
The following graph highlights possible combination of content types. The relationship is not limited to two content types, it could be any combination of 1 or more content types. so the following structures are legitimate possibilities:
Page Book Book
(parent) (parent) (parent)
| | |
|___ Page |___ page |___ page
| (child) | (child) | (child)
| | |
|___ Page |___ Book |___ page
(child) (child/parent) (child/parent)
| |
|___ page |___ page
(child) (child)
Example #2: CD Albums
This is a classic example where the relationship between nodes is quite important in order to establish a hierarchy of information. For instance, if a content type defined as an Artist collects information relating to a particular member of a Band, we might say the Artist node is a child of a Band node.
Each band will likely produce music tracks assemble into a collection, therefore requiring an Album content type. The fields for each node type is arbitrary to this discussion, so we won't go into the specifics of each content type. Suffice it to say, a Band is a parent of a child node of type Album, or more simply: Album is a child of a Band node.
We can see from these two points, a hierarchy of nodes is required to demonstrate their relationships. This module can help establish the way in which these content types interact.
The following graph highlights the connection between these content types.
Band
(parent)
| |
Artist ___| |___ Album
(child) (child)This heirarchy could be extended even further with the introduction of a Track content type. The obvious connection point would be the Album content type. Here, the relationship would be described as a Track is a child of an Album node.
Band
(parent)
| |
Artist ___| |___ Album
(child) (child/parent)
|
|___ Track
| (child)
|
|___ Track
(child)We can see that a complex tree of relationships begins. A relationship that is not obvious at first though, since our graph does not describe it visually, is the connection between the Artist and the Track content types. Though the hierarchy is not explicit, it is implied. Therefore, exposing this relation to a user is paramount. How it is presented is up to the individual themer/site developer, yet the functions should be exposed to the front end through API and Drupal handlers for ease of deployment.
N.B.: more examples to come.
A point to note here, you could use the CCK Node Reference module as a way to relate these nodes together, and with the help of Views and Taxonomy, create an elaborate solution to build this hierarchy. The likely outcome though is a node management nightmare. Many such hierarchies over several nodes and with all the permission controls required to limit access to unwanted data or previously selected data may become onerous to work with. Since flexibility is the key, providing users with a simple methodology for connecting, creating and managing nodes together in complex hierarchies is essential.
Identifying and managing these relationships with Relativity is much simpler and ultimately more powerful. In the following pages, we hope to document the future of the module and how we plan to develop its underlying engine.
Upcoming Sections
- Instructions
- Theming Documentation

Would like to see more
Relativity could simplify a few projects. I would like to see the following cases described before deciding when I can use the module. Relativity does not have to handle every case, just describe the cases it can handle and identify ones it does not handle so we can decide between Relativity, custom code, or starting with Relativity and working on enhancements. Some of aspects of Relativity would also be a great enhancement for Vocabulary so we can have better structures of vocabularies.
Track xyz is used in albums aaa and bbb.
An artist performs in a band then goes solo, a case where there is no band for some entries.
An artist writes and performs some tracks, plus writes tracks performed by other artists and bands. The artist is both a performer and a writer. The artist could also be a session musician who performs on tracks for a band without being a member of the band.
Greatest Hits albums with multiple bands.
Node c is a child of node b. Node b is a child of node a. I try to make node a the child of node c. It happens in all sorts of situations and it needs loop prevention. I define packages of services for customers. We offer a special package of packages. A sales person takes a package of packages and adds it to an existing package as a special one time offer. The top level package is already included in one of the included packages. Politicians do it all the time when they announce special extra spending on a new project but the new project is just a new name for an existing project they announced the month before and that was already just an accumulation of minor maintenance projects already in their budget, maintenance projects that are also announced as separate projects. (I am interested in Relativity for a project management module.)
Use Case - would this be possible?
Example A: Support System:
Having each node have a relationship with multiple “support requests”, as well as utilizing flag and nodequeue so that when admins view the flagged nodes in the nodequeue, they are also able to see all “support issues/requests” that are pertaining to them (preferably in a separate tab). Or just scratch the flag/nodequeue idea and build a custom views and privileged users. I realize that there is project tracking for Drupal, as well as STORM, but I am looking for a more "user-friendly" way of doing things, so that a user can submit a support request on the same page they are having issues with, and so that admins don't have to depend on users to correctly reference nodes or to know anything about the system - such as is setup in project. Yet this would allow admins to tag "support issues/requests" as they please.
There are numerable use cases, treating these type of relationships like “custom comments”, with the full power of building custom cck(content construction kit) node types to collect whatever info you want from users, being able to categorize them with taxonomy(for the support request example- tagging as bug report, support, feature request as well as tagging critical, normal, needs more info, fixed, etc…). You would also be able to generate different “comment types” with specific uses and unique permissions settings. I say “custom comments” because they would be associated with nodes like comments, but not for general comment use. It would also be the same concept as “revisions” being attached to nodes, but I thought comments more closely fit the bill. Another application would be just plain controlling access to viewing “custom comment”, such as having a "manager" being able to view comments/reviews from "staff" on content and even request specific info for feedback, but these “custom comments” would not be viewable to the public – just shared between the "manager" and whoever submitted it, just to the "staff".
Would this be possible? I hope I am making sense. Maybe there is a simpler way of doing this, any suggestions are more than welcome. I am running Drupal 6.6 with organic groups, og subgroups, views, calendar, date, flag, nodequeue, and panels (-the main mods).
Thanks so much!
gideon
Would it be possible to make
Would it be possible to make a Q & A with this?
Parent content-type = Question
child content-type = Answer
Question nodes include an "Answer this Question" link.
Users may post one Answer.
A View of Answers is displayed under the main content of each Question.
Would it be possible to allow reviews of nodes with this?
Parent content-type = Item
Child content-type = Review
Item nodes include a "Review this Item" link.
Users may post one Review.
A View of Reviews is displayed under the main content of each Item.
Standard comments may also be posted about the Reviews.
Course prerequisites
Could Node relativity be used to grant access to view a certain node only after viewing the parent node? I am thinking specifically of creating a video training course with quizzes. Basically, a user would have to watch video 1 and take quiz 1 before moving on to watch video 2 and take quiz 2.
It doesn't seem like the current Node relativity can do this, but maybe a future version? Or maybe there is another module somebody knows about?