{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jdx.jupiter.ar/schema/1.0/jdx.strict.schema.json",
  "$comment": "JDX 1.0. Created by Agilmind SRL. Terms of use: see x-jdx-license.",
  "x-jdx-license": {
    "spdx": "LicenseRef-Agilmind-JDX",
    "url": "https://github.com/agilmind/jdx/blob/HEAD/LICENSE"
  },
  "$ref": "#/$defs/Document",
  "$defs": {
    "Document": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "const": "https://jdx.jupiter.ar/schema/1.0/jdx.schema.json"
        },
        "jdx": {
          "type": "string",
          "const": "1.0"
        },
        "profiles": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^https://\\S+$"
          }
        },
        "declaration": {
          "$ref": "#/$defs/Declaration"
        },
        "parties": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Party"
          }
        },
        "works": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Work"
          }
        },
        "recordings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Recording"
          }
        },
        "agreements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Agreement"
          }
        },
        "media": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Media"
          }
        },
        "edition": {
          "$ref": "#/$defs/Edition"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "$schema",
        "jdx",
        "declaration"
      ],
      "unevaluatedProperties": false
    },
    "Declaration": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "createdAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
        },
        "issuer": {
          "$ref": "#/$defs/Issuer"
        },
        "declarant": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "recipients": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Recipient"
          }
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "id",
        "revision",
        "createdAt",
        "issuer"
      ],
      "unevaluatedProperties": false
    },
    "Issuer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "name": {
          "type": "string"
        },
        "keyId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{43}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "id",
        "name",
        "keyId"
      ],
      "unevaluatedProperties": false
    },
    "Recipient": {
      "type": "object",
      "properties": {
        "society": {
          "type": "string",
          "pattern": "^(\\d{3}|X_JDX_[A-Z0-9_]+)$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "society"
      ],
      "unevaluatedProperties": false
    },
    "Name": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$",
          "x-jdx-personal-data": {
            "path": "type",
            "in": [
              "legal"
            ]
          }
        },
        "given": {
          "type": "string"
        },
        "family": {
          "type": "string"
        },
        "full": {
          "type": "string"
        },
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Registration"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "type"
      ],
      "allOf": [
        {
          "$comment": "name-full-or-family",
          "type": "object",
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "full": true
              },
              "required": [
                "full"
              ]
            },
            {
              "type": "object",
              "properties": {
                "family": true
              },
              "required": [
                "family"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "Identifier": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$",
          "x-jdx-personal-data": {
            "path": "scheme",
            "in": [
              "TAX_ID",
              "NATIONAL_ID"
            ]
          }
        },
        "value": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "type": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "society": {
          "type": "string",
          "pattern": "^(\\d{3}|X_JDX_[A-Z0-9_]+)$"
        },
        "issuer": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "value"
      ],
      "allOf": [
        {
          "$comment": "identifier-tax-or-national-id-fields",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "scheme": {
                "type": "string",
                "enum": [
                  "TAX_ID",
                  "NATIONAL_ID"
                ]
              }
            },
            "required": [
              "scheme"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "country": true,
              "type": true
            },
            "required": [
              "country",
              "type"
            ]
          }
        },
        {
          "$comment": "identifier-society-fields",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "scheme": {
                "type": "string",
                "enum": [
                  "SOCIETY_WORK",
                  "SOCIETY_RECORDING"
                ]
              }
            },
            "required": [
              "scheme"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "society": true
            },
            "required": [
              "society"
            ]
          }
        },
        {
          "$comment": "identifier-catalog-number-issuer",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "scheme": {
                "type": "string",
                "enum": [
                  "CATALOG_NUMBER"
                ]
              }
            },
            "required": [
              "scheme"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "issuer": true
            },
            "required": [
              "issuer"
            ]
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "Classification": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "Condition": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "StandardContract": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "Territories": {
      "type": "object",
      "properties": {
        "include": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d{4}$"
          },
          "minItems": 1
        },
        "exclude": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d{4}$"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "include"
      ],
      "unevaluatedProperties": false
    },
    "Address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string"
        },
        "floor": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "subdivision": {
          "$ref": "#/$defs/Subdivision"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Place": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string"
        },
        "subdivision": {
          "$ref": "#/$defs/Subdivision"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Subdivision": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "name"
      ],
      "unevaluatedProperties": false
    },
    "Contact": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
          "x-jdx-personal-data": true
        },
        "phone": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$",
          "x-jdx-personal-data": true
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Amount": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d{1,4})?$"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "amount",
        "currency"
      ],
      "unevaluatedProperties": false
    },
    "Registration": {
      "type": "object",
      "properties": {
        "registry": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "kind": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "number": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "expiryDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "filing": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "registrationFiling"
          ]
        },
        "certificate": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "registrationCertificate"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "registry",
        "kind"
      ],
      "unevaluatedProperties": false
    },
    "WorkRegistration": {
      "type": "object",
      "properties": {
        "registry": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "kind": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "part": {
          "type": "string",
          "enum": [
            "music",
            "lyrics",
            "both"
          ]
        },
        "number": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "expiryDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "filing": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "registrationFiling"
          ]
        },
        "certificate": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "registrationCertificate"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "registry",
        "kind"
      ],
      "unevaluatedProperties": false
    },
    "Party": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "kind": {
          "type": "string",
          "enum": [
            "person",
            "organization"
          ]
        },
        "names": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "gender": {
          "type": "string",
          "enum": [
            "female",
            "male",
            "nonBinary",
            "undisclosed"
          ],
          "x-jdx-personal-data": true
        },
        "birthDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "x-jdx-personal-data": true
        },
        "deathDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "x-jdx-personal-data": true
        },
        "nationality": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "x-jdx-personal-data": true
        },
        "maritalStatus": {
          "type": "string",
          "enum": [
            "single",
            "married",
            "commonLawUnion",
            "civilUnion",
            "separated",
            "divorced",
            "widowed",
            "notDeclared"
          ],
          "x-jdx-personal-data": true
        },
        "address": {
          "$ref": "#/$defs/Address",
          "x-jdx-personal-data": true
        },
        "contact": {
          "$ref": "#/$defs/Contact",
          "x-jdx-personal-data": true
        },
        "affiliations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Affiliation"
          }
        },
        "legalRepresentatives": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LegalRepresentative"
          }
        },
        "successors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Successor"
          }
        },
        "representatives": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Representative"
          }
        },
        "media": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "media"
          }
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "id",
        "kind"
      ],
      "allOf": [
        {
          "$comment": "party-organization-names-full",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "organization"
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "names": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "full": true,
                    "given": {
                      "not": {}
                    },
                    "family": {
                      "not": {}
                    }
                  },
                  "required": [
                    "full"
                  ]
                }
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "Affiliation": {
      "type": "object",
      "properties": {
        "society": {
          "type": "string",
          "pattern": "^(\\d{3}|X_JDX_[A-Z0-9_]+)$"
        },
        "memberNumber": {
          "type": "string"
        },
        "rights": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "performing",
              "mechanical",
              "synchronization",
              "print"
            ]
          }
        },
        "territories": {
          "$ref": "#/$defs/Territories"
        },
        "startDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "endDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "society"
      ],
      "unevaluatedProperties": false
    },
    "LegalRepresentative": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "capacity": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "Successor": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "capacity": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "Representative": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "title": {
          "type": "string"
        },
        "signatory": {
          "type": "boolean"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "Work": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "titles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Title"
          },
          "minItems": 1
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "classifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Classification"
          }
        },
        "distributionCategory": {
          "type": "string",
          "enum": [
            "POP",
            "SER",
            "JAZ",
            "UNC"
          ]
        },
        "duration": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "textMusicRelationship": {
          "type": "string",
          "enum": [
            "music",
            "text",
            "musicAndText",
            "musicAndTextSeparate"
          ]
        },
        "lyricsLanguages": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
          }
        },
        "lyrics": {
          "$ref": "#/$defs/Lyrics"
        },
        "creationDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "firstPerformance": {
          "$ref": "#/$defs/FirstPerformance"
        },
        "publicationStatus": {
          "type": "string",
          "enum": [
            "unpublished",
            "published"
          ]
        },
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WorkRegistration"
          }
        },
        "version": {
          "$ref": "#/$defs/Version"
        },
        "composite": {
          "$ref": "#/$defs/Composite"
        },
        "excerptOf": {
          "$ref": "#/$defs/WorkRef"
        },
        "commissioned": {
          "$ref": "#/$defs/Commission"
        },
        "ai": {
          "$ref": "#/$defs/Ai"
        },
        "instrumentation": {
          "$ref": "#/$defs/Instrumentation"
        },
        "grandRights": {
          "type": "boolean"
        },
        "origin": {
          "$ref": "#/$defs/Origin"
        },
        "contributors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Contributor"
          }
        },
        "authorship": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Authorship"
          }
        },
        "shares": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Share"
          }
        },
        "recordings": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "recordings"
          }
        },
        "media": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "media"
          }
        },
        "notes": {
          "type": "string"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "id",
        "titles"
      ],
      "unevaluatedProperties": false
    },
    "Title": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "text": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "text"
      ],
      "unevaluatedProperties": false
    },
    "Lyrics": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "text"
      ],
      "unevaluatedProperties": false
    },
    "FirstPerformance": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "venue": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "WorkRef": {
      "type": "object",
      "properties": {
        "work": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "works"
        },
        "external": {
          "$ref": "#/$defs/External"
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "work-ref-work-or-external",
          "type": "object",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "work": true
              },
              "required": [
                "work"
              ]
            },
            {
              "type": "object",
              "properties": {
                "external": true
              },
              "required": [
                "external"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "External": {
      "type": "object",
      "properties": {
        "titles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Title"
          }
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "writers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExternalWriter"
          }
        },
        "publicDomain": {
          "type": "boolean"
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "external-titles-or-identifiers",
          "type": "object",
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "titles": true
              },
              "required": [
                "titles"
              ]
            },
            {
              "type": "object",
              "properties": {
                "identifiers": true
              },
              "required": [
                "identifiers"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "ExternalWriter": {
      "type": "object",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "birthDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "deathDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Version": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "original",
            "arrangement",
            "adaptation",
            "translation",
            "lyricReplacement",
            "other"
          ]
        },
        "original": {
          "$ref": "#/$defs/WorkRef"
        },
        "authorization": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "agreements",
          "x-jdx-ref-type": [
            "derivativeAuthorization"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "type"
      ],
      "unevaluatedProperties": false
    },
    "Composite": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "medley",
            "potpourri",
            "composite",
            "mashup",
            "withSamples"
          ]
        },
        "components": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Component"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "type"
      ],
      "unevaluatedProperties": false
    },
    "Component": {
      "type": "object",
      "properties": {
        "work": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "works"
        },
        "external": {
          "$ref": "#/$defs/External"
        },
        "duration": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "component-work-or-external",
          "type": "object",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "work": true
              },
              "required": [
                "work"
              ]
            },
            {
              "type": "object",
              "properties": {
                "external": true
              },
              "required": [
                "external"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "Commission": {
      "type": "object",
      "properties": {
        "commissioned": {
          "type": "boolean"
        },
        "commissioner": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "commissioned"
      ],
      "unevaluatedProperties": false
    },
    "Ai": {
      "type": "object",
      "properties": {
        "declared": {
          "type": "boolean"
        },
        "elements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AiElement"
          }
        },
        "humanContribution": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "AiElement": {
      "type": "object",
      "properties": {
        "element": {
          "type": "string",
          "enum": [
            "lyrics",
            "melody",
            "harmony",
            "arrangement"
          ]
        },
        "involvement": {
          "type": "string",
          "enum": [
            "none",
            "assisted",
            "generated"
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompt": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "element",
        "involvement"
      ],
      "unevaluatedProperties": false
    },
    "Instrumentation": {
      "type": "object",
      "properties": {
        "voices": {
          "type": "integer",
          "minimum": 0
        },
        "instruments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Instrument"
          }
        },
        "description": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Instrument": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": 1
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "Origin": {
      "type": "object",
      "properties": {
        "purpose": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "usage": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "productionTitle": {
          "type": "string"
        },
        "productionNumber": {
          "type": "string"
        },
        "productionYear": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 9999
        },
        "episodeTitle": {
          "type": "string"
        },
        "episodeNumber": {
          "type": "string"
        },
        "advertiser": {
          "type": "string"
        },
        "product": {
          "type": "string"
        },
        "library": {
          "type": "string"
        },
        "cdIdentifier": {
          "type": "string"
        },
        "cutNumber": {
          "type": "integer",
          "minimum": 1
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Contributor": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
          },
          "minItems": 1
        },
        "creditedAs": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party",
        "roles"
      ],
      "unevaluatedProperties": false
    },
    "Authorship": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "part": {
          "type": "string",
          "enum": [
            "music",
            "lyrics"
          ]
        },
        "percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "agreement": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "agreements",
          "x-jdx-ref-type": [
            "writerSplit"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party",
        "part",
        "percent"
      ],
      "unevaluatedProperties": false
    },
    "Share": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "enum": [
            "writer",
            "originalPublisher",
            "subPublisher",
            "substitutedPublisher",
            "administrator",
            "incomeParticipant",
            "acquirer"
          ]
        },
        "via": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "parties"
          }
        },
        "agreement": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "agreements",
          "x-jdx-ref-type": [
            "publishing",
            "subPublishing",
            "administration",
            "assignment",
            "writerSplit"
          ]
        },
        "rights": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "performing",
              "mechanical",
              "synchronization",
              "print"
            ]
          }
        },
        "territories": {
          "$ref": "#/$defs/Territories"
        },
        "percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party",
        "role",
        "percent"
      ],
      "unevaluatedProperties": false
    },
    "Recording": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "title": {
          "type": "string"
        },
        "versionTitle": {
          "type": "string"
        },
        "displayArtist": {
          "type": "string"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "isrcIssuer": {
          "$ref": "#/$defs/IsrcIssuer"
        },
        "works": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "works"
          }
        },
        "purposes": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
          }
        },
        "type": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "duration": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "recordingDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "fixationCountry": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "firstPublication": {
          "$ref": "#/$defs/FirstPublication"
        },
        "producers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Producer"
          }
        },
        "pLine": {
          "$ref": "#/$defs/PLine"
        },
        "label": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "release": {
          "$ref": "#/$defs/Release"
        },
        "performers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Performer"
          }
        },
        "contributors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RecordingContributor"
          }
        },
        "samples": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Sample"
          }
        },
        "ai": {
          "$ref": "#/$defs/RecordingAi"
        },
        "languageOfPerformance": {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Link"
          }
        },
        "media": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "media"
          }
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "id"
      ],
      "unevaluatedProperties": false
    },
    "IsrcIssuer": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "agency",
            "aggregator"
          ]
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "FirstPublication": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$"
        },
        "simultaneous": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Producer": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "enum": [
            "original",
            "licensor",
            "licensee"
          ]
        },
        "percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "PLine": {
      "type": "object",
      "properties": {
        "year": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 9999
        },
        "owner": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "text": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Release": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "carrier": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Performer": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "instruments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PerformerInstrument"
          }
        },
        "credited": {
          "type": "boolean"
        },
        "societyCategories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SocietyCategory"
          }
        },
        "participation": {
          "$ref": "#/$defs/Participation"
        },
        "members": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "parties"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "PerformerInstrument": {
      "type": "object",
      "properties": {
        "scheme": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
        },
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "scheme",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "SocietyCategory": {
      "type": "object",
      "properties": {
        "society": {
          "type": "string",
          "pattern": "^(\\d{3}|X_JDX_[A-Z0-9_]+)$"
        },
        "code": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "society",
        "code"
      ],
      "unevaluatedProperties": false
    },
    "Participation": {
      "type": "object",
      "properties": {
        "fraction": {
          "type": "string",
          "pattern": "^[1-9]\\d*/[1-9]\\d*$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "fraction"
      ],
      "unevaluatedProperties": false
    },
    "RecordingContributor": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party",
        "role"
      ],
      "unevaluatedProperties": false
    },
    "Sample": {
      "type": "object",
      "properties": {
        "recording": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "recordings"
        },
        "external": {
          "$ref": "#/$defs/ExternalRecording"
        },
        "producer": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "authorization": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "agreements",
          "x-jdx-ref-type": [
            "derivativeAuthorization"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "sample-recording-or-external",
          "type": "object",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "recording": true
              },
              "required": [
                "recording"
              ]
            },
            {
              "type": "object",
              "properties": {
                "external": true
              },
              "required": [
                "external"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "ExternalRecording": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "displayArtist": {
          "type": "string"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "external-recording-title-or-identifiers",
          "type": "object",
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "title": true
              },
              "required": [
                "title"
              ]
            },
            {
              "type": "object",
              "properties": {
                "identifiers": true
              },
              "required": [
                "identifiers"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "RecordingAi": {
      "type": "object",
      "properties": {
        "declared": {
          "type": "boolean"
        },
        "elements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RecordingAiElement"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "RecordingAiElement": {
      "type": "object",
      "properties": {
        "element": {
          "type": "string",
          "enum": [
            "vocals",
            "instruments",
            "arrangement"
          ]
        },
        "involvement": {
          "type": "string",
          "enum": [
            "none",
            "assisted",
            "generated"
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prompt": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "element",
        "involvement"
      ],
      "unevaluatedProperties": false
    },
    "Link": {
      "type": "object",
      "properties": {
        "platform": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "url": {
          "type": "string",
          "pattern": "^https?://\\S+$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "url"
      ],
      "unevaluatedProperties": false
    },
    "Agreement": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "uid": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "type": {
          "type": "string",
          "enum": [
            "publishing",
            "subPublishing",
            "administration",
            "assignment",
            "derivativeAuthorization",
            "writerSplit"
          ]
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "parties": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgreementParty"
          }
        },
        "parent": {
          "$ref": "#/$defs/AgreementParent"
        },
        "works": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "works"
          }
        },
        "numberOfWorks": {
          "type": "integer",
          "minimum": 1
        },
        "scope": {
          "type": "string",
          "enum": [
            "works",
            "catalog"
          ]
        },
        "grantedRights": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "performing",
              "mechanical",
              "synchronization",
              "print"
            ]
          }
        },
        "rights": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "performing",
              "mechanical",
              "synchronization",
              "print"
            ]
          }
        },
        "excludedRights": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExcludedRight"
          }
        },
        "territories": {
          "$ref": "#/$defs/Territories"
        },
        "signatureDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "signedPlace": {
          "$ref": "#/$defs/Place"
        },
        "startDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "term": {
          "$ref": "#/$defs/Term"
        },
        "endDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "renewal": {
          "$ref": "#/$defs/Renewal"
        },
        "postTermCollection": {
          "$ref": "#/$defs/PostTermCollection"
        },
        "publisherShare": {
          "$ref": "#/$defs/PublisherShare"
        },
        "terms": {
          "$ref": "#/$defs/Terms"
        },
        "observations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Observation"
          }
        },
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Registration"
          }
        },
        "media": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "media",
            "x-jdx-ref-type": [
              "signedContract",
              "splitAgreement"
            ]
          }
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "allOf": [
        {
          "$comment": "agreement-protection-period-without-end-date",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "term": {
                "type": "object",
                "properties": {
                  "basis": {
                    "type": "string",
                    "enum": [
                      "protectionPeriod"
                    ]
                  }
                },
                "required": [
                  "basis"
                ]
              }
            },
            "required": [
              "term"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "endDate": {
                "not": {}
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "AgreementParty": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "role": {
          "type": "string",
          "enum": [
            "grantor",
            "grantee",
            "coWriter"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party",
        "role"
      ],
      "unevaluatedProperties": false
    },
    "AgreementParent": {
      "type": "object",
      "properties": {
        "agreement": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "agreements"
        },
        "uid": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "allOf": [
        {
          "$comment": "agreement-parent-agreement-or-uid",
          "type": "object",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "agreement": true
              },
              "required": [
                "agreement"
              ]
            },
            {
              "type": "object",
              "properties": {
                "uid": true
              },
              "required": [
                "uid"
              ]
            }
          ]
        }
      ],
      "unevaluatedProperties": false
    },
    "ExcludedRight": {
      "type": "object",
      "properties": {
        "right": {
          "type": "string",
          "enum": [
            "performing",
            "mechanical",
            "synchronization",
            "print"
          ]
        },
        "observation": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "right"
      ],
      "unevaluatedProperties": false
    },
    "Term": {
      "type": "object",
      "properties": {
        "basis": {
          "type": "string",
          "enum": [
            "protectionPeriod",
            "fixed"
          ]
        },
        "duration": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "basis"
      ],
      "allOf": [
        {
          "$comment": "term-fixed-duration",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "basis": {
                "type": "string",
                "enum": [
                  "fixed"
                ]
              }
            },
            "required": [
              "basis"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "duration": true
            },
            "required": [
              "duration"
            ]
          }
        },
        {
          "$comment": "term-protection-period-without-duration",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "basis": {
                "type": "string",
                "enum": [
                  "protectionPeriod"
                ]
              }
            },
            "required": [
              "basis"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "duration": {
                "not": {}
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "Renewal": {
      "type": "object",
      "properties": {
        "automatic": {
          "type": "boolean"
        },
        "period": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "maxRenewals": {
          "type": "integer",
          "minimum": 0
        },
        "noticePeriod": {
          "type": "string",
          "pattern": "^P(?!$)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+S)?)?$"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "PostTermCollection": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "openEnded",
            "date"
          ]
        },
        "endDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "status"
      ],
      "allOf": [
        {
          "$comment": "post-term-collection-end-date-iff-date",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "date"
                ]
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "endDate": true
            },
            "required": [
              "endDate"
            ]
          },
          "else": {
            "type": "object",
            "properties": {
              "endDate": {
                "not": {}
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "PublisherShare": {
      "type": "object",
      "properties": {
        "percent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "condition": {
          "$ref": "#/$defs/Condition"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "percent"
      ],
      "unevaluatedProperties": false
    },
    "Terms": {
      "type": "object",
      "properties": {
        "template": {
          "$ref": "#/$defs/Template"
        },
        "basedOn": {
          "$ref": "#/$defs/StandardContract"
        },
        "values": {
          "$ref": "#/$defs/TermValues"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Template": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "sha256"
      ],
      "unevaluatedProperties": false
    },
    "TermValues": {
      "type": "object",
      "properties": {
        "retailPricePercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "arrangementRetailPricePercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "collectionStart": {
          "type": "string",
          "enum": [
            "presentationSemester",
            "nextSemester"
          ]
        },
        "investedAmount": {
          "$ref": "#/$defs/InvestedAmount"
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "InvestedAmount": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "determined",
            "undetermined"
          ]
        },
        "amount": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d{1,4})?$"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "status"
      ],
      "allOf": [
        {
          "$comment": "invested-amount-determined",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "determined"
                ]
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "amount": true,
              "currency": true
            },
            "required": [
              "amount",
              "currency"
            ]
          }
        },
        {
          "$comment": "invested-amount-undetermined-without-amount",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "undetermined"
                ]
              }
            },
            "required": [
              "status"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "amount": {
                "not": {}
              },
              "currency": {
                "not": {}
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "Observation": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "article": {
          "type": "string"
        },
        "parties": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "parties"
          }
        },
        "text": {
          "type": "string"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "text"
      ],
      "unevaluatedProperties": false
    },
    "Edition": {
      "type": "object",
      "properties": {
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "name": {
          "type": "string"
        },
        "registeredTitle": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "contentType": {
          "type": "string",
          "enum": [
            "scores",
            "audios",
            "scoresAndAudios"
          ]
        },
        "ordinal": {
          "type": "integer",
          "minimum": 1
        },
        "publishers": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "parties"
          }
        },
        "publicationDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "publicationPlace": {
          "$ref": "#/$defs/Place"
        },
        "publicationLinks": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^https?://\\S+$"
          }
        },
        "price": {
          "$ref": "#/$defs/Amount"
        },
        "printRun": {
          "$ref": "#/$defs/PrintRun"
        },
        "works": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "works"
          }
        },
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Registration"
          }
        },
        "deposit": {
          "$ref": "#/$defs/Deposit"
        },
        "media": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "x-jdx-ref": "media"
          }
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "unevaluatedProperties": false
    },
    "PrintRun": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "printed",
            "onDemand"
          ]
        },
        "saleCopies": {
          "type": "integer",
          "minimum": 0
        },
        "promotionalCopies": {
          "type": "integer",
          "minimum": 0
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "Deposit": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "physical",
            "digital"
          ]
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "copy": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "legalDepositCopy"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "mode"
      ],
      "unevaluatedProperties": false
    },
    "Media": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "kind": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "mediaType": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9!#$&^_.+-]*/[a-z0-9][a-z0-9!#$&^_.+-]*$"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "path": {
          "type": "string"
        },
        "delivery": {
          "type": "integer",
          "minimum": 1
        },
        "delivered": {
          "type": "boolean"
        },
        "personalData": {
          "type": "boolean"
        },
        "evidence": {
          "$ref": "#/$defs/Evidence"
        },
        "extensions": {
          "$ref": "#/$defs/Extensions"
        }
      },
      "required": [
        "id",
        "kind"
      ],
      "allOf": [
        {
          "$comment": "media-not-delivered-without-path",
          "type": "object",
          "if": {
            "type": "object",
            "properties": {
              "delivered": {
                "type": "boolean",
                "enum": [
                  false
                ]
              }
            },
            "required": [
              "delivered"
            ]
          },
          "then": {
            "type": "object",
            "properties": {
              "path": {
                "not": {}
              }
            }
          }
        }
      ],
      "unevaluatedProperties": false
    },
    "Evidence": {
      "type": "object",
      "properties": {
        "esignature": {
          "$ref": "#/$defs/ESignature"
        },
        "signers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Signer"
          }
        },
        "annexed": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Annexed"
          }
        },
        "anchors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Anchor"
          }
        },
        "extensions": {
          "not": {}
        }
      },
      "unevaluatedProperties": false
    },
    "ESignature": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "envelopeId": {
          "type": "string"
        },
        "legalClass": {
          "type": "string",
          "enum": [
            "electronic",
            "digital"
          ]
        },
        "identityMethods": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
          }
        },
        "contactSource": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "timestamp": {
          "$ref": "#/$defs/Timestamp"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "provider"
      ],
      "unevaluatedProperties": false
    },
    "Timestamp": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "pdfEmbedded",
            "tsa"
          ]
        },
        "generatedAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "source",
        "generatedAt"
      ],
      "unevaluatedProperties": false
    },
    "Signer": {
      "type": "object",
      "properties": {
        "party": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "onBehalfOf": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "parties"
        },
        "signedAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?(Z|[+-]\\d{2}:\\d{2})$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "party"
      ],
      "unevaluatedProperties": false
    },
    "Annexed": {
      "type": "object",
      "properties": {
        "fileName": {
          "type": "string"
        },
        "media": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "sha256"
      ],
      "unevaluatedProperties": false
    },
    "Anchor": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "pattern": "^([a-z][A-Za-z0-9]*|X_[A-Z0-9]+(_[A-Z0-9]+)*)$"
        },
        "proof": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$",
          "x-jdx-ref": "media",
          "x-jdx-ref-type": [
            "timestampProof"
          ]
        },
        "extensions": {
          "not": {}
        }
      },
      "required": [
        "method"
      ],
      "unevaluatedProperties": false
    },
    "Extensions": {
      "type": "object",
      "patternProperties": {
        "^[a-z0-9-]+(\\.[a-z0-9-]+)+$": {
          "$ref": "#/$defs/ExtensionValue"
        }
      },
      "additionalProperties": false
    },
    "ExtensionValue": {
      "type": [
        "boolean",
        "number",
        "string",
        "array",
        "object"
      ],
      "items": {
        "$ref": "#/$defs/ExtensionValue"
      },
      "additionalProperties": {
        "$ref": "#/$defs/ExtensionValue"
      }
    }
  }
}
