Merge pull request #564 from lblod/datafix/dev-addresses-linked-to-site-and-mandataris

Add migration to fix dev addresses
This commit is contained in:
Claire Lovisa
2025-07-25 11:01:19 +02:00
committed by GitHub
3 changed files with 49 additions and 1 deletions

View File

@@ -6,6 +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 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]
- datafix: cleanup of general memberships if specific ones exist [OP-3640]
### Deploy notes
```
@@ -33,7 +34,6 @@ drc restart migrations; drc logs -ft --tail=200 migrations
- Add URI to resource's organization responses
- Fix query for organizations report [OP-3636]
- Bump report-generation-service to most recent version
- Write migration to harmonize date formats of change events [OP-3559]
### Deploy notes
```
drc pull deltanotifier; drc up -d deltanotifier

View File

@@ -0,0 +1,30 @@
DELETE {
GRAPH ?h {
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
}
} INSERT {
GRAPH ?g {
?newAddressUri a <http://www.w3.org/ns/locn#Address> ;
<http://mu.semte.ch/vocabularies/core/uuid> ?newAddressUuid ;
?p ?o .
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?newAddressUri .
}
} WHERE {
GRAPH ?g {
?oldAddressUri a <http://www.w3.org/ns/locn#Address> ;
?p ?o .
FILTER (?p NOT IN (<http://mu.semte.ch/vocabularies/core/uuid>))
}
?mandatarisContact <http://www.w3.org/ns/locn#address> ?oldAddressUri .
GRAPH ?h {
?site a <http://www.w3.org/ns/org#Site>;
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
}
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 .
}
}