{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tightbeatzarchive.org/catalog/schema.json",
  "title": "The TightBeatz Archive public catalog schema",
  "type": "object",
  "required": [
    "archive",
    "release",
    "generated",
    "schemaVersion",
    "count",
    "records"
  ],
  "additionalProperties": false,
  "properties": {
    "archive": {
      "const": "The TightBeatz Archive"
    },
    "release": {
      "type": "string",
      "minLength": 1
    },
    "generated": {
      "type": "string",
      "format": "date"
    },
    "schemaVersion": {
      "const": "2.1.0"
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "section",
          "type",
          "title",
          "creator",
          "date",
          "description",
          "evidence",
          "status",
          "source",
          "rights",
          "archivePath",
          "image",
          "imageAlt",
          "related",
          "sourceLabel",
          "recoveryIndex",
          "objectType",
          "evidenceClass",
          "survivalState",
          "recoveryMethod",
          "sourceOwnership",
          "confidenceClass",
          "createdAt",
          "updatedAt",
          "revision",
          "changeSummary",
          "relationships",
          "technicalNotes",
          "curatorialNotes",
          "tags",
          "era",
          "year",
          "datePrecision",
          "playable",
          "imageAvailable",
          "completeness",
          "url"
        ],
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "section": {
            "type": "string",
            "enum": [
              "people",
              "music",
              "forum",
              "oral-history",
              "evidence"
            ]
          },
          "type": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "creator": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "evidence": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "minLength": 1
          },
          "source": {
            "type": "string"
          },
          "rights": {
            "type": "string",
            "minLength": 1
          },
          "archivePath": {
            "type": "string",
            "minLength": 1
          },
          "image": {
            "type": "string"
          },
          "imageAlt": {
            "type": "string"
          },
          "related": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sourceLabel": {
            "type": "string"
          },
          "recoveryIndex": {
            "type": "string"
          },
          "objectType": {
            "type": "string",
            "enum": [
              "person",
              "music_track",
              "album",
              "mixtape",
              "forum_thread",
              "forum_profile",
              "forum_index",
              "oral_history",
              "visual_artifact",
              "evidence_record",
              "source_record",
              "community_record",
              "unknown"
            ]
          },
          "evidenceClass": {
            "type": "string",
            "enum": [
              "primary_source",
              "archival_capture",
              "direct_media",
              "public_metadata",
              "external_trace",
              "community_memory",
              "participant_memory",
              "curatorial_summary",
              "inference",
              "uncorroborated_lead"
            ]
          },
          "survivalState": {
            "type": "string",
            "enum": [
              "survived",
              "partial",
              "metadata_only",
              "missing",
              "external_only",
              "unknown"
            ]
          },
          "recoveryMethod": {
            "type": "string",
            "enum": [
              "wayback",
              "common_crawl",
              "source_platform",
              "participant_submission",
              "manual_reconstruction",
              "local_preservation",
              "archive_manifest",
              "unknown"
            ]
          },
          "sourceOwnership": {
            "type": "string",
            "enum": [
              "first_party_tightbeatz",
              "member_controlled",
              "third_party_platform",
              "archive_service",
              "community_submission",
              "archive_curated",
              "unknown"
            ]
          },
          "confidenceClass": {
            "type": "string",
            "enum": [
              "confirmed",
              "high",
              "medium",
              "low",
              "inference"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "revision": {
            "type": "string",
            "minLength": 1
          },
          "changeSummary": {
            "type": "string",
            "minLength": 1
          },
          "relationships": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "predicate",
                "targetId",
                "note"
              ],
              "additionalProperties": false,
              "properties": {
                "predicate": {
                  "type": "string",
                  "enum": [
                    "performed_by",
                    "created_by",
                    "documents",
                    "source_for",
                    "part_of",
                    "same_account_as",
                    "mentions",
                    "related_to",
                    "sampled_by",
                    "captures"
                  ]
                },
                "targetId": {
                  "type": "string",
                  "minLength": 1
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "technicalNotes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "curatorialNotes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "era": {
            "type": "string",
            "enum": [
              "original_forum_era",
              "tb2_transition",
              "jamroom_era",
              "later_web_era",
              "recovery_era",
              "unknown"
            ]
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1900,
            "maximum": 2035
          },
          "datePrecision": {
            "type": "string",
            "enum": [
              "exact",
              "year",
              "range",
              "approximate",
              "context",
              "unknown"
            ]
          },
          "playable": {
            "type": "boolean"
          },
          "imageAvailable": {
            "type": "boolean"
          },
          "completeness": {
            "type": "string",
            "enum": [
              "complete",
              "substantial",
              "partial",
              "stub",
              "metadata_only",
              "unknown"
            ]
          },
          "url": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
