{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://drole.com/data/page-catalog-schema.json",
  "title": "Catalogue des pages canoniques de Drôle.com",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "version",
    "review_date",
    "base_url",
    "scope",
    "page_count",
    "pages"
  ],
  "properties": {
    "$schema": {
      "const": "https://drole.com/data/page-catalog-schema.json"
    },
    "version": {
      "type": "string",
      "pattern": "^DROLE-[0-9]{4}-[0-9]{2}-[0-9]{2}-V[0-9]+$"
    },
    "review_date": {
      "type": "string",
      "format": "date"
    },
    "base_url": {
      "const": "https://drole.com"
    },
    "scope": {
      "type": "string",
      "minLength": 30
    },
    "page_count": {
      "type": "integer",
      "minimum": 1
    },
    "pages": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "path",
          "title",
          "h1",
          "description",
          "section",
          "canonical_role",
          "page_type",
          "summary",
          "primary_intent",
          "direct_answer",
          "direct_answer_type",
          "headings",
          "content_ids",
          "content_count",
          "content_coverage",
          "date_reviewed",
          "citation_text",
          "content_sha256",
          "source_urls",
          "distinguishes_from",
          "intent_boundary"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://drole\\.com/"
          },
          "path": {
            "type": "string",
            "pattern": "^/"
          },
          "title": {
            "type": "string",
            "minLength": 3
          },
          "h1": {
            "type": "string",
            "minLength": 3
          },
          "description": {
            "type": "string",
            "minLength": 80
          },
          "section": {
            "type": "string",
            "minLength": 3
          },
          "canonical_role": {
            "type": "string",
            "enum": [
              "archive",
              "selection",
              "guide",
              "definition",
              "tool",
              "reference",
              "navigation",
              "service"
            ]
          },
          "page_type": {
            "type": "string",
            "enum": [
              "WebPage",
              "CollectionPage",
              "Article",
              "AboutPage",
              "ContactPage"
            ]
          },
          "summary": {
            "type": "string",
            "minLength": 20
          },
          "primary_intent": {
            "type": "string",
            "minLength": 3
          },
          "direct_answer": {
            "type": "string",
            "minLength": 20
          },
          "direct_answer_type": {
            "type": "string",
            "enum": [
              "answer-first",
              "definition",
              "lead"
            ]
          },
          "headings": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3
            },
            "uniqueItems": true
          },
          "content_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{3}-[0-9]{4}$"
            },
            "uniqueItems": true
          },
          "content_count": {
            "type": "integer",
            "minimum": 0
          },
          "content_coverage": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "displayed_count",
              "eligible_count",
              "share_percent",
              "scope"
            ],
            "properties": {
              "displayed_count": {
                "type": "integer",
                "minimum": 0
              },
              "eligible_count": {
                "type": "integer",
                "minimum": 1
              },
              "share_percent": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "scope": {
                "type": "string",
                "enum": [
                  "eligible-selection-pool",
                  "canonical-type-corpus"
                ]
              }
            }
          },
          "date_reviewed": {
            "type": "string",
            "format": "date"
          },
          "citation_text": {
            "type": "string",
            "minLength": 30
          },
          "content_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "uniqueItems": true
          },
          "distinguishes_from": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://drole\\.com/"
            },
            "uniqueItems": true
          },
          "intent_boundary": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 40
          }
        }
      }
    }
  }
}
