{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://settings.dscustody.sirt-xfsc.click/v1/schemas/dscybercustody.schema.json",
  "title": "dsCyberCustody Forensic JSON-LD Schema",
  "type": "object",
  "oneOf": [
    {
      "$ref": "#/$defs/ForensicLog"
    },
    {
      "$ref": "#/$defs/ForensicManifest"
    },
    {
      "$ref": "#/$defs/ForensicOperation"
    },
    {
      "$ref": "#/$defs/ForensicOperationInstance"
    },
    {
      "$ref": "#/$defs/ForensicEvent"
    },
    {
      "$ref": "#/$defs/Collection"
    },
    {
      "$ref": "#/$defs/VerificationReceipt"
    },
    {
      "$ref": "#/$defs/DIDDocument"
    }
  ],
  "$defs": {
    "Context": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "object"
              }
            ]
          }
        },
        {
          "type": "object"
        }
      ]
    },
    "Signature": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "type": "string"
        },
        "jws": {
          "type": "string"
        },
        "signatureValue": {
          "type": "string"
        },
        "algorithm": {
          "type": "string"
        },
        "verificationMethod": {
          "type": "string"
        },
        "creator": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "proofPurpose": {
          "type": "string"
        },
        "challenge": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "nonce": {
          "type": "string"
        }
      },
      "required": [
        "algorithm",
        "created",
        "proofPurpose"
      ],
      "additionalProperties": true
    },
    "ForensicLog": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@id": {
          "type": "string"
        },
        "@type": {
          "const": "ForensicLog"
        },
        "traceId": {
          "type": "string"
        },
        "messageIssuer": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "data": {
          "type": [
            "object",
            "array",
            "string",
            "number",
            "boolean",
            "null"
          ]
        },
        "issuerSignatureData": {
          "$ref": "#/$defs/Signature"
        },
        "operatorSignature": {
          "$ref": "#/$defs/Signature"
        },
        "verificationReceipts": {
          "type": "array"
        },
        "executionFlow": {
          "type": "array"
        },
        "proofs": {
          "type": "array"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "additionalMetadata": {
          "type": "object"
        }
      },
      "required": [
        "@context",
        "@id",
        "@type",
        "traceId",
        "timestamp"
      ],
      "additionalProperties": true
    },
    "ForensicManifest": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "const": "ForensicManifest"
        },
        "clearContentHash": {
          "type": "string"
        },
        "instrument": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "metadata": {}
      },
      "required": [
        "@type",
        "clearContentHash",
        "instrument",
        "operator"
      ],
      "additionalProperties": true
    },
    "ForensicOperation": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "const": "ForensicOperation"
        },
        "operationId": {
          "type": "string"
        },
        "preexecutionData": {
          "type": "string"
        },
        "postexecutionData": {
          "type": "string"
        },
        "instrument": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "eventTriggerId": {
          "type": "string"
        },
        "metadata": {}
      },
      "required": [
        "@type",
        "operationId",
        "preexecutionData",
        "postexecutionData",
        "instrument",
        "operator"
      ],
      "additionalProperties": true
    },
    "ForensicOperationInstance": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "const": "ForensicOperationInstance"
        },
        "operationInstanceId": {
          "type": "string"
        },
        "preconditions": {
          "type": "string"
        },
        "postconditions": {
          "type": "string"
        }
      },
      "required": [
        "@type",
        "operationInstanceId",
        "preconditions",
        "postconditions"
      ],
      "additionalProperties": true
    },
    "ForensicEvent": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "const": "ForensicEvent"
        },
        "issuer": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "metadata": {}
      },
      "required": [
        "@type",
        "issuer",
        "description"
      ],
      "additionalProperties": true
    },
    "Collection": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@type": {
          "const": "Collection"
        },
        "elements": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "token_id": {
                "type": "string"
              },
              "node_type": {
                "type": "string"
              }
            },
            "required": [
              "token_id",
              "node_type"
            ]
          }
        }
      },
      "required": [
        "@type"
      ],
      "additionalProperties": true
    },
    "VerificationReceipt": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "@id": {
          "type": "string"
        },
        "@type": {
          "const": "VerificationReceipt"
        },
        "verifier": {
          "type": "string"
        },
        "verifierVersion": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "verificationResult": {
          "type": "object"
        },
        "signature": {
          "$ref": "#/$defs/Signature"
        },
        "blockchainAnchor": {
          "type": "object"
        }
      },
      "required": [
        "@type",
        "verifier",
        "verificationResult"
      ],
      "additionalProperties": true
    },
    "DIDDocument": {
      "type": "object",
      "properties": {
        "@context": {
          "$ref": "#/$defs/Context"
        },
        "id": {
          "type": "string"
        },
        "controller": {
          "type": "string"
        },
        "verificationMethod": {
          "type": "array"
        },
        "authentication": {
          "type": "array"
        },
        "assertionMethod": {
          "type": "array"
        },
        "service": {
          "type": "array"
        }
      },
      "required": [
        "@context",
        "id",
        "verificationMethod",
        "authentication",
        "assertionMethod"
      ],
      "additionalProperties": true
    }
  }
}