{
  "$id": "http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/sros/relationship.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "relationship",
  "description": "The Relationship object is used to link together two SDOs in order to describe how they are related to each other.",
  "type": "object",
  "allOf": [
    {
      "$ref": "../common/core.json"
    },
    {
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of this object, which MUST be the literal `relationship`.",
          "enum": [
            "relationship"
          ]
        },
        "id": {
          "title": "id",
          "pattern": "^relationship--"
        },
        "relationship_type": {
          "title": "relationship_type",
          "type": "string",
          "description": "The name used to identify the type of relationship.",
          "pattern": "^[a-z0-9\\-]+$"
        },
        "description": {
          "type": "string",
          "description": "A description that helps provide context about the relationship."
        },
        "source_ref": {
          "description": "The ID of the source (from) object.",
          "allOf": [
            {
              "$ref": "../common/identifier.json"
            },
            {
              "not": {
                "pattern": "^(relationship|sighting|bundle|marking-definition|language-content)--.+$"
              }
            }
          ]
        },
        "target_ref": {
          "description": "The ID of the target (to) object.",
          "allOf": [
            {
              "$ref": "../common/identifier.json"
            },
            {
              "not": {
                "pattern": "^(relationship|sighting|bundle|marking-definition|language-content)--.+$"
              }
            }
          ]
        },
        "start_time": {
          "$ref": "../common/timestamp.json",
          "description": "This optional timestamp represents the earliest time at which the Relationship between the objects exists. If this property is a future timestamp, at the time the updated property is defined, then this represents an estimate by the producer of the intelligence of the earliest time at which relationship will be asserted to be true."
        },
        "stop_time": {
          "$ref": "../common/timestamp.json",
          "description": "The latest time at which the Relationship between the objects exists. If this property is a future timestamp, at the time the updated property is defined, then this represents an estimate by the producer of the intelligence of the latest time at which relationship will be asserted to be true."
        }
      }
    }
  ],
  "required": [
    "relationship_type",
    "source_ref",
    "target_ref"
  ]
}
