
{ "$schema":                        "https://json-schema.org/draft/2020-12/schema",
  "$id":                            "https://schemas.mpai.community/XRV1/V1.0/data/ParticipantData.json",
  "title":                          "Participant Data V1.0",
  "description":                    "Participant data container.",
  "type":                           "object",
  "additionalProperties":           false,
  "required":                       ["Header","ParticipantDataID"],
  "properties":                     {

    "Header":                       { "type": "string", "const": "^CAV-PTD-V1.0", "description": "Participant Data Header" },
    "MInstanceID":                  { "type": "string", "description": "Identifier of the M-Instance (Virtual Space) associated with this Participant Data." },
    "UEnvironmentID":               { "type": "string", "description": "Identifier of the U-Environment (Real Space) associated with this Participant Data." },
    "ParticipantDataID":            { "type": "string", "description": "Identifier of this Participant Data instance." },
    "ParticipantDataTime":          { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json", "description": "Time information associated with this Participant Data instance." },

    "ParticipantAttendanceHistory": { "type": "array",  "description": "Participant Attendance history.", "items": {
                                      "type": "object", "additionalProperties": false, "required": ["VisitNumber","DateOfVisit","TicketClass","ParticipantCategory"], "properties": {

      "VisitNumber":                { "type": "integer", "minimum": 0, "description": "Number of visits." },

      "DateOfVisit":               { "type": "array", "description": "Dates of visit.", "items": { "type": "string", "format": "date" } },

      "TicketClass":                { "type": "string", "description": "Ticket class." },

      "ParticipantCategory":        { "type": "string", "description": "Participant category." },

      "ParticipantAttributes":      { "type": "array", "description": "Participant attributes (script or venue specific).", "items": {
                                      "type": "object", "additionalProperties": false, "required": ["AttributeID","AttributeMnemonic","AttributeValue"], "properties": {

        "AttributeID":              { "type": "string", "description": "Attribute identifier." },
        "AttributeMnemonic":        { "type": "string", "description": "Attribute mnemonic." },
        "AttributeValue":           { "type": "string", "description": "Attribute value." } } } } } } },
  
    "DataXMData":                   { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json", "description": "MPAI-PTF Data Exchange Metadata providing provenance, authorisation, legal, security, and confidence information associated with this RE Participant Data instance in a trusted data exchange context." },
    "DescrMetadata":                { "type": "string", "maxLength": 2048, "description": "Human-readable descriptive metadata of the RPD instance (plain text, max 2048 characters)." } } }