Merge pull request #616 from lblod/DL-7485-restrict-imam-roles-based-on-worship-status

Dl 7485 restrict imam roles based on worship status
This commit is contained in:
Damon Kennes
2026-08-07 16:42:08 +02:00
committed by GitHub
5 changed files with 104 additions and 1 deletions

View File

@@ -23,6 +23,8 @@
- Consume and serve provenance properties on harvested Worship positions [DL-7437]
- Frontend [v1.41.0](https://github.com/lblod/frontend-organization-portal/blob/v1.41.0/CHANGELOG.md) [DL-7438]
- Keep werkingsgebied filter up to date via db-cleanup service [OP-3841]
- Restrict available imam roles based on worship organisation status [DL-7485]
- IMPORTANT NOTE: Make sure first the [DL-7485] loket migration has completed + data has flown from loket to OP
### Deploy notes
```
@@ -61,6 +63,10 @@ drc up -d frontend
drc restart cache resource
```
```
drc restart migrations resource delta-producer-publication-graph-maintainer
```
## v1.41.0
- added explicit healtchecks [DL-7466]

View File

@@ -535,7 +535,8 @@
],
"properties": [
"http://mu.semte.ch/vocabularies/core/uuid",
"http://www.w3.org/2004/02/skos/core#prefLabel"
"http://www.w3.org/2004/02/skos/core#prefLabel",
"http://data.lblod.info/vocabularies/erediensten/vanToepassingBijStatus"
]
},
{

View File

@@ -0,0 +1,72 @@
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
PREFIX org: <http://www.w3.org/ns/org#>
# Deduplicate islamitisch minister positions: if an eredienstbestuur has more
# than one position for the same function (e.g. 2 "Waarnemende Imam"), keep
# only one - deterministically the lowest-URI position - and drop the rest
DELETE {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?worshipService ere:wordtBediendDoor ?position .
?position ?p ?o .
}
}
WHERE {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?worshipService a ere:BestuurVanDeEredienst ;
ere:typeEredienst <http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> ; # Islamitisch
ere:wordtBediendDoor ?position .
?position ?p ?o ;
ere:functie ?functie .
{
SELECT ?worshipService ?functie (IRI(MIN(STR(?anyPosition))) AS ?keptPosition) WHERE {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?worshipService ere:wordtBediendDoor ?anyPosition .
?anyPosition ere:functie ?functie .
}
}
GROUP BY ?worshipService ?functie
}
FILTER(?position != ?keptPosition)
FILTER NOT EXISTS { ?anyMinister org:holds ?position }
}
}
;
# Create any of the 4 islamitisch minister positions (Waarnemende Imam, Eerste/
# Tweede/Derde Imam in rang) that a worship service is missing, so every
# islamitisch eredienstbestuur always has all 4 positions, regardless of its
# current status.
INSERT {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?worshipService ere:wordtBediendDoor ?newMinisterPosition .
?newMinisterPosition a org:Post , ere:PositieBedienaar ;
mu:uuid ?uuidNewMinisterPosition ;
ere:functie ?functie .
}
}
WHERE {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?worshipService a ere:BestuurVanDeEredienst ;
ere:typeEredienst <http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> . # Islamitisch
VALUES ?functie {
<http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb> # Waarnemende Imam
<http://lblod.data.gift/concepts/e357bc8f4cc3a694fde2239748768a22> # Eerste Imam in rang
<http://lblod.data.gift/concepts/c4a3fd586211b17b06f574885e23f355> # Tweede Imam in rang
<http://lblod.data.gift/concepts/5ebb798bd59c3b48c25116032caa02b7> # Derde Imam in rang
}
FILTER NOT EXISTS {
?worshipService ere:wordtBediendDoor ?ministerPosition .
?ministerPosition ere:functie ?functie .
}
BIND(MD5(CONCAT(?worshipService, ?functie, "fix-islam-imam-roles-by-status")) as ?uuidNewMinisterPosition)
BIND(IRI(CONCAT("http://data.lblod.info/id/positiesBedienaar/", ?uuidNewMinisterPosition)) AS ?newMinisterPosition)
}
}

View File

@@ -0,0 +1,17 @@
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
INSERT DATA {
GRAPH <http://mu.semte.ch/graphs/public> {
<http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb> # Waarnemende Imam
ere:vanToepassingBijStatus <http://lblod.data.gift/concepts/abf4fee82019f88cf122f986830621ab> . # In Oprichting
<http://lblod.data.gift/concepts/e357bc8f4cc3a694fde2239748768a22> # Eerste Imam in rang
ere:vanToepassingBijStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> . # Actief
<http://lblod.data.gift/concepts/c4a3fd586211b17b06f574885e23f355> # Tweede Imam in rang
ere:vanToepassingBijStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> . # Actief
<http://lblod.data.gift/concepts/5ebb798bd59c3b48c25116032caa02b7> # Derde Imam in rang
ere:vanToepassingBijStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> . # Actief
}
}

View File

@@ -1263,6 +1263,13 @@
"predicate": "skos:prefLabel"
}
},
"relationships": {
"applicable-statuses": {
"predicate": "ere:vanToepassingBijStatus",
"target": "organization-status-codes",
"cardinality": "many"
}
},
"new-resource-base": "http://lblod.data.gift/concepts/"
},
"financing-codes": {