Add cleanup of addresses graph and move to regular migrations

This commit is contained in:
Claire Lovisa
2025-07-22 12:01:01 +02:00
parent 68cbd39c9d
commit e1eca4b185
3 changed files with 22 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
- Add a service to manage organisation's their scope of operation [OP-3205]
- datamodel: Allow a location to be within multiple other locations [OP-3205]
- datafix: set scope of operation for worship administrative units [OP-3626]
- Clean dev addresses linked to both sites and contact points of mandatarissen [DL-6701]
- Clean addresses linked to both sites and contact points of mandatarissen and addresses that are in the wrong graph (admin unit graph but linked to a contact point in the worship graph) [DL-6701]
### Deploy notes
```
drc pull scope-of-operation; drc up -d scope-of-operation

View File

@@ -7,9 +7,7 @@ DELETE {
?newAddressUri a <http://www.w3.org/ns/locn#Address> ;
<http://mu.semte.ch/vocabularies/core/uuid> ?newAddressUuid ;
?p ?o .
}
GRAPH ?h {
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?newAddressUri .
}
} WHERE {
@@ -23,9 +21,10 @@ DELETE {
?mandatarisContact <http://www.w3.org/ns/locn#address> ?oldAddressUri .
GRAPH ?h {
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
?site a <http://www.w3.org/ns/org#Site>;
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
}
BIND(MD5(CONCAT(?oldAddressUri,"OLD_ADDRESS")) AS ?newAddressUuid) .
BIND(MD5(CONCAT(?oldAddressUri,"NEW_ADDRESS")) AS ?newAddressUuid) .
BIND(IRI(CONCAT("http://data.lblod.info/id/adressen/", STR(?newAddressUuid))) AS ?newAddressUri) .
}

View File

@@ -0,0 +1,18 @@
DELETE {
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?address ?p ?o .
}
} INSERT {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?address ?p ?o .
}
} WHERE {
GRAPH <http://mu.semte.ch/graphs/worship-service> {
?contactPoint a <http://schema.org/ContactPoint> ;
<http://www.w3.org/ns/locn#address> ?address .
}
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?address ?p ?o .
}
}