diff --git a/CHANGELOG.md b/CHANGELOG.md index da1f733..b4cef9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog ## 1.37.0 (2025-10-24) +- Added cleanup job to clean duplicated data of municipalities and provinces [OP-3676] + +#### CLI +``` +drc restart migrations +drc exec db-cleanup curl -X GET "http://localhost/runCronJob?cronJobID=8ffd9f11-db25-430d-a66a-31fc8b393d5f" ### Backend - Add municipalities and werkingsgebieden in the area of Brussel [OP-3669] - Updated mu-search configuration with source [OP-3670] 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..2f7222e --- /dev/null +++ b/config/migrations/2025/20251024093007-cleanup-deduplicate-municipalities-and-provinces.ttl @@ -0,0 +1,48 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + + a cleanup:Job ; + mu:uuid "8ffd9f11-db25-430d-a66a-31fc8b393d5f" ; + dcterms:title "Cleaning duplicated data of municipalities and provinces" ; + cleanup:randomQuery """ + + PREFIX besluit: + + DELETE { + GRAPH { + ?s ?p ?o . + } + } + WHERE { + VALUES (?g1 ?g2) { + ( ) + } + + { + 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 + { + 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) + } + } + } + """ . \ No newline at end of file