Data model

The OgmAPI database works as follow:

Database model

DataSource

Contains information about a data source. A data source correspond to a dataset published on https://data.gouv.fr.

Example: The full IGN Admin Express archive.

  • SQL table name: iedb_datasource

  • id: Unique ID.
  • key: Unique indentifier (human readable string).
  • name: Human friendly name of the dataset as displayed on the explorer.
  • description: Human friendly description of the dataset as displayed on the explorer.
  • last_fetch: Timestamp of the last check for new content published on https://data.gouv.fr.
  • last_new: Timestamp of the last time a new data was uploaded to the database.
  • last_hash: Internal.

Category

A data category. For example the administrative boundaries of the communes.

  • SQL table name: iedb_category

  • id: Unique ID.
  • key: Unique identifier (human readable string).
  • name: Human friendly name.
  • description: Human friendly description.
  • parent: Foreign key to the Parent.id category. NULL when the category has no parent.

SourceCategory

A subset (or the full dataset) of a DataSource linked to a category.

Example: The individual data files (i.e., communes) within the IGN Admin Express archive.

  • SQL table name: iedb_sourcecategory

  • id: Unique ID.
  • key: Unique identifier (human readable string).
  • name: Human friendly name.
  • description: Human friendly description.
  • data_source: Foreign key to DataSource.id.
  • category: Foreign key to Category.id.
  • title_label: Key to the label to be used as title during display. Empty (“”) if not required (i.e., if the object is labelling).
  • minimal_zoom: Information about the minimal zoom level (OpenStreetMap / Leaflet) is preferred before expecting a significant performance drop. None if no performance issues were observed for this dataset.

LabelsDescription

Describe the labels provided by this dataset on it’s subsequent Zones.

  • SQL table name: iedb_labelsdescription

  • source: Foreign key to the SourceCategory.id providing the label.
  • key: Database name.
  • type: Type of the tags (string, number or datetime).
  • name: Human readable name.
  • description: Human readable description

EnrichingLabels

A SourceCategory that has no Zone rows. This SourceCategory has been used to enrich the labelizing Zones with new labels.

Example: The Loyers datasets enriching the IGN Admin Express Communes dataset with information about rent prices.

  • SQL table name: iedb_sourcecategory_label_by

  • source: Foreign key to the SourceCategory.id providing the labels. (SQL: from_sourcecategory_id)
  • labelizing: Foreign key to the SourceCategory.id enriched by the source. (SQL: to_sourcecategory_id)

Zone

Labeled geographical area. Note that internaly the Zone table is partitioned by SourceCategory that provide geometries.

  • SQL table name: iedb_zone

  • source_geom: Foreign key to the DataSource.id providing the geometry.
  • geometry: Geographical area (point, polygon) normalized in WSG84 (EPSG:4326).
  • labels: Descriptive labels (under the JSON format).