{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.mpai.community/PGM1/V1.0/data/EntityCorrespondences.json",
  "title": "Entity Correspondences V1.0",
  "description": "The correspondences established by Correspondence Resolution between Audio Entities and Visual Entities, each with its cardinality, confidence, aligned identifier and close alternatives.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "Header",
    "MInstance",
    "UEnvironment",
    "SessionID",
    "EntityCorrespondencesID",
    "EntityCorrespondencesTime",
    "Correspondences"
  ],
  "properties": {
    "Header": {
      "type": "string",
      "const": "PGM-ECO-V1.0"
    },
    "MInstance": {
      "type": "string",
      "description": "Identifier of the M-Instance."
    },
    "UEnvironment": {
      "type": "string",
      "description": "Identifier of the U-Environment."
    },
    "SessionID": {
      "type": "string",
      "description": "Identifier of the A-User session."
    },
    "EntityCorrespondencesID": {
      "type": "string",
      "description": "Identifier of this instance."
    },
    "EntityCorrespondencesTime": {
      "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json"
    },
    "Correspondences": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "AlignedEntityID": {
            "type": "string",
            "description": "Identifier of the aligned Entity, retained from earlier captures where the correspondence persists."
          },
          "AudioEntityIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Identifiers of the Audio Entities."
          },
          "VisualEntityIDs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Identifiers of the Visual Entities."
          },
          "Cardinality": {
            "type": "string",
            "enum": [
              "one_to_one",
              "many_to_one",
              "one_to_many"
            ],
            "description": "Cardinality of the correspondence."
          },
          "Confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Confidence, 0 to 1."
          },
          "Persistent": {
            "type": "boolean",
            "description": "True if the identifier was retained from an earlier capture."
          },
          "Alternatives": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "AudioEntityIDs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Identifiers of the Audio Entities."
                },
                "VisualEntityIDs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Identifiers of the Visual Entities."
                },
                "Score": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Score of this kind of evidence, 0 to 1."
                }
              },
              "required": [
                "Score"
              ]
            },
            "description": "Close alternatives excluded by the assignment, each with its score."
          }
        },
        "required": [
          "AlignedEntityID",
          "AudioEntityIDs",
          "VisualEntityIDs",
          "Cardinality",
          "Confidence"
        ]
      },
      "description": "The correspondences established between Audio Entities and Visual Entities."
    },
    "EndedCorrespondences": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "AlignedEntityID": {
            "type": "string"
          },
          "Reason": {
            "type": "string",
            "description": "The reason."
          }
        },
        "required": [
          "AlignedEntityID"
        ]
      },
      "description": "Correspondences of earlier captures that the current capture no longer supports."
    },
    "DataXMData": {
      "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json"
    },
    "DescrMetadata": {
      "type": "string",
      "maxLength": 2048
    }
  }
}