Data Models
NGSI-LD entities, spatial/temporal properties, and examples
Data Models
UrbanReflex follows NGSI-LD for smart city context data. Core entities are stored in Orion-LD; app metadata may live in MongoDB. Below is a condensed view—see full details in docs/DATA_MODEL_AND_ENTITIES.md.
NGSI-LD Basics
@context:https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonldid:urn:ngsi-ld:<Type>:<Unique>type: entity typeProperty: value + optional metadata (unitCode,observedAt)Relationship: link to another entity viaobjectGeoProperty: GeoJSON (Point,LineString,Polygon), coords in[lon, lat]
Core Entity Types
RoadSegment (hub)
- LineString geometry; links infrastructure, observations, and reports.
- Key properties:
name,roadClass,length,width,laneCount,surfaceType,maxSpeed,location(LineString).
Streetlight
- Point geometry; tied to a
RoadSegmentviarefRoadSegment; status and energy props.
CitizenReport
- Point geometry; links to
RoadSegment; classification/priority/status fields.
WeatherObserved / AirQualityObserved
- Point geometry observations with
dateObserved/observedAtand pollutant/weather metrics.
PointOfInterest
- Points for hospitals, schools, parks, etc.; categories and contact info.
Relationships
refRoadSegmentlinks Streetlight/CitizenReport → RoadSegment.- Proximity (geo queries) links POIs/observations to roads/areas.
- Temporal queries track observation history (
timerelparams in NGSI-LD).
Example relationship query (all streetlights on a road):
Spatial & Temporal
- CRS: WGS84, coordinates
[lon, lat]. - Geo:
Point,LineString,Polygon; queries:near,within,intersects. - Temporal:
dateObserved,observedAt,createdAt,modifiedAt; temporal queries via/temporal/entities.
Validation & Standards
- IDs:
urn:ngsi-ld:<Type>:<Identifier>. - Units: UN/CEFACT codes (e.g.,
CEL,MTR,KMH,LUM). - JSON-LD contexts define semantics (
docs/jsonld/in repo). - Prefer FIWARE Smart Data Models; extend only when needed.
Examples & Datasets
- Full examples: see
docs/DATA_MODEL_AND_ENTITIES.md(section Examples). - Open data exports:
open_data/(GeoJSON, NDJSON) for RoadSegment, Streetlight, WeatherObserved, AirQualityObserved, PointOfInterest, CitizenReport.
For the complete specification, diagrams, and more examples, read docs/DATA_MODEL_AND_ENTITIES.md.
