Pre-release. Until the official launch, content may change, including published files.
Skip to content

Source: https://datamodels.jp/en/guide/publish · Text CC BY 4.0

Publishing your list ​

This page is for staff of a city or other municipality who publish a CSV list on their open data portal. You convert the list into a JSON file and publish it next to the CSV. The JSON is in the key-values form (plain JSON with attribute names and their values), and it is checked against the model's JSON Schema.

When lists use the same model, app developers can read the list of every city with the same code.

Utsunomiya's CSV (one row)名称中央小学校緯度36.55925966経度139.8847723災害種別_洪水1……convert, with the mapping fileOne entity (key-values form)JSON in the model EvacuationSite, shortened{"type": "EvacuationSite","name": "中央小学校","location": { "type": "Point","coordinates": [139.8847723, 36.55925966] },"hazardTypes": ["flood", "landslide", "earthquake"]…}

  • model: for one kind of thing, such as evacuation sites or AEDs, the names and meanings of its attributes.
  • entity: one record of data. One row of the CSV becomes one entity.
  • mapping file: a file that says which column of the CSV becomes which attribute of the model.

The other words are explained in Terms.

Pre-release

The catalog is not officially launched yet, and until then published files may still be corrected (URLs and versions). Try the steps now, but publish the JSON on your portal only after the official launch.

1. Check that your list follows the standard ​

Many municipalities publish their lists in the format of the Digital Agency's municipal standard open datasets (自治体標準オープンデータセット). A list in this format can be converted with the catalog's mapping file as it is. The catalog has a mapping file for these sheets of the data item definition document A (データ項目定義書A):

How to check: look at the first row of the CSV (the column headers). A list that follows the definitions has common columns such as 全国地方公共団体コード (local government code), ID and 名称 (name). After them come the columns of its sheet: 災害種別_洪水 (flood) and similar for evacuation sites, 設置位置 (where the AED is) for AEDs. Standards covered links to the definitions and the mapping file of each sheet.

If your list does not follow the standard, write a mapping file of your own and convert with it (Any other CSV).

2. Convert ​

You need Node.js 24 or later. The example here is Utsunomiya City's list of designated emergency evacuation sites. Step 1 of the tutorial downloads it as sites.csv.

bash
npx github:geolonia/datamodels-toolkit#v0.3.8 convert \
  disaster/EvacuationSite jichitai-opendata-site sites.csv --out sites.json

The \ at the end of a line means the command goes on in the next line. In the Windows Command Prompt or PowerShell, write it on one line. The arguments are the model, the mapping file and the CSV file. For your own list, take the model and the mapping file of your sheet from the list above. --out is the JSON file to write. The JSON is written in UTF-8, even when the CSV is in Shift_JIS. Step 2 of the tutorial shows the first entity in it.

This is the output of a run on 2026-10-12, in full (on standard error):

text
sites.csv: shift_jis, 198 row(s), 198 valid EvacuationSite, 0 invalid
  repaired 396×: localGovernmentCode: restored the leading zero (e.g. 92011 → 092011)
  repaired 198×: addressLocality: left out 所在地_市区町村: not a municipality name (e.g. 宇都宮市中央本町1-29)
  • The first line sums up: the converter recognised the character encoding (Shift_JIS), and all 198 rows are valid.
  • The repaired lines are what the converter fixed. It put back the leading zero of the local government codes, which a spreadsheet had dropped. There are two code columns (全国地方公共団体コード and 所在地_全国地方公共団体コード), so 198 rows make 396 repairs.
  • The column 所在地_市区町村 (city) also held the town and the street number, so the converter did not put it into the attribute addressLocality. The address is still there: address.addressText comes from the column 所在地_連結表記 (full address). Use this as a hint for fixing the CSV.

If some rows are invalid, they are left out of the JSON and listed with their row number and the reason (exit code 1). Fix the CSV and convert again. To check only the first rows (20 by default), use --check (Converting your data).

3. Publish ​

  • Where: add sites.json to the same dataset as the CSV, as one more resource, with the format JSON. Keep the CSV: people and apps use it. Any file name works; the CSV's name with .json instead of .csv shows which CSV it comes from.
  • Licence: the same licence as your CSV. The JSON is the same data in another form.
  • Description: in the description of the resource or the dataset, name the model you used: its page, and the URLs of its JSON Schema and @context. With the JSON Schema, anyone can validate each entity in the JSON: the file is a list of entities, and the schema describes one. The @context is a file that links each attribute name to a name that is unique on the web; people who use the data as linked data read it. Use the version alias (v1) in these URLs. It moves only to compatible versions, so your JSON stays valid (URLs and versions).
  • Updates: when the CSV changes, convert it again with the same command and replace the JSON, so that both always hold the same data.

An example description:

text
The CSV above, converted into the datamodels.jp model EvacuationSite (key-values form).
Model: https://datamodels.jp/en/models/disaster/EvacuationSite/
JSON Schema: https://datamodels.jp/schema/disaster/EvacuationSite/v1.json
@context: https://datamodels.jp/context/disaster/v1.jsonld

Next (optional) ​