DIP-103

June 16, 2023 ยท View on GitHub

relationship

Following the convention of DIP-102, a new wordType will be introduced: relationship.

Background:

In DCoSL, data will frequently be represented as a graph, with nodes and edges. DIP-100 provides conventions for nodes that are JSON data objects. In this DIP, we provide conventions for edges, a.k.a. relationships.

An edge is represented as a relationship between two nodes. It may or may not be oriented.

Declaration

See here.

Example:

{
  "wordData": {
    "wordTypes": ["relationship"],
  },
  "relationshipData": {
  },
  ...
}

Properties

Fields within relationshipData will be required to indicate the identity of the two nodes that are connected by the relationship as well as the relationship type. Relationship types are declared in DIP-???. Methods to specify fields will be specified in upcoming DIPs. The exact properties may vary from application to application, but the example below provides one illustration:

{
  "wordData": {
    "wordTypes": ["relationship"],
  },
  "relationshipData": {
    "nodeFrom": {
      "slug": "alice"
    },
    "relationshipType": {
      "slug": "isMarriedTo"
    }
    "nodeTo": {
      "slug": "bob"
    }
  },
  ...
}