{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aeternumfoundation.org/schema/golden-codex/1.2.0/full.schema.json",
  "title": "Golden Codex: the full record (the canon)",
  "x-status": "Golden Codex 1.2.0.",
  "description": "The complete record for a visual work. Every smaller tier is generated from this record. It must state the version, an identifier, a title, the image's fingerprint, and who made the work and how. 'Unknown' and 'not_determined' are honest answers and must be stated. Other sections appear only when there is something true to say; when a section appears, its rules apply.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "schemaVersion": {
      "const": "1.2.0"
    },
    "tier": {
      "const": "full"
    },
    "timestamp": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "created": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        },
        "enriched": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        },
        "embedded": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        },
        "issued": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        }
      }
    },
    "_identifiers": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "artifactId": {
          "type": "string",
          "minLength": 1
        },
        "codexId": {
          "type": "string",
          "minLength": 1
        },
        "uuid": {
          "type": "string",
          "minLength": 1
        },
        "earlier": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Every earlier identifier, namespace-qualified. None is dropped."
        },
        "issuer": {
          "type": "string",
          "minLength": 1,
          "description": "Who issued this record: one reference, stated once."
        }
      },
      "required": [
        "artifactId"
      ],
      "description": "The record's Soulmark is computed from the record, so it is never stored inside it and cannot drift from it. See SPEC.md section 3."
    },
    "binding": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "image": {
          "type": "string",
          "minLength": 1,
          "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
          "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
        },
        "renditions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
            "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
          },
          "description": "The Soulmarks of other files of this same picture that the record vouches for: a thumbnail, a web copy, another format. A label or pointer may travel only with an image listed here or with the image itself."
        },
        "media_type": {
          "type": "string",
          "minLength": 1
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "perceptual": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "alg": {
                "type": "string",
                "minLength": 1
              },
              "value": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "alg",
              "value"
            ]
          }
        }
      },
      "required": [
        "image"
      ],
      "description": "The image this record describes. 'image' is the image's Soulmark: SHA-256 over everything in the file that determines what the picture looks like and nothing that is metadata, under the rule in SPEC.md section 4. The rule is defined for JPEG and PNG, and embedding a record never changes the value."
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "What is shown, factually."
    },
    "visual_analysis": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "color_palette": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "color_name": {
                "type": "string",
                "minLength": 1
              },
              "hex": {
                "type": "string",
                "minLength": 1,
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "description": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "hex"
            ]
          }
        },
        "composition": {
          "type": "string",
          "minLength": 1
        },
        "lighting_and_shading": {
          "type": "string",
          "minLength": 1
        },
        "style_and_technique": {
          "type": "string",
          "minLength": 1
        },
        "objective_description": {
          "type": "string",
          "minLength": 1
        },
        "authorship": {
          "$ref": "#/$defs/authorship"
        }
      },
      "required": [
        "authorship"
      ]
    },
    "artistic_statement": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "intent": {
          "type": "string",
          "minLength": 1
        },
        "themes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "authorship": {
          "allOf": [
            {
              "$ref": "#/$defs/authorship"
            },
            {
              "properties": {
                "mode": {
                  "const": "creator_statement"
                }
              }
            }
          ]
        }
      },
      "required": [
        "authorship"
      ],
      "description": "The creator's own words, and only those."
    },
    "contextual_graph": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "keywords": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "related_artistic_movements": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "related_concepts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "schema_org_type": {
          "type": "string",
          "minLength": 1
        }
      },
      "description": "Terms that help a reader find the work. They assert no meaning, so they carry no authorship."
    },
    "emotional_and_thematic_journey": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "primary_emotion": {
          "type": "string",
          "minLength": 1
        },
        "secondary_emotions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "mood": {
          "type": "string",
          "minLength": 1
        },
        "narrative_arc": {
          "type": "string",
          "minLength": 1
        },
        "authorship": {
          "$ref": "#/$defs/authorship"
        }
      },
      "required": [
        "authorship"
      ]
    },
    "symbolism_and_iconography": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "primary_symbols": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "secondary_symbols": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "archetypal_elements": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "authorship": {
          "$ref": "#/$defs/authorship"
        }
      },
      "required": [
        "authorship"
      ]
    },
    "cultural_and_artistic_context": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "period_and_movement": {
          "type": "string",
          "minLength": 1
        },
        "influences": {
          "type": "string",
          "minLength": 1
        },
        "iconography": {
          "type": "string",
          "minLength": 1
        },
        "cultural_significance": {
          "type": "string",
          "minLength": 1
        },
        "authorship": {
          "$ref": "#/$defs/authorship"
        }
      },
      "required": [
        "authorship"
      ]
    },
    "provenance_and_lineage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "artist_information": {
          "type": "string",
          "minLength": 1
        },
        "creation_date": {
          "type": "string",
          "minLength": 1
        },
        "technical_lineage": {
          "type": "string",
          "minLength": 1
        },
        "provenance": {
          "type": "string",
          "minLength": 1
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "original_work",
                  "object_or_impression",
                  "reproduction",
                  "earlier_digital_record"
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1
              },
              "fingerprint": {
                "type": "string",
                "minLength": 1,
                "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
                "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
              },
              "source": {
                "$ref": "#/$defs/source"
              }
            },
            "required": [
              "kind",
              "source"
            ]
          }
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/event"
          }
        },
        "supersedes": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "record": {
              "type": "string",
              "minLength": 1,
              "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
              "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "record",
            "reason"
          ],
          "description": "The record this one replaces, identified by its Soulmark. The earlier record is never edited and remains evidence."
        },
        "first_inscribed": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "at": {
              "type": "string",
              "minLength": 1
            },
            "evidence": {
              "$ref": "#/$defs/source"
            },
            "evidence_gap": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "at"
          ],
          "oneOf": [
            {
              "required": [
                "evidence"
              ]
            },
            {
              "required": [
                "evidence_gap"
              ]
            }
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "required": [
              "supersedes"
            ]
          },
          "then": {
            "required": [
              "first_inscribed"
            ]
          }
        }
      ]
    },
    "technical_details": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "medium_and_technique": {
          "type": "string",
          "minLength": 1
        },
        "dimensions": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "width": {
              "type": "integer"
            },
            "height": {
              "type": "integer"
            },
            "unit": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "file_format": {
          "type": "string",
          "minLength": 1
        },
        "color_space": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "creation_credits": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "credits": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "agent": {
                "$ref": "#/$defs/agent"
              },
              "role": {
                "type": "string",
                "minLength": 1
              },
              "subject": {
                "enum": [
                  "original_work",
                  "reproduction",
                  "image_file",
                  "record",
                  "interpretation"
                ]
              },
              "qualifier": {
                "enum": [
                  "attributed to",
                  "workshop of",
                  "studio of",
                  "circle of",
                  "follower of",
                  "manner of",
                  "school of",
                  "after",
                  "copy after",
                  "probably by",
                  "possibly by",
                  "office of"
                ],
                "description": "How firmly the work is given to this maker, in the fixed terms cataloguers use."
              },
              "evidence": {
                "enum": [
                  "documented",
                  "attributed",
                  "inferred",
                  "disputed",
                  "unknown"
                ]
              },
              "source": {
                "$ref": "#/$defs/source"
              }
            },
            "required": [
              "agent",
              "role"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "evidence": {
                      "const": "documented"
                    }
                  },
                  "required": [
                    "evidence"
                  ]
                },
                "then": {
                  "required": [
                    "source"
                  ]
                }
              }
            ]
          },
          "minItems": 1
        },
        "made": {
          "enum": [
            "digitalCapture",
            "computationalCapture",
            "negativeFilm",
            "positiveFilm",
            "print",
            "humanEdits",
            "compositeWithTrainedAlgorithmicMedia",
            "algorithmicallyEnhanced",
            "digitalCreation",
            "dataDrivenMedia",
            "trainedAlgorithmicMedia",
            "algorithmicMedia",
            "screenCapture",
            "virtualRecording",
            "composite",
            "compositeCapture",
            "compositeSynthetic",
            "empty",
            "trainedAlgorithmicData",
            "not_determined"
          ],
          "description": "How the pixels were made: the IPTC Digital Source Type term (or one of the two C2PA terms), or not_determined. The full URI is http://cv.iptc.org/newscodes/digitalsourcetype/<term>."
        },
        "made_source": {
          "$ref": "#/$defs/source"
        },
        "ai": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "by": {
              "type": "string",
              "minLength": 1,
              "description": "Provider."
            },
            "sys": {
              "type": "string",
              "minLength": 1,
              "description": "System and version."
            },
            "at": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "description": "Content identifier."
            }
          },
          "required": [
            "by",
            "sys"
          ],
          "description": "AI disclosure carried in the file at every tier: provider, system and version, time, identifier."
        },
        "human_contribution": {
          "type": "string",
          "minLength": 1,
          "description": "No personal data: this text is permanent."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "made": {
                "enum": [
                  "trainedAlgorithmicMedia",
                  "compositeWithTrainedAlgorithmicMedia",
                  "algorithmicMedia"
                ]
              }
            },
            "required": [
              "made"
            ]
          },
          "then": {
            "required": [
              "ai"
            ]
          }
        },
        {
          "if": {
            "required": [
              "ai"
            ]
          },
          "then": {
            "required": [
              "made"
            ],
            "properties": {
              "made": {
                "enum": [
                  "trainedAlgorithmicMedia",
                  "compositeWithTrainedAlgorithmicMedia",
                  "algorithmicMedia"
                ]
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "made": {
                "enum": [
                  "digitalCapture",
                  "computationalCapture",
                  "negativeFilm",
                  "positiveFilm",
                  "print",
                  "humanEdits",
                  "compositeWithTrainedAlgorithmicMedia",
                  "algorithmicallyEnhanced",
                  "digitalCreation",
                  "dataDrivenMedia",
                  "trainedAlgorithmicMedia",
                  "algorithmicMedia",
                  "screenCapture",
                  "virtualRecording",
                  "composite",
                  "compositeCapture",
                  "compositeSynthetic",
                  "empty",
                  "trainedAlgorithmicData"
                ]
              }
            },
            "required": [
              "made"
            ]
          },
          "then": {
            "required": [
              "made_source"
            ]
          }
        }
      ],
      "required": [
        "credits",
        "made"
      ]
    },
    "rights": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "work": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/rights_statement"
          }
        },
        "ai_use": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "cawg.data_mining": {
              "enum": [
                "allowed",
                "notAllowed",
                "constrained"
              ]
            },
            "cawg.ai_inference": {
              "enum": [
                "allowed",
                "notAllowed",
                "constrained"
              ]
            },
            "cawg.ai_generative_training": {
              "enum": [
                "allowed",
                "notAllowed",
                "constrained"
              ]
            },
            "cawg.ai_training": {
              "enum": [
                "allowed",
                "notAllowed",
                "constrained"
              ]
            },
            "source": {
              "$ref": "#/$defs/source"
            }
          },
          "required": [
            "source"
          ],
          "description": "The maker's preference on AI use, as a named source reports it. The four field names are the training and data mining terms published by the Creator Assertions Working Group, used unchanged so that a preference stated there can be carried here without translation."
        },
        "grants": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "right": {
                "enum": [
                  "ownership",
                  "copyright",
                  "trade",
                  "curation",
                  "custody",
                  "control",
                  "display",
                  "reproduction",
                  "commercial_use",
                  "modification",
                  "ai_training",
                  "ai_inference",
                  "data_mining"
                ],
                "description": "Which right. Rights are separate: one party may hold the right to trade while another holds curation."
              },
              "in": {
                "enum": [
                  "work",
                  "image",
                  "record"
                ],
                "description": "What the right is in: the work itself, this image file, or this record (for an inscribed record, the asset)."
              },
              "held_by": {
                "$ref": "#/$defs/agent"
              },
              "granted_by": {
                "$ref": "#/$defs/agent"
              },
              "basis": {
                "$ref": "#/$defs/source"
              },
              "from": {
                "type": "string",
                "minLength": 1,
                "description": "ISO 8601 date or time."
              },
              "until": {
                "type": "string",
                "minLength": 1,
                "description": "ISO 8601 date or time. Absent means no end is stated."
              },
              "conditions": {
                "type": "string",
                "minLength": 1,
                "description": "Conditions on the right, in words: attribution required, non-exclusive, and so on."
              },
              "fee": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "amount": {
                    "type": "string",
                    "minLength": 1,
                    "description": "A plain decimal number as text.",
                    "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$"
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Currency or token symbol."
                  },
                  "per": {
                    "enum": [
                      "use",
                      "item",
                      "month",
                      "year",
                      "once"
                    ]
                  },
                  "pay_to": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Where the fee is paid: a wallet address or a payment address."
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "per"
                ],
                "description": "A predetermined fee for exercising this right, set by whoever grants it. Used for training rights in particular."
              }
            },
            "required": [
              "right",
              "in",
              "held_by",
              "basis"
            ],
            "dependentRequired": {
              "fee": [
                "granted_by"
              ]
            }
          },
          "description": "Who holds which right, by whose grant, on what basis. An owner and a curator can both exist for the same record."
        },
        "record": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "license": {
              "type": "string",
              "format": "uri",
              "minLength": 8
            }
          },
          "description": "The licence of the record itself."
        }
      },
      "description": "What the record establishes about rights: the rights the author declares in the work, rights as other named sources report them, who holds which right by whose grant, and the maker's preference on AI use. An author who declares nothing leaves this empty."
    },
    "content_credentials": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "state": {
          "enum": [
            "none",
            "malformed",
            "invalid",
            "wellFormed",
            "valid",
            "trusted"
          ]
        },
        "codes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "signer": {
          "type": "string",
          "minLength": 1
        },
        "claim_generator": {
          "type": "string",
          "minLength": 1
        },
        "trust_list": {
          "type": "string",
          "format": "uri",
          "minLength": 8
        },
        "validator": {
          "type": "string",
          "minLength": 1,
          "description": "Name and version."
        },
        "validated_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        }
      },
      "required": [
        "state",
        "validator",
        "validated_at"
      ],
      "description": "What a validator read in the file, together with the validator and the time. This is a report, never a property of the work.",
      "allOf": [
        {
          "if": {
            "properties": {
              "state": {
                "enum": [
                  "malformed",
                  "invalid",
                  "wellFormed"
                ]
              }
            }
          },
          "then": {
            "required": [
              "codes"
            ],
            "properties": {
              "codes": {
                "minItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "state": {
                "const": "trusted"
              }
            }
          },
          "then": {
            "required": [
              "trust_list"
            ]
          }
        }
      ]
    },
    "archival": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "institution": {
          "type": "string",
          "minLength": 1
        },
        "collection_name": {
          "type": "string",
          "minLength": 1
        },
        "inventory_number": {
          "type": "string",
          "minLength": 1
        },
        "curator_notes": {
          "type": "string",
          "minLength": 1
        },
        "alt_text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 250
        },
        "extended_description": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "extensions": {
      "type": "object",
      "propertyNames": {
        "pattern": "^https://"
      },
      "additionalProperties": {
        "$ref": "#/$defs/ext_object"
      }
    },
    "soul_whisper": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "description": "The message in the bottle: free, unstructured, poetic or personal words about the work."
        },
        "language": {
          "type": "string",
          "minLength": 1
        },
        "voice": {
          "enum": [
            "artist",
            "artist_persona"
          ],
          "description": "Whose voice the whisper carries: a human artist or an artist persona. This is always stated."
        },
        "by": {
          "$ref": "#/$defs/agent"
        },
        "private": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "scheme": {
              "enum": [
                "hmac-sha-256",
                "salted-sha-256"
              ]
            },
            "commitment": {
              "type": "string",
              "minLength": 1,
              "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
              "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
            }
          },
          "required": [
            "scheme",
            "commitment"
          ],
          "description": "A private whisper is held elsewhere; only a keyed commitment to it is written here. No message, sender or recipient."
        }
      },
      "required": [
        "voice",
        "by"
      ],
      "description": "The free, unstructured, poetic or personal addition to an otherwise structured record. A human artist or artist persona may write it, and the record says which. It holds either public text or a private commitment, never both.",
      "oneOf": [
        {
          "required": [
            "text"
          ]
        },
        {
          "required": [
            "private"
          ]
        }
      ]
    }
  },
  "required": [
    "schemaVersion",
    "_identifiers",
    "title",
    "binding",
    "creation_credits"
  ],
  "$defs": {
    "source": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "party": {
          "type": "string",
          "minLength": 1,
          "description": "Who stated it: an institution, a rights holder, a catalogue, a tool."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "minLength": 8
        },
        "citation": {
          "type": "string",
          "minLength": 1
        },
        "retrieved_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
        },
        "method": {
          "enum": [
            "api_field",
            "institution_policy",
            "published_catalogue",
            "holder_statement",
            "manual_review",
            "file_metadata",
            "measured_by_tool"
          ]
        },
        "evidence": {
          "type": "string",
          "minLength": 1,
          "description": "A fingerprint: sha256- followed by the 32 bytes in base64url (43 characters).",
          "pattern": "^sha256-[A-Za-z0-9_-]{43}$"
        }
      },
      "required": [
        "party",
        "method"
      ],
      "description": "A recoverable source for a reported fact. The record reports the fact; it does not assert it.",
      "anyOf": [
        {
          "required": [
            "url"
          ]
        },
        {
          "required": [
            "citation"
          ]
        },
        {
          "required": [
            "evidence"
          ]
        }
      ]
    },
    "agent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "A name. A living person is named only at their own request; otherwise a living person is a ref."
        },
        "ref": {
          "type": "string",
          "minLength": 1,
          "description": "Opaque reference that resolves off the permanent record and can be erased.",
          "pattern": "^[A-Za-z0-9._:-]{6,128}$"
        },
        "type": {
          "enum": [
            "person",
            "group",
            "organization",
            "software",
            "ai_model",
            "ai_persona",
            "public",
            "unknown"
          ]
        },
        "historical": {
          "const": true,
          "description": "Set for a person named from the historical public record."
        },
        "own_request": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "at": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"
            },
            "told_permanent": {
              "const": true,
              "description": "The person was told, before inscription, that an inscribed name cannot be removed, and confirmed."
            }
          },
          "required": [
            "at",
            "told_permanent"
          ],
          "description": "Set when a living person asked to be named. Only the person themself may ask; nobody names another living person."
        },
        "ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Authority identifiers: ulan:..., viaf:..., wikidata:..., a DID."
        },
        "version": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "type"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "person"
              }
            },
            "required": [
              "name"
            ]
          },
          "then": {
            "anyOf": [
              {
                "required": [
                  "historical"
                ]
              },
              {
                "required": [
                  "own_request"
                ]
              }
            ]
          }
        }
      ]
    },
    "authorship": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "by": {
          "$ref": "#/$defs/agent"
        },
        "mode": {
          "enum": [
            "creator_statement",
            "documented_scholarship",
            "curatorial_interpretation",
            "machine_reading",
            "imaginative_oracle"
          ]
        },
        "basis": {
          "type": "string",
          "minLength": 1,
          "description": "What it rests on."
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/source"
          }
        },
        "certainty": {
          "enum": [
            "documented",
            "probable",
            "possible",
            "speculative"
          ]
        },
        "human_reviewed": {
          "type": "boolean"
        }
      },
      "required": [
        "by",
        "mode",
        "certainty"
      ],
      "description": "Who wrote an interpretive section, what kind of statement it is, what it rests on, and how certain it is.",
      "allOf": [
        {
          "if": {
            "anyOf": [
              {
                "properties": {
                  "mode": {
                    "enum": [
                      "creator_statement",
                      "documented_scholarship"
                    ]
                  }
                }
              },
              {
                "properties": {
                  "certainty": {
                    "const": "documented"
                  }
                }
              }
            ]
          },
          "then": {
            "required": [
              "sources"
            ],
            "properties": {
              "sources": {
                "minItems": 1
              }
            }
          }
        }
      ]
    },
    "rights_statement": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "about": {
          "enum": [
            "original_work",
            "reproduction",
            "image_file"
          ]
        },
        "status": {
          "type": "string",
          "format": "uri",
          "minLength": 8
        },
        "notice": {
          "type": "string",
          "minLength": 1
        },
        "holder": {
          "type": "string",
          "minLength": 1,
          "description": "As reported."
        },
        "credit_line": {
          "type": "string",
          "minLength": 1,
          "description": "The credit the image's supplier requires."
        },
        "web_statement": {
          "type": "string",
          "format": "uri",
          "minLength": 8
        },
        "jurisdiction": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "$ref": "#/$defs/source"
        }
      },
      "required": [
        "about",
        "status",
        "source"
      ],
      "description": "One statement of rights in the work or image: declared by the author in their own name, or carried as a named source reports it. Whoever stands behind it is always named."
    },
    "event": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "enum": [
            "creation",
            "ai_generation",
            "digitisation",
            "acquisition",
            "modification",
            "enrichment",
            "validation",
            "registration",
            "inscription",
            "recovery",
            "correction",
            "supersession"
          ]
        },
        "at": {
          "type": "string",
          "minLength": 1,
          "description": "ISO 8601, any precision, or 'unknown'."
        },
        "by": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent"
          }
        },
        "inputs": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "changed": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "evidence": {
          "$ref": "#/$defs/source"
        },
        "evidence_gap": {
          "type": "string",
          "minLength": 1,
          "description": "States plainly that no evidence is held, and why."
        }
      },
      "required": [
        "type",
        "at"
      ],
      "allOf": [
        {
          "oneOf": [
            {
              "required": [
                "evidence"
              ]
            },
            {
              "required": [
                "evidence_gap"
              ]
            }
          ]
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "supersession"
              }
            }
          },
          "then": {
            "required": [
              "by",
              "inputs",
              "changed"
            ],
            "properties": {
              "by": {
                "minItems": 1
              },
              "inputs": {
                "minItems": 1
              },
              "changed": {
                "minItems": 1
              }
            }
          }
        }
      ]
    },
    "ext_object": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ext_value"
      }
    },
    "ext_value": {
      "anyOf": [
        {
          "type": [
            "string",
            "integer",
            "boolean",
            "null"
          ]
        },
        {
          "$ref": "#/$defs/ext_object"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ext_value"
          }
        }
      ]
    }
  }
}
