diff --git a/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.graph b/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.graph new file mode 100644 index 0000000..d5c0765 --- /dev/null +++ b/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public \ No newline at end of file diff --git a/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.ttl b/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.ttl new file mode 100644 index 0000000..e541d45 --- /dev/null +++ b/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.ttl @@ -0,0 +1,58 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + + a cleanup:Job ; + mu:uuid "8ffd9f11-db25-430d-a66a-31fc8b393d5f" ; + dcterms:title "Insert missing province uris for addresses of administrative units" ; + cleanup:randomQuery """ + + PREFIX besluit: + + DELETE { + GRAPH { + ?s ?p ?o . + } + } + WHERE { + VALUES (?g1 ?g2) { + ( ) + } + + { + # Subject is a Bestuurseenheid + GRAPH ?g1 { + ?s a besluit:Bestuurseenheid ; + ?p ?o . + FILTER(?p != rdf:type) + } + GRAPH ?g2 { + ?s a besluit:Bestuurseenheid ; + ?p ?o . + FILTER(?p != rdf:type) + } + } + UNION + { + # Object is a Bestuurseenheid + GRAPH ?g1 { + ?s ?p ?o . + ?o a besluit:Bestuurseenheid . + FILTER(?p != rdf:type) + } + GRAPH ?g2 { + ?s ?p ?o . + ?o a besluit:Bestuurseenheid . + FILTER(?p != rdf:type) + } + } + } + ORDER BY ?s ?p ?o + + + """ . + + + + +