diff --git a/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430180050-feat--relate-werkingsgebieden-for-municipalities-and-provinces.sparql b/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430180050-feat--relate-werkingsgebieden-for-municipalities-and-provinces.sparql new file mode 100644 index 0000000..e836bb5 --- /dev/null +++ b/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430180050-feat--relate-werkingsgebieden-for-municipalities-and-provinces.sparql @@ -0,0 +1,26 @@ +PREFIX geo: +PREFIX org: +PREFIX besluit: + +INSERT { + GRAPH { + ?municipalityLocation geo:sfWithin ?provinceLocation . + } +} WHERE { + GRAPH { + ?municipality a besluit:Bestuurseenheid ; + org:classification . + ?province a besluit:Bestuurseenheid ; + org:classification . + } + + GRAPH { + ?membership a org:Membership ; + org:member ?municipality ; + org:organization ?province . + + ?municipality besluit:werkingsgebied ?municipalityLocation . + ?province besluit:werkingsgebied ?provinceLocation . + } + +}