# Relationship Tagging
(last reviewed April 30, 2020)
### Oveview
There are two classes of relationship that are tagged at Forge:
- Unary relationships
- Binary relationships
#### Unary Relationships
The Following are two examples of unary relationships:
- <strong style="color:red">Dr </strong><strong style="color:blue">Sally Smith </strong> just bought a new car.
- The meeting was lead by <strong style="color:red">President</strong> <strong style="color:blue">Barack Obama.</strong>
In these examples, the item in blue is being defined by the item in red. That is, we are defining the following unary relationships:
1) `Sally Smith -> isA -> Doctor`
and that
2) `Barack Obama -> isA -> President`
#### Binary Relationships
Unlike unary relationships where an entity is being being defined by a modifying title or concept, a binary relationship connects two entities.
Some examples of binary relationships include:
- <strong style="color:blue">Barack Obama</strong>, the <strong style="color:red">former president</strong> of the <strong style="color:green">United States</strong>, is <strong style="color:red">married</strong> to <strong style="color:green">Michelle Obama</strong>.
- <strong style="color:blue">Thomas Willson</strong> is the <strong style="color:red">attorney</strong> for <strong style="color:green">ABC Inc</strong>.
- The announcement was made by <strong style="color:green">ABC</strong>'s <strong style="color:red">vice-president</strong> for product development, <strong style="color:blue">Sally Jones</strong>.
Each of these examples can be thought of having three objects associated with it: The two entities being joined, and the raltionship that joins them. These are often referred to as "RDF triples" where the three components are referred to as the subject, predicate, and object. In these examples the subject is represented in blue, the object in green, and the predicate in red. Dont get a predicate confussed with a verb. It may be a verb, but most frequently is not.
There are 4 triples shown in the binary predicate examples above:
```
Barack Obama -> former president -> United States
Barack Obama -> married -> Michelle Obama
Thomas Wilson -> attorney -> ABC
Sally Jones -> vice-president ->ABC
```
#### Some Comments on Relationship Entities
The entities that are a part of a relationship are discrete. Most frequently they correspond to other tagged entities such as people, orgaizations, concepts, locations, and titles.
There are almost never composed of more than a few tokens and almost never, ever have a verb, predicate or a conjunction that are a part of them. We always need to leave some room for the odd-ball exception.
Note that the semantics of the expression dictate what is the subject and what is the object, not the word order (see the example with Sally being the vice-President for ABC.)
There are two special modifiers that may also be a part of a relationship.
These have to do with locations and measures. There use should be made clear in the examples below and in the sample source file.
| Tag Pair | Meaning | Comment |
| -------- | -------- | -------- |
| IS / S | Subject | Part of a unary or binary relationship |
| IB / B | Object | Part of a binary relationship |
| IP / P | Pedicate | Part of a binary relationship |
| IU / U | Unary Modifier | Part of a unary relationship |
| IL / L | Unary Modifier | Part of a unary relationship |
Tagging Relationships:
```
The O
indictment O
and O
arrest O
of O
longtime O
Donald IB
Trump B
associate IP
Roger IS
Stone S
Friday O
morning O
in O
Florida O
fills O
in O
a O
big O
missing O
piece O
of O
the O
emerging O
picture O
that O
special IU
counsel U
Robert IS
Mueller S
is O
painting O
```
Example of something that is NOT a unary relationship:
```
A O
`` O
Senior O /// NO Object! No Relation!
Trump O
campaign O
official O
'' O
was O
`` O
directed O
to O
contact O
Stone O
about O
...
...
```
The following is a unary annotation with a special location annotation.
It should be pretty obvious:
```
...
...
including O
one O
from O
Johannesburg IL /// Location modifier
attorney IU
Mark IS
Heyink S
...
...
```
The following is an example of a binary annotation with a location:
```
A O
couple O
days O
later O
, O
New IL
York L
Fed IB
President IP
John IS
Williams S
, O
```
Posessives are a special case. The apostrophe implies a bibary relation of some sort; often a posession relationship as in "Jack's car," or an association as in "Apple's Tim Cook." Often we will see an apostrphe in a relationship where the subject, predicate and object are explicitly stated and do not have to be inferred. For example: "Apple's CEO Tim Cook."