From 01968b304415f55a56563c1b89e5fbcbe3eaf53d Mon Sep 17 00:00:00 2001 From: Boris De Vloed Date: Thu, 17 Mar 2022 11:32:42 +0100 Subject: [PATCH 1/2] Delete bestuurseenheden without status (op-1075) --- ...000-remove-bestuurseenheden-op-1075.sparql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql diff --git a/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql b/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql new file mode 100644 index 0000000..9d75fbc --- /dev/null +++ b/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql @@ -0,0 +1,19 @@ +# Deletes 2 worships services and their attributes (id, address, ...) + +DELETE { + GRAPH ?g { + ?bestuur ?p ?o. + ?o ?p2 ?o2. + ?o2 ?p3 ?o3. + } +} WHERE { + GRAPH ?g { + VALUES ?bestuur { + + + } + ?bestuur ?p ?o. + ?o ?p2 ?o2. + ?o2 ?p3 ?o3. + } +} From e1209a5473e10a27b3ba4fb0da68ba667ee00cc5 Mon Sep 17 00:00:00 2001 From: Boris De Vloed Date: Thu, 17 Mar 2022 17:29:19 +0100 Subject: [PATCH 2/2] query rewrite/fix --- ...000-remove-bestuurseenheden-op-1075.sparql | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql b/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql index 9d75fbc..ca963b3 100644 --- a/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql +++ b/config/migrations/2022/20220317100000-remove-bestuurseenheden-op-1075.sparql @@ -1,10 +1,12 @@ -# Deletes 2 worships services and their attributes (id, address, ...) - DELETE { GRAPH ?g { - ?bestuur ?p ?o. - ?o ?p2 ?o2. - ?o2 ?p3 ?o3. + ?representatieveOrgaan ?bestuur . + ?bestuur ?pbestuur ?obestuur . + ?primarySite ?pprimarySite ?oprimarySite . + ?address ?paddress ?oaddress . + ?contactPoint ?pcontactPoint ?ocontactPoint . + ?identifier ?pidentifier ?oidentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . } } WHERE { GRAPH ?g { @@ -12,8 +14,23 @@ DELETE { } - ?bestuur ?p ?o. - ?o ?p2 ?o2. - ?o2 ?p3 ?o3. + + ?bestuur ?primarySite ; + ?identifier ; + ?pbestuur ?obestuur . + + ?primarySite ?address ; + ?contactPoint ; + ?pprimarySite ?oprimarySite . + + ?address ?paddress ?oaddress . + + ?contactPoint ?pcontactPoint ?ocontactPoint . + + ?identifier ?structuredIdentifier ; + ?pidentifier ?oidentifier . + + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . } } +