English
Rules for models
This page is for people who add or change models in the catalog. How to propose is in Contributing; who decides is in CONTRIBUTING.md. What "draft" and the other labels on a model page mean: Stages.
What the catalog accepts
The catalog only publishes models that meet all three of these:
- Built on an existing standard: government or municipal guidelines, Smart Data Models, GIF, an RFC or similar. Record the upstream types you considered, and why they did not fit, in
notes.yaml. - Real data: the model describes data that exists today, not a hypothetical use case.
- Product-neutral: no product-specific annotations or type names. Files for particular products come from the adapters.
A model that only one project or organisation uses can go on your own site (Your own data models).
Reuse first, define only what is missing
The rule of this catalog is "extend, do not duplicate". Where a type or attribute from Smart Data Models, NGSI-LD or schema.org fits, the catalog uses it as it is. Where nothing fits, the catalog defines its own type under https://datamodels.jp/ns/<subject>/, and still uses upstream attributes where they fit. Example: RoadRestriction is the catalog's own type, but roadName, validFrom and validTo come from Smart Data Models.
When not to use an upstream type
Using upstream where it fits does not mean bending everything to fit. Some upstream models were published for one project only, some assume how things work in North America, and some were fixed before much feedback. Define your own type when:
- the meaning or the required attributes of the upstream type do not match how things work in Japan;
- the upstream type depends on a specific product or region;
- adding attributes is not enough and the meaning would have to change (changing meaning is not allowed, so a new type is the honest option).
Write the upstream types you looked at, and why they did not fit, in the model's notes.yaml, so nobody repeats the same work. A dated record of a change goes under history, not notes; the model page folds it away below the notes.
So far, every model in the catalog is the catalog's own type; upstream names are used for some attributes. Each model's notes and issue #16 record why.
Rules
Never change the meaning or type of an upstream attribute. Add a new one instead.
Status attributes (
progress,openingStatus,restrictionStatusand others) have fixed value lists. When no value fits, leave the status out and give the local wording instatusLabel(then required). Do not force the nearest value.Never redefine a reserved name of the NGSI-LD core context (
status,description,location,createdAt,modifiedAt,observedAtand others). CI rejects it. When you need a status, name it likeincidentStatus.Group models by subject (topic), never by region, customer or project.
Use the common value types for shared structures: JapaneseAddress for addresses, Geometry for
locationand other locations, ContactPoint for contacts, OpeningHours for opening hours. When a model allows fewer geometry types, narrow it next to the$ref(DesignatedShelter allows only a Point). A$refis an absolute URL that starts withhttps://datamodels.jp/schema/, or a reference inside the same file that starts with#; a relative path or another site fails CI.To give an existing type another name, use an alias (
x-alias-of: same attributes, same required fields). To add attributes or to keep a type separate, use a subclass (x-subclass-of: attributes with the same name keep the parent's meaning, the parent's required attributes stay required). CI checks both. The parent may also be a schema.org, Smart Data Models or NGSI-LD core type (common's ContactPoint is a subclass of schema.org ContactPoint); then CI checks only that the IRI is in one of these namespaces and that its name starts with a capital letter, as class names do. CI does not check that the class exists, so open the IRI to make sure.Keep the files small and simple: the published files are input to other people's validators and JSON-LD processors. CI rejects:
- a file over 256 KB
- JSON or YAML nested deeper than 32 levels
- a schema with more than 100
$refs - a
patternlonger than 256 characters, or one that repeats a group whose length varies, such as(a+)+(on a string that does not match, its time grows exponentially). A group that ends or starts with a separator is fine when it has one part of varying length, no alternatives (|) and no inner groups, and nothing else in it matches the separator (upper and lower case count as the same letter), such as(\d+\.)+,([a-z]+-)*or the subtags of a language tag,(-[A-Za-z0-9]{2,8})*(but not((?:[a-z]+)-)+). The check is a heuristic: some slow forms, such as(a|aa)+,(a?)+and several repeated groups in a row ((a*-)*(a*-)*), pass it, and review checks them - a context whose imports nest more than two levels deep
- a symbolic link, or a JSON or YAML file that does not parse
The catalog's files are far below these limits. If a model needs more, open an issue first.
Personal data
x-personal-data: true on an attribute in schema.json marks an attribute that often holds personal data. Model pages show it as a red "personal data" label. Add it to attributes that hold information about a person. For example, reviewedBy in Decision holds an account identifier, not a name, and is marked because the account belongs to a person.
The marker is a hint, not a compliance statement:
- It does not say how the data must be protected, stored or kept, or how a law classifies it.
- An attribute without the marker can still hold personal data, for example a free-text note, or a location that shows where someone lives.
- CI checks only that the value is
trueor that the marker is absent, and only on the model's own attributes (the top-level properties ofschema.json). Put the marker there: the model page shows the label only for those attributes.
Whoever stores the data decides which attributes are personal data in their system and how to protect them.
Mapping to Japanese standards
A mapping file (mapping/*.yaml) says how a model relates to a standard, so that data that follows the standard can be used with the model directly. The catalog keeps its mapping files few (decided 2026-10-12):
- A mapping file only for a published standard or format that many lists follow and that the model was designed from. These are national standards such as the Digital Agency's 自治体標準オープンデータセット, the data of the Geospatial Information Authority of Japan (GSI), the Government Interoperability Framework (GIF) or the Essential Elements of Information (EEI) for disaster response, and widely used systems whose format is public (such as GitHub Issues or Redmine). Example: EvacuationSite.
- No mapping file for one organisation's own list or system. Its owners keep that mapping themselves;
datamodels mappingwrites a first version (Converting your data). - Conversion rules only in a few worked examples. Most mapping files only document how the model relates to the standard (
toandnote). A proposal adds conversion rules (column,transform) only when lists that follow the standard are actually converted.
Reviewers check that the standard exists and that many lists follow it; CI does not.
New editions of a standard
A mapping file names the edition it follows (for example the 20260801 edition of the 自治体標準オープンデータセット, or version 1.1 of EEI). When a new edition comes out, maintainers update the mapping. That alone changes no version number. If the model itself has to change, the version rules apply. There is no fixed deadline.
Writing examples
Every entity model has two examples (in the key-values form and the normalized form); a value type such as Geometry has only the key-values one. They appear on the model page, CI validates them, and people copy them when they write a client, so all subjects share one scenario.
- Scenario: a fictional heavy-rain response in Chiyoda, Tokyo (July 2026). The ward sets up a disaster-response project, a task checks a flooded underpass on Yasukuni-dōri, the road is closed and a shelter opens.
- Real and fictional: place names, addresses, codes (local government code, Address Base Registry town id and others) and coordinates are real. Events, people, teams and system numbers are invented. No personal names; use identifiers such as
staff-0012orfield-team-a. - Identifiers:
urn:ngsi-ld:<Type>:<local id>. Use the source system's number as the local id where there is one (urn:ngsi-ld:Task:1234). When several organisations share one broker, add the organisation:urn:ngsi-ld:<Type>:<org>:<local id>. - References: a reference to another catalog type points at that type's example (Task's
projectis the Project example). References to the same type (parent,relatedTo) and to types the catalog does not define (Person,Team) are free. CI checks this. - URLs: source-system URLs use an example domain such as
tracker.example.jp. - Times: local Japanese times carry
+09:00.
Stages
Each model page shows the model's stage. A model is added as a draft when its pull request is merged; the table says what each stage means.
| Stage | Meaning |
|---|---|
Draft (draft) | Reviewed and in the catalog. It does not yet have implementations from two different organisations. It may still change in new versions before it is stable. For production use, we suggest waiting until it is stable. |
Experimental (experimental) | A model in use, to learn from. It may be replaced by another model. Rare in this catalog. |
Stable (stable) | Used by two different organisations in their own systems. |
Deprecated (deprecated) | Not for new data. It stays published, and its URLs do not change. The model page names the replacement, if there is one. |
Whatever the stage, a published version never changes (from the official launch). A model changes through new versions (URLs and versions).
To become stable, a model needs two implementations from different organisations in its ADOPTERS.yaml. Each entry gives name, organization and a url (a public repository, documentation or a contact). CI checks that two organisations are listed. The reviewer of the pull request that sets stable checks that they are real and independent.
- An implementation by Geolonia, which runs the catalog, counts as one on the same terms. The other must come from a different organisation.
- One organisation counts once, whatever the customer or project.
organizationnames the organisation that built it.