diff --git a/CHANGELOG.md b/CHANGELOG.md index 6688a39..1224800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Werkingsgebied (dct:spatial) for private OCMW associations [OP-3832] - Add a new "Wijkkantoor" site type [OP-3837] - cleanup local involvement herne [OP-3858] +- Keep werkingsgebied filter up to date via db-cleanup service [OP-3841] ### Deploy notes ``` @@ -40,6 +41,10 @@ drc restart migrations frontend db resource cache drc restart migrations search drc up -d frontend ``` +``` +drc restart migrations +drc restart db-cleanup +``` ## v1.41.0 - added explicit healtchecks [DL-7466] diff --git a/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.graph b/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.graph new file mode 100644 index 0000000..d5c0765 --- /dev/null +++ b/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public \ No newline at end of file diff --git a/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.ttl b/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.ttl new file mode 100644 index 0000000..26144c2 --- /dev/null +++ b/config/migrations/2026/20260805110230-cleanup-codelist-operation-areas.ttl @@ -0,0 +1,109 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + + a cleanup:Job ; + mu:uuid "db1e677e-fc84-47b1-8204-020ce139cfbb" ; + dcterms:title "Adding new werkingsgebieden to codelist" ; + cleanup:randomQuery """ + + PREFIX besluit: + PREFIX prov: + PREFIX core: + PREFIX ext: + PREFIX skos: + PREFIX rdfs: + + INSERT { + GRAPH { + ?uri a skos:Concept ; + skos:inScheme ; + core:uuid ?uuid ; + skos:prefLabel ?label . + } + } + WHERE { + ?sub besluit:werkingsgebied ?uri . + + ?uri a prov:Location ; + core:uuid ?uuid ; + rdfs:label ?label ; + ext:werkingsgebiedNiveau "Gemeente" . + + FILTER NOT EXISTS { + ?existingConcept a skos:Concept ; + core:uuid ?uuid ; + skos:inScheme . + } + } + """ . + + a cleanup:Job ; + mu:uuid "64c7a5c9-5d73-43bf-a856-ad31c8fc8cd4" ; + dcterms:title "Cleaning up old werkingsgebieden from codelist" ; + cleanup:randomQuery """ + + PREFIX besluit: + PREFIX prov: + PREFIX core: + PREFIX ext: + PREFIX skos: + + DELETE { + GRAPH { + ?uri a skos:Concept ; + skos:inScheme ; + core:uuid ?uuid ; + skos:prefLabel ?label . + } + } + WHERE { + ?uri a skos:Concept ; + core:uuid ?uuid ; + skos:prefLabel ?label ; + skos:inScheme . + + FILTER NOT EXISTS { + ?sub besluit:werkingsgebied ?existingEntry . + ?existingEntry a prov:Location ; + core:uuid ?uuid ; + ext:werkingsgebiedNiveau "Gemeente" . + } + } + """ . + + a cleanup:Job ; + mu:uuid "6061ca0c-12d8-4fb7-9c24-511e21ab7e0e" ; + dcterms:title "Updating werkingsgebieden labels from codelist" ; + cleanup:randomQuery """ + + PREFIX besluit: + PREFIX prov: + PREFIX ext: + PREFIX skos: + PREFIX rdfs: + + DELETE { + GRAPH { + ?uri skos:prefLabel ?oldLabel . + } + } + INSERT { + GRAPH { + ?uri skos:prefLabel ?newLabel . + } + } + WHERE { + ?sub besluit:werkingsgebied ?uri . + + ?uri a prov:Location ; + rdfs:label ?newLabel ; + ext:werkingsgebiedNiveau "Gemeente" . + + ?uri a skos:Concept ; + skos:inScheme ; + skos:prefLabel ?oldLabel . + + FILTER(STR(?oldLabel) != STR(?newLabel)) + } + """ . \ No newline at end of file