{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Bodování řidičů cizinců - Schéma otevřených dat",
  "description": "JSON schéma pro dataset bodování řidičů cizinců podle územních jednotek. Obsahuje počty řidičů s různým počtem bodů, typ území a stav k určitému datu.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "uzemi_txt": {
      "type": "string",
      "minLength": 1,
      "description": "Název územní jednotky (např. kraj, správní obvod obce s rozšířenou působností nebo stát)."
    },
    "b1": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 1 bodem/body."
    },
    "b2": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 2 bodem/body."
    },
    "b3": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 3 bodem/body."
    },
    "b4": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 4 bodem/body."
    },
    "b5": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 5 bodem/body."
    },
    "b6": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 6 bodem/body."
    },
    "b7": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 7 bodem/body."
    },
    "b8": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 8 bodem/body."
    },
    "b9": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 9 bodem/body."
    },
    "b10": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 10 bodem/body."
    },
    "b11": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 11 bodem/body."
    },
    "b12": {
      "type": "integer",
      "minimum": 0,
      "description": "Počet řidičů s 12 bodem/body."
    },
    "pocet_bodovanych_ridicu": {
      "type": "integer",
      "minimum": 0,
      "description": "Celkový počet řidičů, kteří mají alespoň 1 bod."
    },
    "celkovy_pocet_ridicu": {
      "type": "integer",
      "minimum": 0,
      "description": "Celkový počet všech evidovaných řidičů."
    },
    "pohlavi_txt": {
      "type": "string",
      "const": "celkem",
      "description": "Agregace za všechna pohlaví. V této datové sadě je povolena pouze hodnota 'celkem'."
    },
    "uzemi_typ": {
      "type": "string",
      "enum": [
        "kraj",
        "správní obvod obce s rozšířenou působností",
        "stát"
      ],
      "description": "Typ územní jednotky."
    },
    "stav_k_datu": {
      "type": "string",
      "pattern": "^\\d{4}_\\d{2}$",
      "description": "Datum platnosti údajů ve formátu RRRR_MM (např. 2026_03)."
    }
  },
  "required": [
    "uzemi_txt",
    "b1",
    "b2",
    "b3",
    "b4",
    "b5",
    "b6",
    "b7",
    "b8",
    "b9",
    "b10",
    "b11",
    "b12",
    "pocet_bodovanych_ridicu",
    "celkovy_pocet_ridicu",
    "pohlavi_txt",
    "uzemi_typ",
    "stav_k_datu"
  ],
  "$comment": "Standardní JSON Schema 2020-12 neumí bez nestandardních rozšíření spolehlivě vynutit, aby b1+b2+...+b12 bylo rovno pocet_bodovanych_ridicu. Tato kontrola má být provedena mimo samotné schéma v datové validaci."
}