Files
app-organization-portal/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430145904-fix--relate-district-location-to-municipality.sparql
mirdono 2f06135cf9 fix: relate district locations to Antwerp locations
The districts locations were previously not linked to their containing Antwerp
municipality location. This migration fixes that.
2025-05-06 11:50:17 +02:00

18 lines
650 B
SPARQL

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
INSERT {
GRAPH <http://mu.semte.ch/graphs/public> {
?districtLocation geo:sfWithin ?antwerpLocation .
}
}
WHERE {
GRAPH <http://mu.semte.ch/graphs/public> {
?districtLocation a prov:Location ;
ext:werkingsgebiedNiveau ?level .
FILTER (?level = "District")
}
# Hardcode the werkingsgbied for the Antwerp municipality as it is the only one with districts anyway.
BIND (<http://data.lblod.info/id/werkingsgebieden/3a9b09cbccb798c8f9d5bad3fce1476bce1ee014165ba243488b0af690d0f464> AS ?antwerpLocation)
}