From a9e9e761c0faeef8aede459a1a47d2821db5a155 Mon Sep 17 00:00:00 2001 From: mirdono Date: Mon, 3 Jun 2024 13:27:13 +0200 Subject: [PATCH 1/3] chore: removed faulty queries from migration Removed incorrect queries that match on empty KBO numbers. This is to avoid the same incorrect data being imported in case the migration is executed again at some point. --- ...t-public-ocmw-association-addresses.sparql | 28 ------------------- ...ic-ocmw-association-contact-details.sparql | 28 ------------------- 2 files changed, 56 deletions(-) diff --git a/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140212-import-public-ocmw-association-addresses.sparql b/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140212-import-public-ocmw-association-addresses.sparql index eb3df8c..1b5983d 100644 --- a/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140212-import-public-ocmw-association-addresses.sparql +++ b/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140212-import-public-ocmw-association-addresses.sparql @@ -2127,34 +2127,6 @@ } - INSERT { - GRAPH ?g { - ?addressUri - "15"; - - "8710"; - "Wielsbeke"; - "Hernieuwenstraat"; - "Wielsbeke"; - "België"; - "Hernieuwenstraat 15, 8710 Wielsbeke, België". - } - } - WHERE { - GRAPH ?g { - ?adminUnit ?id ; - ?site . - - ?id "KBO nummer" ; - / "" . - - ?site ?boundAddress . - - BIND( ?boundAddress AS ?addressUri ) - } - } - - INSERT { GRAPH ?g { ?addressUri diff --git a/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140236-import-public-ocmw-association-contact-details.sparql b/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140236-import-public-ocmw-association-contact-details.sparql index a9cebd4..d188b75 100644 --- a/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140236-import-public-ocmw-association-contact-details.sparql +++ b/config/migrations/2024/20240212141020-onboarding-public-ocmw-associations/20240215140236-import-public-ocmw-association-contact-details.sparql @@ -1554,31 +1554,3 @@ ?contact "Primary" . } } - - - INSERT { - GRAPH { - ?contact "tel:+3256674504" . - ?contact "https://www.wielsbeke.be/producten/woonzorgcentrum-ter-lembeek" . - ?contact "ouderenhuisvesting@wielsbeke.be" . - } - } - WHERE { - GRAPH { - ?adminUnit ?id ; - ?primarySite . - ?id "KBO nummer" ; - / "" . - - ?primarySite ?contact . - - ?contact "Primary" . - } - } - - - - - - - From 74a0c92b312b62d00fcbd75a41bcd0ed1f882d7c Mon Sep 17 00:00:00 2001 From: mirdono Date: Mon, 3 Jun 2024 14:11:15 +0200 Subject: [PATCH 2/3] fix: remove faulty address data for some AGBs The migrations importing the public OCMW association's address data contained a faulty query that matched on empty KBO numbers. As a result address data was incorrectly inserted to some AGBs that also do not have a KBO number. This migration removes the incorrect data, which as inserted into the triplestore next to actual address. Furthermore, this also (re-)inserts the correct provinces for the affected AGBs. --- ...20240603115306-fix-agb-address-data.sparql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603115306-fix-agb-address-data.sparql diff --git a/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603115306-fix-agb-address-data.sparql b/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603115306-fix-agb-address-data.sparql new file mode 100644 index 0000000..c541f0e --- /dev/null +++ b/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603115306-fix-agb-address-data.sparql @@ -0,0 +1,35 @@ +PREFIX adres: +PREFIX locn: + +# Remove incorrect address triples +DELETE { + GRAPH { + ?address adres:Adresvoorstelling.huisnummer "15" ; + locn:postCode "8710" ; + locn:adminUnitL2 "West-Vlaanderen" ; + locn:thoroughfare "Hernieuwenstraat" ; + locn:fullAddress "Hernieuwenstraat 15, 8710 Wielsbeke, België" ; + adres:gemeentenaam "Wielsbeke" . + } +} WHERE { + VALUES ?address { + # AGB LEUVEN (Parkeerbedrijf) + # AGB MECHELEN (Exploitatie) + # AGB MECHELEN (Patrimonium) + # AGB Renov'O + # AGB STEKENE + # Vrijetijdsbedrijf Knokke-Heist AG + } +} + +# Insert the correct the provinces +INSERT { + GRAPH { + locn:adminUnitL2 "Vlaams-Brabant" . # AGB LEUVEN (Parkeerbedrijf) + locn:adminUnitL2 "Antwerpen" . # AGB MECHELEN (Exploitatie) + locn:adminUnitL2 "Antwerpen" . # AGB MECHELEN (Patrimonium) + locn:adminUnitL2 "West-Vlaanderen" . # AGB Renov'O (located in Oostende) + locn:adminUnitL2 "Oost-Vlaanderen" . # AGB STEKENE + locn:adminUnitL2 "West-Vlaanderen" . # Vrijetijdsbedrijf Knokke-Heist AG + } +} From 714994bc3ceac0a057016bdc95ac0030041638a7 Mon Sep 17 00:00:00 2001 From: mirdono Date: Mon, 3 Jun 2024 16:07:52 +0200 Subject: [PATCH 3/3] fix: remove faulty contact data for some AGBs The migrations importing the public OCMW association's contact data contained a faulty query that matched on empty KBO numbers. As a result contact data was incorrectly inserted to some AGBs that also do not have a KBO number. This migration removes the incorrect data. --- ...20240603133736-fix-agb-contact-data.sparql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603133736-fix-agb-contact-data.sparql diff --git a/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603133736-fix-agb-contact-data.sparql b/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603133736-fix-agb-contact-data.sparql new file mode 100644 index 0000000..c939bce --- /dev/null +++ b/config/migrations/2024/20240603115300-correct-agb-address-and-contact-data/20240603133736-fix-agb-contact-data.sparql @@ -0,0 +1,19 @@ +PREFIX schema: +PREFIX foaf: + +DELETE { + GRAPH { + ?contactPoint schema:telephone "tel:+3256674504" ; + foaf:page "https://www.wielsbeke.be/producten/woonzorgcentrum-ter-lembeek" ; + schema:email "ouderenhuisvesting@wielsbeke.be" . + } +} WHERE { + VALUES ?contactPoint { + # AGB LEUVEN (Parkeerbedrijf) + # AGB MECHELEN (Exploitatie) + # AGB MECHELEN (Patrimonium) + # AGB Renov'O + # AGB STEKENE + # Vrijetijdsbedrijf Knokke-Heist AG + } +}