Add governed Statbel edition probe
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-16 22:14:48 +02:00
parent 9059db3445
commit da2371d662
23 changed files with 805 additions and 28 deletions
+14 -2
View File
@@ -415,10 +415,15 @@ not marked stale merely because their source date is old. Unknown sources are
### GET `/api/v1/projects/{project_id}/datasets/source-catalog-probes`
Performs an explicit, read-only release probe for the allowlisted GRB WFS,
most-recent orthophoto WMS and ALZ agricultural-use parcel publication page.
most-recent orthophoto WMS, Statbel population DCAT catalog and ALZ
agricultural-use parcel publication page.
For OGC services, the endpoint reads bounded `GetCapabilities` responses,
confirms the expected layers and follows only HTTPS ISO 19139 `GetRecordById`
links on `metadata.vlaanderen.be`. For ALZ, it reads only the bounded official
links on `metadata.vlaanderen.be`. For Statbel, it reads the bounded official
RDF/Turtle catalog and selects the latest uniquely identified Dutch
`Bevolking per statistische sector` release. It requires the official landing
page, CC BY 4.0 license and allowlisted distribution identities but never
requests a ZIP or XLSX file. For ALZ, it reads only the bounded official
HTML release page and accepts only exact
`www.landbouwvlaanderen.be/bestanden/gis/agpa_<year>_<date>_public.zip` link
identities. It does not request those archives. Query parameter `refresh=true`
@@ -438,6 +443,13 @@ edition as outdated. `service_type=HTML` uses `definitive_archive` and
`current_snapshot` as evidence markers in the existing expected/matched/missing
arrays; no parallel response shape is introduced.
Statbel comparisons use the four-digit population reference year. The 2025
release requires the new REDEGEO TXT/ZIP variant; its old-sector-layout file is
reported only as transition evidence. `service_type=DCAT` uses
`population_txt_current`, `landing_page` and `cc_by_4_0` as evidence markers.
A newer statistical-sector geometry edition is not interpreted as a newer
population release.
The endpoint accepts no arbitrary URL, feature query, area or layer. It does
not fetch vector features, raster pixels or models, create jobs/datasets, write
to PostGIS or trigger an import. The normal `source-freshness` endpoint remains
+35
View File
@@ -1,3 +1,38 @@
## Sprint 226 - Governed Statbel population edition probe (2026-07-16)
Implemented:
- Extended the explicit source-catalog audit with the official Statbel DCAT
Turtle catalog. The parser selects one latest Dutch population-by-sector
release and requires consistent period evidence, identifier, canonical
landing page, CC BY 4.0 license and allowlisted distribution identities.
- Added strict endpoint and final-redirect validation plus a separate 5 MiB
response limit. The catalog probe never follows a ZIP/XLSX link, imports a
Dataset, writes PostGIS or enables background polling.
- Kept population reference year, sector-geometry edition and REDEGEO layout
distinct. The 2025 NEW distribution is current; OLD is transition evidence,
and the separate 2026 sector geometry is not presented as 2026 population.
- Reused the canonical source-catalog response, cache, operator CLI and Status
UI. Propagated the fixed URL and size bound through local, Compose and Unraid
configuration and added RDFLib as a pure-Python core parser dependency.
Validation:
- The bounded parser read the live official DCAT catalog and identified
`NodeID6475`, population edition `2025`, four distributions, the new REDEGEO
layout, legacy transition availability, CC BY 4.0 and catalog date
`2026-07-07` without requesting a distribution.
- All 24 focused source-catalog tests passed, including hostile host, redirect,
configured URL, duplicate release, conflicting year, missing license,
missing current distribution and oversized-response failures.
- Complete readiness passed with 801 backend tests, 110 documented routes, one
Alembic head, frontend typecheck and production build. Static Alembic SQL,
Ruff, diff checks and shell syntax also passed. Local Docker validation was
unavailable on Windows and is completed through the Tower deployment gate.
Boundary:
- This is publication evidence only. A future population edition still needs
a governed schema, sector-geometry and totals review before the existing
operator may create a new immutable Dataset.
## Sprint 225 - Governed ALZ edition probe (2026-07-16)
Implemented:
+9 -1
View File
@@ -172,7 +172,7 @@ gebeurd.
| bronfamilie | huidige behandeling | volgende veilige stap |
| --- | --- | --- |
| GRB gebouwen/wegen/water/percelen | operationele, expliciete plan-stage-apply refresh met onveranderlijke snapshots | alleen een nieuw officieel gedateerd cataloguseditie na operatorbevestiging ophalen |
| Statbel bevolking | jaarlijkse, expliciete edities in één tijdreeks | een nieuwe publicatie alleen na schema-, sectorgeometrie- en totalencontrole toevoegen |
| Statbel bevolking | jaarlijkse, expliciete edities in één tijdreeks; officiële DCAT-releaseprobe | een nieuwe publicatie alleen na schema-, sectorgeometrie- en totalencontrole toevoegen |
| ALZ landbouwgebruikspercelen | definitieve jaarlijkse edities 2008-2025; expliciete officiële publicatieprobe; metricvergelijking zonder objectlineage | een nieuwere definitieve v3-editie eerst handmatig beoordelen en daarna via de bestaande begrensde operatorflow toevoegen |
| orthofoto | vaste lokale opname per expliciete analysezone; catalogusprobe is alleen een signaal | vluchtjaar, productvariant en dekking vergelijken voordat nieuwe pixels worden opgehaald |
| landgebruik, thematische rasters, DHMV en VMM-scenario's | vaste product-/scenario-edities, geen rolling snapshot | alleen een nieuwe gedocumenteerde producteditie als afzonderlijke Dataset verwerven |
@@ -190,6 +190,14 @@ actuele `2026-v1` zichtbaar maar niet updategerechtigd blijft. De probe leest
alleen de allowlisted HTML-pagina en linkidentiteiten; ZIP-archieven worden pas
door de afzonderlijke operator opgehaald na menselijke editiebevestiging.
De Statbel-probe leest uitsluitend de officiële DCAT Turtle-catalogus en
selecteert de nieuwste unieke Nederlandstalige publicatie `Bevolking per
statistische sector`. Voor 2025 vereist GeoIntel de nieuwe REDEGEO-indeling;
de meegeleverde oude indeling is alleen overgangsevidentie. De cataloguslinks
naar TXT/ZIP en XLSX worden op host, pad, jaar en variant gevalideerd maar niet
opgehaald. De afzonderlijke statistische-sectorgeometrie 2026 betekent niet
dat er al bevolkingscijfers per sector voor 2026 zijn gepubliceerd.
### Mol population history
`scripts/provision_mol_population_history.py` imports official Statbel
+2
View File
@@ -12,6 +12,8 @@ GeoIntel deliberately uses technologies matching the GeoAI Engineer profile. Dep
- GeoAlchemy2
- psycopg
- python-multipart
- RDFLib for standards-compliant parsing of bounded official RDF/DCAT source
catalogues. It is pure Python and does not fetch provider distributions.
## Approved GIS/remote-sensing
+7
View File
@@ -29,6 +29,8 @@ GRB_WFS_URL=
# Explicit read-only source-edition probes (no provider import).
SOURCE_CATALOG_PROBE_ENABLED=true
SOURCE_CATALOG_GRB_WFS_URL=https://geo.api.vlaanderen.be/GRB/wfs
SOURCE_CATALOG_STATBEL_DCAT_URL=https://doc.statbel.be/publications/DCAT/DCAT_opendata_datasets.ttl
SOURCE_CATALOG_STATBEL_MAX_RESPONSE_MB=5
SOURCE_CATALOG_ALZ_RELEASE_URL=https://landbouwcijfers.vlaanderen.be/open-geodata-landbouwgebruikspercelen
SOURCE_CATALOG_PROBE_TIMEOUT_SECONDS=10
SOURCE_CATALOG_PROBE_MAX_RESPONSE_MB=2
@@ -36,6 +38,11 @@ SOURCE_CATALOG_PROBE_CACHE_TTL_SECONDS=900
OSM_OVERPASS_URL=https://overpass-api.de/api/interpreter
```
The Statbel limit is separate because the official Turtle catalog is larger
than the bounded OGC/HTML metadata responses. The probe parses only release
metadata and validates distribution identities; it never follows population
ZIP or XLSX links.
### Frontend
```env
+1
View File
@@ -42,6 +42,7 @@
- [x] Add explicit bounded GRB/orthophoto catalogue release probes using official capabilities and ISO metadata; keep every acquisition separate and operator-controlled.
- [x] Add a governed regional GRB plan -> stage -> checksum-confirmed apply workflow that preserves every previous snapshot.
- [x] Add a fail-closed ALZ publication probe that distinguishes provisional v1/v2 snapshots from the definitive v3 historical edition and never downloads an archive.
- [x] Add a fail-closed Statbel DCAT publication probe that distinguishes population year, sector-geometry year and the 2025 REDEGEO transition without downloading distributions.
- [ ] Extend catalogue probes only to additional sources that publish a stable official edition contract; do not add background polling or infer releases from HTTP dates alone.
## Governed source expansion backlog