|
|
|
|
@@ -1,169 +1,71 @@
|
|
|
|
|
#PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
|
|
|
|
#PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
|
|
|
|
#PREFIX org: <http://www.w3.org/ns/org#>
|
|
|
|
|
#PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
|
|
|
|
#
|
|
|
|
|
## 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
|
|
|
|
|
## (their own triples: org:Post, mu:uuid, ere:functie, and the
|
|
|
|
|
## ere:wordtBediendDoor link). This only touches ere:PositieBedienaar, which OP
|
|
|
|
|
## owns. The bedienaar side (ere:RolBedienaar, org:holds, conditions) is owned
|
|
|
|
|
## by loket and is handled there instead (app-digitaal-loket
|
|
|
|
|
## 20260803120000-cleanup-islam-imam-bedienaren-by-status.sparql, step 1 - same
|
|
|
|
|
## lowest-URI-wins rule, applied to org:holds at the actual source of truth).
|
|
|
|
|
## That migration must run first/land before this one, so no bedienaar is
|
|
|
|
|
## still pointing at a position this deletes.
|
|
|
|
|
#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)
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
#;
|
|
|
|
|
#
|
|
|
|
|
## Islamitisch eredienstbesturen "In Oprichting" (erkenningszoekend) should only
|
|
|
|
|
## have the "Waarnemende Imam" minister position - same rule the
|
|
|
|
|
## construct-organization-relationships-service applies going forward
|
|
|
|
|
## (WORSHIP_IN_OPRICHTING_MINISTERS). Remove the 3 ranked-imam positions that
|
|
|
|
|
## were always created before this fix. Position-only: any bedienaar that was
|
|
|
|
|
## still holding one of these is already gone by now, removed by loket's own
|
|
|
|
|
## migration (app-digitaal-loket
|
|
|
|
|
## 20260803120000-cleanup-islam-imam-bedienaren-by-status.sparql, step 3),
|
|
|
|
|
## which must run before this one.
|
|
|
|
|
#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
|
|
|
|
|
# regorg:orgStatus <http://lblod.data.gift/concepts/abf4fee82019f88cf122f986830621ab> ; # In Oprichting
|
|
|
|
|
# ere:wordtBediendDoor ?position .
|
|
|
|
|
#
|
|
|
|
|
# ?position ?p ?o ;
|
|
|
|
|
# ere:functie ?functie .
|
|
|
|
|
#
|
|
|
|
|
# VALUES ?functie {
|
|
|
|
|
# <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
|
|
|
|
|
# }
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
#;
|
|
|
|
|
#
|
|
|
|
|
## Islamitisch eredienstbesturen that are "Actief" (erkend) should only have the
|
|
|
|
|
## 3 ranked-imam positions - same rule as MINISTER_CLASSIFICATIONS in
|
|
|
|
|
## construct-organization-relationships-service. Remove the "Waarnemende Imam"
|
|
|
|
|
## position that was always created before this fix. Position-only, same
|
|
|
|
|
## precondition as above: loket's migration step 2 must have already cleared
|
|
|
|
|
## any bedienaar holding it.
|
|
|
|
|
#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
|
|
|
|
|
# regorg:orgStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> ; # Actief
|
|
|
|
|
# ere:wordtBediendDoor ?position .
|
|
|
|
|
#
|
|
|
|
|
# ?position ?p ?o ;
|
|
|
|
|
# ere:functie <http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb> . # Waarnemende Imam
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
#;
|
|
|
|
|
#
|
|
|
|
|
## Create the 3 ranked-imam positions for "Actief" islamitisch eredienstbesturen
|
|
|
|
|
## that are missing one or more of them (idempotent: MD5-derived deterministic
|
|
|
|
|
## UUID + FILTER NOT EXISTS, matching 20221004113653-create-missing-bedienaren-positions.sparql).
|
|
|
|
|
## Pure creation, nothing to coordinate with loket for.
|
|
|
|
|
#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
|
|
|
|
|
# regorg:orgStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> . # Actief
|
|
|
|
|
#
|
|
|
|
|
# VALUES ?functie {
|
|
|
|
|
# <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)) as ?uuidNewMinisterPosition)
|
|
|
|
|
# BIND(IRI(CONCAT("http://data.lblod.info/id/positiesBedienaar/", ?uuidNewMinisterPosition)) AS ?newMinisterPosition)
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
#;
|
|
|
|
|
#
|
|
|
|
|
## Create the "Waarnemende Imam" position for "In Oprichting" islamitisch
|
|
|
|
|
## eredienstbesturen that are missing it (should be rare, kept for
|
|
|
|
|
## completeness/idempotency). Pure creation, nothing to coordinate with loket
|
|
|
|
|
## for.
|
|
|
|
|
#INSERT {
|
|
|
|
|
# GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
|
|
|
|
# ?worshipService ere:wordtBediendDoor ?newMinisterPosition .
|
|
|
|
|
#
|
|
|
|
|
# ?newMinisterPosition a org:Post , ere:PositieBedienaar ;
|
|
|
|
|
# mu:uuid ?uuidNewMinisterPosition ;
|
|
|
|
|
# ere:functie <http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb> . # Waarnemende Imam
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
#WHERE {
|
|
|
|
|
# GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
|
|
|
|
# ?worshipService a ere:BestuurVanDeEredienst ;
|
|
|
|
|
# ere:typeEredienst <http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> ; # Islamitisch
|
|
|
|
|
# regorg:orgStatus <http://lblod.data.gift/concepts/abf4fee82019f88cf122f986830621ab> . # In Oprichting
|
|
|
|
|
#
|
|
|
|
|
# FILTER NOT EXISTS {
|
|
|
|
|
# ?worshipService ere:wordtBediendDoor ?ministerPosition .
|
|
|
|
|
# ?ministerPosition ere:functie <http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb> .
|
|
|
|
|
# }
|
|
|
|
|
#
|
|
|
|
|
# BIND(MD5(?worshipService) as ?uuidNewMinisterPosition)
|
|
|
|
|
# BIND(IRI(CONCAT("http://data.lblod.info/id/positiesBedienaar/", ?uuidNewMinisterPosition)) AS ?newMinisterPosition)
|
|
|
|
|
# }
|
|
|
|
|
#}
|
|
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
# 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)) as ?uuidNewMinisterPosition)
|
|
|
|
|
BIND(IRI(CONCAT("http://data.lblod.info/id/positiesBedienaar/", ?uuidNewMinisterPosition)) AS ?newMinisterPosition)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|