From 6d1b58ecf0ce3bce1532f5db8fadf12b2b093c91 Mon Sep 17 00:00:00 2001 From: iurianu Date: Fri, 3 Feb 2023 13:18:52 +0200 Subject: [PATCH 1/3] migration to change kbo --- .../20230202100000-change-kbo-number.sparql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 config/migrations/2023/20230202100000-change-kbo-number.sparql diff --git a/config/migrations/2023/20230202100000-change-kbo-number.sparql b/config/migrations/2023/20230202100000-change-kbo-number.sparql new file mode 100644 index 0000000..a63d2e1 --- /dev/null +++ b/config/migrations/2023/20230202100000-change-kbo-number.sparql @@ -0,0 +1,18 @@ +PREFIX generiek: + +DELETE { + GRAPH ?g { + + generiek:lokaleIdentificator ?kbo . + } +} INSERT { + GRAPH ?g { + + generiek:lokaleIdentificator "0655698422" . + } +} WHERE { + GRAPH ?g { + + generiek:lokaleIdentificator ?kbo . + } +} \ No newline at end of file From 411d16e33d5788a0b0f55acc2b83d9d4b32dafda Mon Sep 17 00:00:00 2001 From: iurianu Date: Fri, 3 Feb 2023 15:49:53 +0200 Subject: [PATCH 2/3] migration to remove dummy worship sewrvice --- ...20230203150000-remove-dummy-worship.sparql | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 config/migrations/2023/20230203150000-remove-dummy-worship.sparql diff --git a/config/migrations/2023/20230203150000-remove-dummy-worship.sparql b/config/migrations/2023/20230203150000-remove-dummy-worship.sparql new file mode 100644 index 0000000..0f52eec --- /dev/null +++ b/config/migrations/2023/20230203150000-remove-dummy-worship.sparql @@ -0,0 +1,67 @@ +PREFIX org: +PREFIX adms: +PREFIX generiek: +PREFIX organisatie: + +DELETE { + GRAPH { + ?bestuur ?pbestuur ?obestuur . + ?primarySite ?pprimarySite ?oprimarySite . + ?address ?paddress ?oaddress . + ?contactPoint ?pcontactPoint ?ocontactPoint . + ?identifier ?pidentifier ?oidentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } +} WHERE { + GRAPH { + BIND( as ?bestuur) + + ?bestuur ?pbestuur ?obestuur . + + OPTIONAL { + + ?bestuur org:hasPrimarySite ?primarySite . + + OPTIONAL { + ?primarySite organisatie:bestaatUit ?address . + ?address ?paddress ?oaddress . + } + OPTIONAL { + ?primarySite org:siteAddress ?contactPoint . + ?contactPoint ?pcontactPoint ?ocontactPoint . + } + + ?primarySite ?pprimarySite ?oprimarySite . + + } + OPTIONAL { + + ?bestuur adms:identifier ?identifier . + + OPTIONAL { + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } + + ?identifier ?pidentifier ?oidentifier . + + } + } +} + +# The associated call to trigger a reindex is : + +# curl --location --request POST '172.25.0.34/update' \ +# --header 'Content-Type: application/vnd.api+json' \ +# --data-raw ' [ +# { +# "deletes": [ +# { +# "subject": { "type": "uri", "value": "http://data.lblod.info/id/besturenVanDeEredienst/578bf96f86056e2260dc21cee91aa519" }, +# "predicate": { "type": "uri", "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }, +# "object": { "type": "uri", "value": "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid" } +# } +# ], +# "inserts": [] +# } +# ]' \ No newline at end of file From 0f7313b9449396025bc02c25611b757df741b8fb Mon Sep 17 00:00:00 2001 From: Claire Lovisa Date: Mon, 6 Feb 2023 14:37:26 +0100 Subject: [PATCH 3/3] Add option to create migrations triggering index --- .../20230203150000-remove-dummy-worship.sparql | 17 ----------------- docker-compose.dev.yml | 2 ++ docker-compose.yml | 10 ++++++++++ 3 files changed, 12 insertions(+), 17 deletions(-) rename config/{migrations => migrations-triggering-indexing}/2023/20230203150000-remove-dummy-worship.sparql (71%) diff --git a/config/migrations/2023/20230203150000-remove-dummy-worship.sparql b/config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql similarity index 71% rename from config/migrations/2023/20230203150000-remove-dummy-worship.sparql rename to config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql index 0f52eec..314c464 100644 --- a/config/migrations/2023/20230203150000-remove-dummy-worship.sparql +++ b/config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql @@ -48,20 +48,3 @@ DELETE { } } } - -# The associated call to trigger a reindex is : - -# curl --location --request POST '172.25.0.34/update' \ -# --header 'Content-Type: application/vnd.api+json' \ -# --data-raw ' [ -# { -# "deletes": [ -# { -# "subject": { "type": "uri", "value": "http://data.lblod.info/id/besturenVanDeEredienst/578bf96f86056e2260dc21cee91aa519" }, -# "predicate": { "type": "uri", "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }, -# "object": { "type": "uri", "value": "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid" } -# } -# ], -# "inserts": [] -# } -# ]' \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 5eecc28..5d68e6d 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -17,6 +17,8 @@ services: volumes: - ./config/dev-migrations:/data/migrations/dev/ restart: "no" + migrations-triggering-indexing: + restart: "no" resource: restart: "no" cache: diff --git a/docker-compose.yml b/docker-compose.yml index ea4f4e7..78d8ac1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,6 +59,16 @@ services: - "logging=true" restart: always logging: *default-logging + migrations-triggering-indexing: + image: semtech/mu-migrations-service:0.8.0 + links: + - db:database + volumes: + - ./config/migrations-triggering-indexing:/data/migrations + labels: + - "logging=true" + restart: always + logging: *default-logging resource: image: semtech/mu-cl-resources:1.21.1 environment: