Skip to content

v2.0.0 — Data v2: one canonical record contract

Choose a tag to compare

@yasserstudio yasserstudio released this 22 Jul 09:25
· 228 commits to main since this release
e923da7

Data v2 unifies every sector package onto one canonical record contract via a new @geoalgeria/schema dependency, replacing 26 hand-written, drifted types/index.d.ts shapes. This is a breaking schema change across 25 packages — the 23 migrated sector packages plus the @geoalgeria/transport and @geoalgeria/pharma umbrellas. Consumers on ^1 are unaffected until they opt in; read packages/schema/MIGRATING.md before bumping.

Breaking changes

  • Record shape: wilaya_code is now a zero-padded string ("16", not 16); commune linkage is commune_code (string ONS code) + commune; coordinates are lat/lng; external ids collapse into refs: { osm, wikidata, … } instead of flat osm_id/wikidata; id is an opaque string unique within its file. Update any code keyed on the old shapes before adopting 2.0.0.
  • geo_precision: now strictly exact | approximate | null — null if and only if the record has no coordinate. The old method vocabulary (osm_point, commune_centroid, campus, …) moved to a new geo_method field. exact now requires ≥3 decimal places and a point unique within its file — 409 records that could not carry that claim were downgraded to approximate.

New

  • @geoalgeria/schema: canonical TypeScript types, a zero-dependency runtime validator (Algeria-bbox + point-in-wilaya-boundary checks, catching coordinate swaps/sign-flips), a canonical metadata.json writer, and CSV/GeoJSON emit helpers. CI now fails the build on any contract violation instead of silently shipping bad data. (Dev dependency — not published to npm.)
  • Catalog artifacts: a root index.json catalog and a schema.org/Dataset descriptor (dataset-metadata.json) shipped in 24 packages.
  • Wilaya boundaries: the 69 wilaya boundary polygons now ship in the core dataset package as data/geojson/wilaya-boundaries.geojson (OSM-derived, ODbL, display-grade — median vertex gap 3.36 km, not survey-grade).

Corrections

  • Tourisme: 972 previously-dropped values restored (address, phone, website, stars, rooms, description, heritage, heritage_status, refs.wikidata/refs.wikipedia); 115 records corrected from a false source: "osm" to source: "wikidata"; package license corrected to ODbL-1.0 AND CC0-1.0 AND factual public listing (ASAL).
  • Provenance: real git-traceable dates across packages; licence metadata completed (6 open-licence packages with canonical URLs, 18 packages with conditionsOfAccess).
  • Id prefixes: mobilis ids are now ag-…/pdv-…; tourisme ids are lodging-/attraction-/historic-/thermal-spring-/park-, keeping each merged multi-file collection unique.

Not included

Two packages predate this contract and are not part of the migration: the core geoalgeria dataset package (wilayas/dairas/communes, still v1 shape) and @geoalgeria/telecom. The root index.json catalog marks both schema_version: null. Their migrations will land as separate breaking changes.

Packages

@geoalgeria/schema (new) · poste · emploi · mobilis · aviation · banques · livraison · jeunesse (3.0.0) · sports · enseignement-superieur · tourisme · formation-professionnelle · djezzy · mosquees · sante · culture · agriculture · ecoles · gares-routieres · ferroviaire · buses · transport · industrie-pharmaceutique · pharmacies · ooredoo · pharma

Full details in CHANGELOG.md.