Add jobs for cleanup service

This commit is contained in:
NikiDeVisscher
2026-08-06 17:19:36 +02:00
parent c21e72a840
commit 4744a63eff
3 changed files with 115 additions and 0 deletions

View File

@@ -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]

View File

@@ -0,0 +1 @@
http://mu.semte.ch/graphs/public

View File

@@ -0,0 +1,109 @@
@prefix cleanup: <http://mu.semte.ch/vocabularies/ext/cleanup/> .
@prefix mu: <http://mu.semte.ch/vocabularies/core/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
<http://data.lblod.info/id/cleanup-job/db1e677e-fc84-47b1-8204-020ce139cfbb> a cleanup:Job ;
mu:uuid "db1e677e-fc84-47b1-8204-020ce139cfbb" ;
dcterms:title "Adding new werkingsgebieden to codelist" ;
cleanup:randomQuery """
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX core: <http://mu.semte.ch/vocabularies/core/>
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
INSERT {
GRAPH <http://mu.semte.ch/graphs/public> {
?uri a skos:Concept ;
skos:inScheme <http://lblod.data.gift/concept-schemes/3307738e-f84d-4f95-9b14-3e9162d83394> ;
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 <http://lblod.data.gift/concept-schemes/3307738e-f84d-4f95-9b14-3e9162d83394> .
}
}
""" .
<http://data.lblod.info/id/cleanup-job/64c7a5c9-5d73-43bf-a856-ad31c8fc8cd4> a cleanup:Job ;
mu:uuid "64c7a5c9-5d73-43bf-a856-ad31c8fc8cd4" ;
dcterms:title "Cleaning up old werkingsgebieden from codelist" ;
cleanup:randomQuery """
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX core: <http://mu.semte.ch/vocabularies/core/>
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
DELETE {
GRAPH <http://mu.semte.ch/graphs/public> {
?uri a skos:Concept ;
skos:inScheme <http://lblod.data.gift/concept-schemes/3307738e-f84d-4f95-9b14-3e9162d83394> ;
core:uuid ?uuid ;
skos:prefLabel ?label .
}
}
WHERE {
?uri a skos:Concept ;
core:uuid ?uuid ;
skos:prefLabel ?label ;
skos:inScheme <http://lblod.data.gift/concept-schemes/3307738e-f84d-4f95-9b14-3e9162d83394> .
FILTER NOT EXISTS {
?sub besluit:werkingsgebied ?existingEntry .
?existingEntry a prov:Location ;
core:uuid ?uuid ;
ext:werkingsgebiedNiveau "Gemeente" .
}
}
""" .
<http://data.lblod.info/id/cleanup-job/6061ca0c-12d8-4fb7-9c24-511e21ab7e0e> a cleanup:Job ;
mu:uuid "6061ca0c-12d8-4fb7-9c24-511e21ab7e0e" ;
dcterms:title "Updating werkingsgebieden labels from codelist" ;
cleanup:randomQuery """
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
DELETE {
GRAPH <http://mu.semte.ch/graphs/public> {
?uri skos:prefLabel ?oldLabel .
}
}
INSERT {
GRAPH <http://mu.semte.ch/graphs/public> {
?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 <http://lblod.data.gift/concept-schemes/3307738e-f84d-4f95-9b14-3e9162d83394> ;
skos:prefLabel ?oldLabel .
FILTER(STR(?oldLabel) != STR(?newLabel))
}
""" .