Files
app-organization-portal/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430180050-feat--relate-werkingsgebieden-for-municipalities-and-provinces.sparql
mirdono 01c5c7e7b3 fix: insert location relations in the correct graph
The initial version of the migration, incorrectly, inserted the triples linking
municipality and province locations in the administrative unit graph. This
corrects that behaviour putting the triples in the public graph along with all
location data.
2025-05-21 10:50:51 +02:00

27 lines
993 B
SPARQL

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
INSERT {
GRAPH <http://mu.semte.ch/graphs/public> {
?municipalityLocation geo:sfWithin ?provinceLocation .
}
} WHERE {
GRAPH <http://mu.semte.ch/graphs/shared> {
?municipality a besluit:Bestuurseenheid ;
org:classification <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001> .
?province a besluit:Bestuurseenheid ;
org:classification <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000000> .
}
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?membership a org:Membership ;
org:member ?municipality ;
org:organization ?province .
?municipality besluit:werkingsgebied ?municipalityLocation .
?province besluit:werkingsgebied ?provinceLocation .
}
}