{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://drole.com/data/dataset-schema.json",
  "title": "Corpus Drôle.com",
  "description": "JSON Schema du corpus public de blagues, devinettes, charades, jeux de mots et contrepèteries de Drôle.com.",
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "id",
      "type",
      "title",
      "setup",
      "answer",
      "text",
      "explanation",
      "tags",
      "audience",
      "difficulty",
      "format",
      "language",
      "family_friendly",
      "origin",
      "provenance_note",
      "origin_confidence",
      "authorship_claim",
      "editorial_contribution",
      "source_url",
      "rights_url",
      "date_published",
      "date_modified",
      "editorial_status",
      "date_reviewed",
      "first_published_in",
      "content_version",
      "reviewed_by",
      "review_scope",
      "review_criteria",
      "canonical_url",
      "permalink_url",
      "mechanism",
      "content_sha256",
      "citation_text"
    ],
    "properties": {
      "id": {
        "type": "string",
        "pattern": "^[A-Z]{3}-[0-9]{4}$",
        "description": "Identifiant stable et unique."
      },
      "type": {
        "type": "string",
        "enum": [
          "blague",
          "devinette",
          "charade",
          "jeu-de-mots",
          "contrepeterie"
        ]
      },
      "title": {
        "type": "string",
        "minLength": 3,
        "description": "Titre éditorial distinct."
      },
      "setup": {
        "type": "string",
        "minLength": 3,
        "description": "Question, phrase ou situation de départ."
      },
      "answer": {
        "type": "string",
        "description": "Réponse ou chute ; chaîne vide pour un jeu de mots autonome."
      },
      "text": {
        "type": "string",
        "minLength": 3,
        "description": "Formulation complète faisant autorité pour cette version."
      },
      "explanation": {
        "type": "string",
        "minLength": 45,
        "description": "Explication éditoriale obligatoire de la réponse, de la chute ou du mécanisme propre à la fiche."
      },
      "tags": {
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 2
        },
        "uniqueItems": true,
        "minItems": 1
      },
      "audience": {
        "type": "string",
        "minLength": 3,
        "description": "Public éditorial conseillé, sans valeur de garantie universelle."
      },
      "difficulty": {
        "type": "string",
        "enum": [
          "facile",
          "moyen",
          "difficile"
        ]
      },
      "format": {
        "type": "string",
        "minLength": 3
      },
      "language": {
        "const": "fr-FR"
      },
      "family_friendly": {
        "type": "boolean"
      },
      "origin": {
        "type": "string",
        "enum": [
          "origine-non-etablie-formulation-drole",
          "tradition-orale-formulation-drole",
          "tradition-documentee"
        ]
      },
      "provenance_note": {
        "type": "string",
        "minLength": 20,
        "description": "Interprétation explicite de la provenance déclarée, sans attribution inventée."
      },
      "origin_confidence": {
        "type": "string",
        "enum": [
          "non-etablie",
          "tradition-orale",
          "documentee"
        ],
        "description": "Niveau de connaissance de la provenance, distinct de la contribution éditoriale."
      },
      "authorship_claim": {
        "type": "string",
        "minLength": 50,
        "description": "Limite explicite de toute attribution d’auteur ou de paternité historique."
      },
      "editorial_contribution": {
        "type": "string",
        "minLength": 40,
        "description": "Travail effectivement revendiqué par l’éditeur sur cette version."
      },
      "source_url": {
        "type": "string",
        "format": "uri-reference",
        "description": "Source documentaire directe lorsqu’elle existe ; sinon chaîne vide."
      },
      "rights_url": {
        "type": "string",
        "format": "uri"
      },
      "date_published": {
        "type": "string",
        "format": "date"
      },
      "date_modified": {
        "type": "string",
        "format": "date"
      },
      "date_reviewed": {
        "type": "string",
        "format": "date"
      },
      "first_published_in": {
        "type": "string",
        "pattern": "^DROLE-[0-9]{4}-[0-9]{2}-[0-9]{2}(?:-V[0-9]+)?$"
      },
      "content_version": {
        "type": "integer",
        "minimum": 1
      },
      "editorial_status": {
        "const": "controle-editorial"
      },
      "reviewed_by": {
        "const": "Rédaction Drôle.com"
      },
      "review_scope": {
        "type": "string",
        "minLength": 50
      },
      "review_criteria": {
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 3
        },
        "uniqueItems": true,
        "minItems": 4
      },
      "canonical_url": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://drole\\.com/[^#]*$"
      },
      "permalink_url": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://drole\\.com/.+#[A-Z]{3}-[0-9]{4}$"
      },
      "mechanism": {
        "type": "string",
        "minLength": 5,
        "description": "Ressort dominant décrit avec un vocabulaire éditorial contrôlé."
      },
      "content_sha256": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$",
        "description": "Empreinte SHA-256 de la formulation complète UTF-8."
      },
      "citation_text": {
        "type": "string",
        "minLength": 20,
        "description": "Citation conseillée avec titre, identifiant, éditeur et lien permanent."
      }
    }
  }
}
