Getting started with MobX Schema
Model and validate a public-space infrastructure feature.
MobX Schema is the shared vocabulary for public-space infrastructure: benches, bus stops, charging stations, parcel lockers, toilets, and other features that make a street usable. Municipalities and integrators can publish those features in the same shape, while applications can validate them against one open contract.
Create a feature
- Choose an infrastructure
classand its broadersubtype. The infrastructure class reference lists the current classes and their properties. - Describe the location as GeoJSON geometry, give the feature an
id, and set the sharedtheme,type, andversionproperties. - Add any class-specific values under
class_properties. Keep the nestedclassequal to the feature'sclasswhen that object is present.
For example, this bench follows the current infrastructure schema:
{
"type": "Feature",
"id": "bench-123",
"geometry": { "type": "Point", "coordinates": [4.35, 50.85] },
"properties": {
"theme": "base",
"type": "infrastructure",
"version": 1,
"subtype": "services",
"class": "bench",
"class_properties": {
"class": "bench",
"backrest": true,
"capacity": 2
},
"names": { "primary": "Parc de Bruxelles Bench" }
}
}Validate before publishing
Validate the complete feature against the current packages/schema/schema.yaml contract. Resolve
its references to infrastructure.yaml, defs.yaml, and GeoJSON schemas before
passing it to a JSON Schema 2020-12 validator; loading the YAML file alone leaves those references
unresolved. The generated validators in packages/schema-ts-sdk are another option for applications
using this repository.
For the shared property definitions and source attribution rules, see the MobX object reference. For the shape of an infrastructure feature, see Infrastructure map features.