{
  "name": "DesignatedShelter",
  "description": "One designated shelter (指定避難所, Basic Act on Disaster Management Art. 49-7), the master record of a place where evacuees stay: as municipalities register it and GSI publishes it. Its operation during a disaster (opening status, evacuee counts) is EvacuationShelter, which links here with shelter. At least one of externalShelterId, nationalShelterId is not null. More rules: https://datamodels.jp/schema/disaster/DesignatedShelter/v1.0.0.json. Type https://datamodels.jp/ns/disaster/DesignatedShelter; @context https://datamodels.jp/context/disaster/v1.jsonld.",
  "strict": true,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "Name of the shelter (the facility's name)"
      },
      "nameKana": {
        "type": [
          "string",
          "null"
        ],
        "description": "Name in full-width katakana (施設名（かな）)"
      },
      "externalShelterId": {
        "type": [
          "string",
          "null"
        ],
        "description": "The shelter's ID in the municipality's own shelter list (unique within the municipality). Required unless nationalShelterId is given"
      },
      "nationalShelterId": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^E[0-9]{10}1[12][1-9A-Za-z]$",
        "description": "The nationwide common shelter/evacuation-site ID (14 characters, the '共通ID' of GSI's data). Only type codes 11 (general designated shelter) and 12 (welfare shelter) are valid on this model. Its structure and source are described once, in EvacuationShelter's mapping 'nationwide common shelter/evacuation-site ID' (gsi-national-shelter-id). Required when externalShelterId is not given"
      },
      "localGovernmentCode": {
        "type": "string",
        "pattern": "^\\d{6}$",
        "description": "Local government code of the municipality that designates the shelter (全国地方公共団体コード, 6 digits)"
      },
      "shelterType": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "general",
          "welfare",
          null
        ],
        "description": "general (一般避難所) or welfare (福祉避難所, for people who need special care); the second type digit of nationalShelterId says the same"
      },
      "address": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "addressCountry": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "JP",
              null
            ],
            "description": "Country. Always JP"
          },
          "postalCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{3}-?\\d{4}$",
            "description": "Postal code, 7 digits with or without hyphen"
          },
          "addressRegion": {
            "type": [
              "string",
              "null"
            ],
            "description": "Prefecture name"
          },
          "addressLocality": {
            "type": [
              "string",
              "null"
            ],
            "description": "Municipality name. For designated cities includes the ward (e.g. 横浜市中区)"
          },
          "machiaza": {
            "type": [
              "string",
              "null"
            ],
            "description": "Town or district name (町字: 町名, 大字, 字), without chome"
          },
          "chome": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d+$",
            "description": "Chome (丁目), digits only (\"一丁目\" → \"1\")"
          },
          "banchi": {
            "type": [
              "string",
              "null"
            ],
            "description": "Banchi (番地): in a residential-indication area the block number (街区符号); elsewhere the whole lot number (地番), branch number included, for example 4638-1"
          },
          "go": {
            "type": [
              "string",
              "null"
            ],
            "description": "Go (号): in a residential-indication area the residence number (住居番号). Empty for a lot number (地番): its branch number stays in banchi"
          },
          "buildingName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Building name, room number and anything below go"
          },
          "residentialIndication": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "true in a residential-indication area (banchi/go are block and residence numbers), false for lot numbers (地番)"
          },
          "jisPrefectureCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{2}$",
            "description": "Prefecture code (JIS X 0401, 2 digits)"
          },
          "jisMunicipalityCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{5}$",
            "description": "Municipality code (JIS X 0402, 5 digits including the prefecture code)"
          },
          "localGovernmentCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{6}$",
            "description": "Local government code (全国地方公共団体コード: JIS X 0402 plus a check digit, 6 digits)"
          },
          "abrMachiazaId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{7}$",
            "description": "Address Base Registry town id (町字ID, 7 digits). Unique together with localGovernmentCode"
          },
          "addressText": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full address as one normalised line. Also the fallback when structured fields are unavailable"
          }
        },
        "required": [
          "addressCountry",
          "postalCode",
          "addressRegion",
          "addressLocality",
          "machiaza",
          "chome",
          "banchi",
          "go",
          "buildingName",
          "residentialIndication",
          "jisPrefectureCode",
          "jisMunicipalityCode",
          "localGovernmentCode",
          "abrMachiazaId",
          "addressText"
        ],
        "additionalProperties": false,
        "description": "Address of the shelter, as a JapaneseAddress value (common subject)"
      },
      "location": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Point"
            ]
          },
          "coordinates": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "[longitude, latitude] in WGS 84, optionally with the altitude as a third number"
          }
        },
        "required": [
          "type",
          "coordinates"
        ],
        "additionalProperties": false,
        "description": "Where the shelter is, as a point A GeoJSON geometry (Point)."
      },
      "maxCapacity": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Number of people the shelter is planned to hold (minimum 0)"
      },
      "targetEvacuees": {
        "type": [
          "string",
          "null"
        ],
        "description": "Who the shelter is for, in the municipality's words (受入対象者), e.g. for a welfare shelter"
      },
      "alsoEmergencyEvacuationSite": {
        "type": [
          "boolean",
          "null"
        ],
        "description": "true when a designated emergency evacuation site has the same address (指定緊急避難場所との住所同一)"
      },
      "site": {
        "type": [
          "string",
          "null"
        ],
        "description": "The designated emergency evacuation site (EvacuationSite) at the same place (a URI)"
      },
      "designationNotes": {
        "type": [
          "string",
          "null"
        ],
        "description": "Other matters the mayor considers necessary (その他市町村長が必要と認める事項)"
      },
      "description": {
        "type": [
          "string",
          "null"
        ],
        "description": "Remarks (備考)"
      }
    },
    "required": [
      "name",
      "nameKana",
      "externalShelterId",
      "nationalShelterId",
      "localGovernmentCode",
      "shelterType",
      "address",
      "location",
      "maxCapacity",
      "targetEvacuees",
      "alsoEmergencyEvacuationSite",
      "site",
      "designationNotes",
      "description"
    ],
    "additionalProperties": false
  }
}
