From c6b74f6a1c8260c436dc8b77c87ab585702f91cf Mon Sep 17 00:00:00 2001 From: mirdono Date: Wed, 30 Apr 2025 16:32:26 +0200 Subject: [PATCH] refactor: move werkingsgebieden to public graph The data on werkingsgebieden was largely duplicated across two graphs the shared graph and administrative unit graph. Some exceptions were that werkingsgebieden with level "referentieregio" were only in the shared graph, whereas werkingsgebieden for new municipalities that resulted from the 2025 mergers were only in the administrative unit graph. This moves all the werkingsgebieden and their corresponding data to the public graph, resolving the duplication in the process. Furthermore, the `public` and `organizations` producers are update to only look in the public graph for locations. --- CHANGELOG.md | 5 +++++ .../delta-producer/organizations/export.json | 2 +- config/delta-producer/public/export.json | 3 +-- ...ve-werkingsgebieden-to-public-graph.sparql | 22 +++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430142110-chore--move-werkingsgebieden-to-public-graph.sparql diff --git a/CHANGELOG.md b/CHANGELOG.md index e59f301..3d5697e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,16 @@ - datafix: update NIS2019 end dates and link additional NIS2025 to werkingsgebieden [part of OP-3566] - datafix: correct date of change event of ckb olen [OP-3594] - datafix: move memberships from shared to administrative unit graph +- datafix: move werkingsgebieden to public graph [OP-3566] ### Deploy Notes ``` drc restart migrations; drc logs -ft --tail=200 migrations drc up -d kbo-data-sync drc exec kbo-data-sync curl -X POST http://localhost/sync-all-kbo-data + +drc restart delta-producer-publication-graph-maintainer +drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs # or wait until nightly healing kicks in +drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/organizations/healing-jobs # or wait until nightly healing kicks in ``` ## v1.31.2 (2025-04-02) diff --git a/config/delta-producer/organizations/export.json b/config/delta-producer/organizations/export.json index 1e4a5e8..5ad0419 100644 --- a/config/delta-producer/organizations/export.json +++ b/config/delta-producer/organizations/export.json @@ -389,7 +389,7 @@ { "type": "http://www.w3.org/ns/prov#Location", "graphsFilter": [ - "http://mu.semte.ch/graphs/shared" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2000/01/rdf-schema#label", diff --git a/config/delta-producer/public/export.json b/config/delta-producer/public/export.json index ace337f..67a79de 100644 --- a/config/delta-producer/public/export.json +++ b/config/delta-producer/public/export.json @@ -628,8 +628,7 @@ { "type": "http://www.w3.org/ns/prov#Location", "graphsFilter": [ - "http://mu.semte.ch/graphs/shared", - "http://mu.semte.ch/graphs/administrative-unit" + "http://mu.semte.ch/graphs/public" ], "hasRegexGraphsFilter": false, "properties": [ diff --git a/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430142110-chore--move-werkingsgebieden-to-public-graph.sparql b/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430142110-chore--move-werkingsgebieden-to-public-graph.sparql new file mode 100644 index 0000000..58baca8 --- /dev/null +++ b/config/migrations/2025/20250430130307-chore--cleanup-werkingsgebieden-data/20250430142110-chore--move-werkingsgebieden-to-public-graph.sparql @@ -0,0 +1,22 @@ +PREFIX prov: +PREFIX ext: + +DELETE { + GRAPH ?sourceGraph { + ?werkingsgebied ?p ?o . + } +} INSERT { + GRAPH { + ?werkingsgebied ?p ?o . + } +} WHERE { + GRAPH ?sourceGraph { + ?werkingsgebied a prov:Location ; + ext:werkingsgebiedNiveau ?level ; + ?p ?o . + } + VALUES ?sourceGraph { + + + } +}