{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://letestcivique.com/data/civic-lexicon/schema.json",
  "title": "Civic lexicon source and distribution",
  "type": "object",
  "required": [
    "dataset_id",
    "version",
    "language_codes",
    "published_at",
    "updated_at",
    "license",
    "creator",
    "coverage",
    "themes",
    "items"
  ],
  "properties": {
    "dataset_id": {
      "const": "civic-quiz-france-trilingual-civic-lexicon"
    },
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "language_codes": {
      "const": [
        "fr",
        "en",
        "zh-Hans"
      ]
    },
    "published_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "updated_at": {
      "type": "string",
      "format": "date"
    },
    "license": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "creator": {
      "type": "string",
      "minLength": 1
    },
    "coverage": {
      "type": "string",
      "minLength": 1
    },
    "themes": {
      "type": "object"
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "theme",
          "term_fr",
          "definition_fr",
          "term_en",
          "definition_en",
          "term_zh_hans",
          "definition_zh_hans",
          "exam_paths",
          "source_title",
          "source_url",
          "source_checked_at",
          "content_status",
          "updated_at",
          "notes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^civic-[0-9]{3}$"
          },
          "theme": {
            "enum": [
              "values",
              "institutions",
              "rights",
              "history",
              "society"
            ]
          },
          "term_fr": {
            "type": "string",
            "minLength": 1
          },
          "definition_fr": {
            "type": "string",
            "minLength": 1
          },
          "term_en": {
            "type": "string",
            "minLength": 1
          },
          "definition_en": {
            "type": "string",
            "minLength": 1
          },
          "term_zh_hans": {
            "type": "string",
            "minLength": 1
          },
          "definition_zh_hans": {
            "type": "string",
            "minLength": 1
          },
          "exam_paths": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "enum": [
                "CSP",
                "CR",
                "NAT"
              ]
            }
          },
          "source_title": {
            "type": "string",
            "minLength": 1
          },
          "source_url": {
            "type": "string",
            "minLength": 1,
            "format": "uri",
            "pattern": "^https://"
          },
          "source_checked_at": {
            "type": "string",
            "minLength": 1,
            "format": "date"
          },
          "content_status": {
            "enum": [
              "verified",
              "needs_review",
              "archived"
            ]
          },
          "updated_at": {
            "type": "string",
            "minLength": 1,
            "format": "date"
          },
          "notes": {
            "type": "string"
          }
        }
      }
    }
  }
}
