Relationship Attributes – Subject, Object and Relationships
Subject / Object and Relationships
The two concepts linked together by a relationship are called the Subject and the Object. Relationships are always directional and link concepts together in a single direction. In the example below, the Subject is the left hand concept, the Object is the right hand concept.
Figure 1: Concepts are linked with relationships
Note: The Subject of a relationship must be a string concept – the other three concept types (number, date and boolean) can only be the object of a relationship.
Between the two concepts being linked with a relationship, decide which is to act as the subject concept and which is the object concept. Often, it is immediately clear which is the subject and object concept and more specifically, how they relate.
Once the concepts have been identified as either subject or object, and the direction a relationship is going to point has been decided, the relationship must be appropriately named.
Naming relationships semantically can be really helpful, as this is the most intuitive way to record knowledge. A good rule of thumb is to try and say a sentence with the concepts and relationships being connected together in it out loud – think about how you would describe them to a person.
Wherever possible, avoid using either ‘has‘ or ‘is‘ as a relationship name as these can be applied to almost any relationship and can get confusing within rules.
If ‘has‘ or ‘is‘ appear to be the only appropriate options, one way to avoid using them is to be conscious of how the relationship will read between instances, not just the concepts being connected.
For example, consider the relationship between a person and their goal in life. The initial instinct might be to call the relationship something like:
person ‘has‘ goals
However, if the concepts are switched with specific concept instances, the relationship instance would read as…
John ‘has‘ sail around the world
…which makes less sense. Instead, it would be better to name the relationship ‘wants to. Now, the relationship instance makes more sense:
John ‘wants to’ sail around the world
It may be easier to remember what concepts a relationship is linking if the object concept is included in the relationship name. For example, instead of…:
country ‘has‘ national language
…the relationship name could include the object concept :
country ‘has national language’ national language
When Rainbird creates new facts for the “has national language” relationship it will read as (for example):
France ‘has national language‘ French
…which makes semantic sense.
Version 1.01 – Last Update: 25/03/2021