{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openssom.org/schema/profile-origin-free-relationship.json",
  "title": "SSOM Origin-free Release Profile: Relationship",
  "description": "A Relationship between two released Assets. Both ends are tokens. Unknown properties are rejected.",
  "allOf": [
    {
      "$ref": "relationship.json"
    }
  ],
  "type": "object",
  "required": [
    "relationship_id",
    "relationship_type",
    "from_ref",
    "to_ref",
    "provenance",
    "confidence"
  ],
  "properties": {
    "relationship_id": {
      "type": "string",
      "pattern": "^urn:ssom:relationship:tok:[0-9a-f]{32,64}$"
    },
    "relationship_type": {
      "$ref": "common.json#/$defs/coreRelationshipTerm"
    },
    "from_ref": {
      "type": "string",
      "pattern": "^urn:ssom:asset:tok:[0-9a-f]{32,64}$"
    },
    "to_ref": {
      "type": "string",
      "pattern": "^urn:ssom:asset:tok:[0-9a-f]{32,64}$"
    },
    "confidence": {
      "type": "number"
    },
    "provenance": {
      "type": "object",
      "required": [
        "source_platform",
        "source_authority_id",
        "source_reference",
        "lineage_id",
        "ingest_time",
        "processing_time",
        "mapping_package_id",
        "mapping_version"
      ],
      "properties": {
        "source_platform": {
          "const": "origin_free_release"
        },
        "source_authority_id": {
          "type": "string",
          "pattern": "^urn:ssom:release:tok:[0-9a-f]{32,64}$"
        },
        "source_reference": {
          "type": "string",
          "pattern": "^urn:ssom:(signal|asset|relationship):tok:[0-9a-f]{32,64}$"
        },
        "lineage_id": {
          "type": "string",
          "pattern": "^urn:ssom:(record|asset|relationship):tok:[0-9a-f]{32,64}$"
        },
        "ingest_time": {
          "type": "string",
          "format": "date-time"
        },
        "processing_time": {
          "type": "string",
          "format": "date-time"
        },
        "mapping_package_id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]*$"
        },
        "mapping_version": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]*$"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
