Entity Relationship Notes

This is an attempt to refine a logical framework to describing relationships between entities. What the entities actually are doesn’t matter – this framework addresses the concepts of logical entities with some functional relationship between them. This framework doesn’t concern itself with the entities themselves, their properties, their types, their disposition. They only need exist and be identifiable. This framework addresses the relationships between them.

This framework is an attempt to be utterly complete, but is likely too complex to be implemented as described. Implementations would be abbreviated as necessary to fit the situation.

Scope of Relationships

  1. Entire content object
  2. Property specific
    1. Having a property specific relationship is another piece of metadata about that relationship
    2. By putting a relationship in a property, you are specifying the type
      1. You have a property of “Father.”

Relationship Type vs. Relationship

A “type” is a class. A “relationship” is the actual relationship – an instance of the class.

Universal Properties of Relationship Types

  1. Is first-order or derived relationships?
  2. Entity A Restrictions
  3. Entity B Restrictions
  4. Description
    1. Current
    2. Future
    3. Past
  5. Name
    1. Current
    2. Future
    3. Past
  6. Is it date-dependent or universal?
  7. Ad Hoc Properties
    1. At what point does the relationship become its own object?
  8. Derivative rules
    1. What relationships are further defined by this one?
  9. What is the direction of the relationship?
  10. What is the exclusivity or repeatability of the relationship?

Entity Names

Names for each entity in the relationship, not in relationship to the other entity.

Origin of Relationship

First-order or Derived.

  • A first order relationship is one that is not derived – the source relationship that’s not derived from any other relationship.

Certain relationships can/should never be first-order, they can only be derived.

  • Co-worker. This should not be first-order – it should be derived through an employment relationship. You don’t specifically say someone is a co-worker, they just are because you both have an employer/employee relationship with another entity.

Problem-ish: how granular do you want to go? On occasion, to establish a derived relationship, you will need to create multiple first-order, predicate relationships

Direction of Relationship

  1. One-way.
    1. But does this exist, really? “John likes Jane.” Even if Jane is indifferent, “Jane is liked by John” is implied. So, can any relationship really be one-way?
    2. Perhaps it is just unacknowledged relationship?
    3. Should it be discoverable in the other direction?
  2. Two-way, derivative, equal
    1. The relationship is the same in both directions.
    2. “John is Jack’s brother.” By definition, then “Jack is John’s brother.”
    3. “Article A is related to Article B. Article B is also related to Article A.”
  3. Two-way, derivative, unequal
    1. If the relationship exists in one direction, then an inverse also exists, but it is different.
    2. “John is Mary’s father. Mary is John’s daughter.”
    3. Is the type of relationship always derivative? If John is Mary’s father, then Mary has to be John’s child – the relationship type is impossible to change.

Repeatability of Relationship

  • Can you have more than one of the same relationship types?
  • At the same time?
  • Ever?
  1. Someone can only ever have ONE father. This relationship is absolute and eternal.
  2. Someone can only have one spouse at a time. This relationship can be repeated, so long as the first one has ended.

Derived Names of Parties

Being in a relationship gives you a name in relation to the other party.

  1. John is married to Tess.
  2. John is Tess’s husband.

When a relationship ends, the name changes.

  1. John was married to Tess.
  2. John is Tess’s ex-husband

Derived Relationships

Does being in relationship X automatically put you in relationship Y?

  1. John is married to Tess.
  2. Tess is sister to Mike.
  3. John is then derived to be brother-in-law of Mike.

A derived relationship has to be one that would not exist without the predicate relationship.

Time Status of Relationships

Once it exists, it can be described in relationship to it’s start and end dates (see also: “Tense of Relationships”). A relationship has three statuses:

  1. Future. Prior to start date.
  2. Current: Between start and end dates.
  3. Past: After end dates

Relationships can also be eternal, or not date dependent. Example: “parent-child.” There is no start or end date to this. It just is and always will be – it exists as soon as the two objects exist, and remains forever.

Tense of Relationship

When a relationship ends, does it leave fingerprints?

  • “John works at MegaCorp.” Then John quit. Now the relationship is “John worked at MegaCorp”.
  • Should this be built into the type? Should a relationship type specify a future, present, and past tense?
  1. Future: John will start working at MegaCorp on January 1, 2010.
  2. Current: John works at MegaCorp.
  3. Past: John worked at MegaCorp from January 1 to December 31, 2010

Granularity

How granular do you get?

Example: Marriage

  • First-order
  • Entity A must be Type of Person. Gender of Male.
    • Entity name: “Man”
  • Entity B must be Type of Person. Gender of Female.
    • Entity name: “Woman”
  • Relationship is date dependent, both Effective and End dates
  • Descriptions
    • Man – Woman
      • Future: “is fiancee of”
      • Current: “is husband of”
      • Past: “is ex-husband of”
    • Woman – Man
      • Future: “is fiancee of”
      • Current: “is wife of”
      • Past: “is ex-wife of”
    • Names:
      • Man – Woman
        • Future: “fiancee”
        • Current: “husband”
        • Past: “ex-husband”
      • Woman – Man
        • Future: “fiancee”
        • Current: “wife”
        • Past: “ex-wife”
    • Derivatives
      • Man – Woman – Parent: Son-in-law
      • Man – Woman – Sibling: Brother-in-law
      • Man – Woman – Child: Stepfather (but only if a corresponding parent-child doesn’t exist already…)
      • Woman – Man – Parent: Daughter-in-law
      • Woman – Man – Sibling: Sister-in-law
      • Woman – Man – Child: Stepmother (but only if a corresponding parent-child doesn’t exist already…)

Example: Employment

  • First-order
  • Entity A must be Type of Person
    • Entity name: “Employee”
  • Entity B my be Type of Company
    • Entity name: “Employer”
  • Relationship is date-dependent
  • Descriptions
    • Employee – Employer
      • Future: none (??)
      • Current: “is employee of”
      • Past: “is past employee of”
    • Employer – Employee
      • Future: none
      • Current: “is employer of”
      • Past: “is past employer of”
  • Names
    • Employee – Employer
      • Future: none (??)
      • Current: “employee”
      • Past: “former employer”
    • Employer – Employee
      • Future: none
      • Current: “employer”
      • Past: “former employer”
  • Derivative
    • Employee – Employer – Employee: co-worker