{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.govfresh.com/v1/_core/jurisdiction.schema.json",
  "title": "Jurisdiction",
  "description": "A governed territory: a country, region, municipality, or special-purpose area.",
  "standards": [
    "wikidata"
  ],
  "type": "object",
  "properties": {
    "@context": {},
    "@id": {
      "type": "string",
      "format": "iri",
      "description": "This jurisdiction's own dereferenceable identifier."
    },
    "@type": {
      "description": "A `Jurisdiction` is a `Place`. It has no employees, departments, or legislation - those belong to the `Organization` that governs it, which points here with `areaServed`. Keeping these two apart is the central rule of this profile. Use the most specific schema.org type below that applies.",
      "enum": [
        "AdministrativeArea",
        "Country",
        "State",
        "City"
      ]
    },
    "name": {
      "type": "string",
      "description": "The jurisdiction's official name."
    },
    "alternateName": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Endonyms, historical names, and the local-language term for the tier (e.g. 'Comune di Bologna')."
    },
    "description": {
      "type": "string",
      "description": "A plain-language description of the jurisdiction."
    },
    "url": {
      "type": "string",
      "format": "iri",
      "description": "Where more information about this jurisdiction can be found."
    },
    "identifier": {
      "type": "array",
      "items": {
        "$ref": "identifier.schema.json"
      },
      "minItems": 1,
      "description": "At least one. A Wikidata QID is strongly recommended as the cross-border join key."
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "iri"
      },
      "description": "Links to authoritative external records for this jurisdiction, e.g. its Wikidata entry."
    },
    "governmentLevel": {
      "type": "string",
      "description": "termCode from the `GovernmentLevel` code list.",
      "enum": [
        "supranational",
        "national",
        "regional",
        "subregional",
        "municipal",
        "submunicipal",
        "specialPurpose",
        "indigenous"
      ]
    },
    "containedInPlace": {
      "$ref": "reference.schema.json",
      "description": "The next jurisdiction up. Chaining these yields the full territorial hierarchy without any country-specific nesting rules."
    },
    "containsPlace": {
      "type": "array",
      "items": {
        "$ref": "reference.schema.json"
      },
      "description": "Jurisdictions directly contained within this one."
    },
    "geo": {
      "type": "object",
      "description": "schema.org `GeoCoordinates` or `GeoShape`."
    },
    "population": {
      "type": "object",
      "description": "A QuantitativeValue, so the count keeps its observation date and source.",
      "properties": {
        "@type": {
          "const": "QuantitativeValue"
        },
        "value": {
          "type": "number"
        },
        "observationDate": {
          "type": "string",
          "format": "date"
        },
        "sourceDataset": {
          "type": "string",
          "format": "iri"
        }
      },
      "required": [
        "@type",
        "value"
      ]
    },
    "timeZone": {
      "type": "string",
      "description": "IANA time zone, e.g. 'Europe/Lisbon'."
    },
    "jurisdictionOf": {
      "type": "array",
      "items": {
        "$ref": "reference.schema.json"
      },
      "description": "`GovernmentOrganization`s governing this area. Convenience inverse of `Organization.areaServed`."
    },
    "boundary": {
      "type": "array",
      "items": {
        "$ref": "reference.schema.json"
      },
      "description": "References to `Boundary` entities for this area, including superseded ones. Separate entities rather than inline geometry so that a historical extent can be cited: an electoral district boundary is exactly what gets cited in a dispute, and a citation needs something to point at."
    }
  },
  "required": [
    "@id",
    "@type",
    "name",
    "identifier",
    "governmentLevel"
  ],
  "additionalProperties": true
}
