From 2ed45e3a5efc1d9478cbd780a1a6f4d1cb76a66b Mon Sep 17 00:00:00 2001 From: mirdono Date: Mon, 7 Oct 2024 09:05:15 +0200 Subject: [PATCH] refactor: renamed job migrations to include "insert" in the filename Added comments to make it easier to understand query executed by each job. --- ...p-cleanup--insert-worship-linked-to.graph} | 0 ...hip-cleanup--insert-worship-linked-to.ttl} | 8 +++++++ ...insert-worship-has-sub-organization.graph} | 0 ...--insert-worship-has-sub-organization.ttl} | 9 +++++++- ...nsert-province-has-sub-organization.graph} | 0 ...-insert-province-has-sub-organization.ttl} | 13 ++++++++++++ ...t-municipality-has-sub-organization.graph} | 0 ...ert-municipality-has-sub-organization.ttl} | 15 +++++++++++++ ...anup--insert-municipality-linked-to.graph} | 0 ...leanup--insert-municipality-linked-to.ttl} | 13 ++++++++++-- ...ship-cleanup--delete-worship-linked-to.ttl | 8 +++++++ ...p--delete-worship-has-sub-organization.ttl | 7 +++++++ ...cleanup--delete-municipality-linked-to.ttl | 21 +++++++++++++++++++ ...lete-municipality-has-sub-organization.ttl | 15 +++++++++++++ ...--delete-province-has-sub-organization.ttl | 13 ++++++++++++ 15 files changed, 119 insertions(+), 3 deletions(-) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20240930124819-membership-cleanup--worship-linked-to.graph => 20240930124819-membership-cleanup--insert-worship-linked-to.graph} (100%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20240930124819-membership-cleanup--worship-linked-to.ttl => 20240930124819-membership-cleanup--insert-worship-linked-to.ttl} (75%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241001071404-membership-cleanup--worship-has-sub-organization.graph => 20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph} (100%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241001071404-membership-cleanup--worship-has-sub-organization.ttl => 20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl} (74%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241001145338-membership-cleanup--province-has-sub-organization.graph => 20241001145338-membership-cleanup--insert-province-has-sub-organization.graph} (100%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241001145338-membership-cleanup--province-has-sub-organization.ttl => 20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl} (67%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241002092839-membership-cleanup--municipality-has-sub-organization.graph => 20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph} (100%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241002092839-membership-cleanup--municipality-has-sub-organization.ttl => 20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl} (64%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241002092901-membership-cleanup--municipality-linked-to.graph => 20241002092901-membership-cleanup--insert-municipality-linked-to.graph} (100%) rename config/migrations/2024/20240930124819-membership-cleanup-jobs/{20241002092901-membership-cleanup--municipality-linked-to.ttl => 20241002092901-membership-cleanup--insert-municipality-linked-to.ttl} (73%) diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--worship-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.graph similarity index 100% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--worship-linked-to.graph rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.graph diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--worship-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl similarity index 75% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--worship-linked-to.ttl rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl index 1a434b3..1864144 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--worship-linked-to.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl @@ -2,6 +2,14 @@ @prefix mu: . @prefix dcterms: . +# Insert triples of the form: +# +# +# matching memberships for which no such triple exists. + +# Worship Service: +# Central Worship Service: + a cleanup:Job ; mu:uuid "f0f7a304-34e9-4986-bf27-8434bb6f8111" ; dcterms:title "Insert missing `org:linkedTo` triples for Representative Bodies and [Central] Worship Services." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--worship-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph similarity index 100% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--worship-has-sub-organization.graph rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--worship-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl similarity index 74% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--worship-has-sub-organization.ttl rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl index dca61dd..abc781d 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--worship-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl @@ -2,6 +2,13 @@ @prefix mu: . @prefix dcterms: . +# Insert triples of the form: +# +# matching memberships for which no such triple exists. + +# Central Worship Service: +# Worship Service: + a cleanup:Job ; mu:uuid "1352f2c5-0207-435b-9737-26d29769cde6" ; dcterms:title "Insert missing `org:hasSubOrganization` triples for Central Worship Services and Worship Services." ; @@ -19,8 +26,8 @@ org:member ?member ; org:role . - ?member org:classification . ?organization org:classification . + ?member org:classification . FILTER NOT EXISTS { ?organization org:hasSubOrganization ?member . } } diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--province-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.graph similarity index 100% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--province-has-sub-organization.graph rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.graph diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--province-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl similarity index 67% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--province-has-sub-organization.ttl rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl index 4ba9228..1e86454 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--province-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl @@ -2,6 +2,19 @@ @prefix mu: . @prefix dcterms: . +# Insert triples of the form +# +# matching memberships for which no such triple exists. + +# Province: +# +# Municipality: +# OCMW: +# AGB: +# APB: +# PEVA municipality: +# PEVA province: + a cleanup:Job ; mu:uuid "434b8b52-b695-4358-a927-ddaceb22e7e3" ; dcterms:title "Insert missing `org:hasSubOrganization` triples for Provinces." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--municipality-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph similarity index 100% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--municipality-has-sub-organization.graph rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--municipality-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl similarity index 64% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--municipality-has-sub-organization.ttl rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl index 940ac50..96d1563 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--municipality-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl @@ -2,6 +2,21 @@ @prefix mu: . @prefix dcterms: . +# Insert triples of the form +# +# matching memberships for which no such triple exists. + +# Municipality: +# +# AGB: +# Projectvereniging: +# Dientsverlenende vereniging +# Opdrachthoudende vereniging: +# Opdrachthoudende vereniging met private deelname: +# HVZ: +# PZ: +# PEVA municipality: + a cleanup:Job ; mu:uuid "3b7f8739-aa56-4a6c-af56-eb9d80022379" ; dcterms:title "Insert missing `org:hasSubOrganization` triples for Municipalities." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--municipality-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.graph similarity index 100% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--municipality-linked-to.graph rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.graph diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--municipality-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl similarity index 73% rename from config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--municipality-linked-to.ttl rename to config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl index 6ddc59a..8d2ebf9 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--municipality-linked-to.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl @@ -2,6 +2,15 @@ @prefix mu: . @prefix dcterms: . +# Insert triples of the form: +# +# matching memberships for which no such triple exists. + +# Municipality: +# +# OCMW: +# APB: + a cleanup:Job ; mu:uuid "a99bcd5c-9781-425d-8a34-fb11a6e3e262" ; dcterms:title "Insert missing `org:linkedTo` triples for Municipalities." ; @@ -24,8 +33,8 @@ ?member org:classification ?memberClass . FILTER ( ?memberClass IN ( - , - + , + ) ) } diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl index 9dae020..dcf7604 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl @@ -2,6 +2,14 @@ @prefix mu: . @prefix dcterms: . +# Delete triples of the form: +# +# +# for which no matching membership exists. + +# Worship Service: +# Central Worship Service: + a cleanup:Job ; mu:uuid "679eec55-0f69-4d45-84c1-9f73df966983" ; dcterms:title "Delete leftover `org:linkedTo` triples for Representative Bodies and [Central] Worship Services." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl index b807bc9..e19e2f9 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl @@ -2,6 +2,13 @@ @prefix mu: . @prefix dcterms: . +# Delete triples of the form +# +# for which no matching membership exists. + +# Central Worship Service +# Worship Service + a cleanup:Job ; mu:uuid "50cee254-37e4-410e-936a-d974047bdd4b" ; dcterms:title "Delete leftover `org:hasSubOrganization` triples for Central Worship Services and Worship Services." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl index 19b2ef8..7607e02 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl @@ -2,6 +2,15 @@ @prefix mu: . @prefix dcterms: . +# Delete triples of the form: +# +# for which no matching membership exists. + +# Municipality: +# +# OCMW: +# APB: + a cleanup:Job ; mu:uuid "14cfd05c-7047-43a1-97e4-42d3dd6b048d" ; dcterms:title "Delete leftover `org:linkedTo` triples for Municipalities." ; @@ -21,6 +30,18 @@ org:member ?member ; org:role . } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + + + ) + ) + } + GRAPH { + ?municipality org:classification . } } """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl index 9a13f21..a9b203f 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl @@ -2,6 +2,21 @@ @prefix mu: . @prefix dcterms: . +# Delete triples of the form +# +# for which no matching membership exists. + +# Municipality: +# +# AGB: +# Projectvereniging: +# Dientsverlenende vereniging +# Opdrachthoudende vereniging: +# Opdrachthoudende vereniging met private deelname: +# HVZ: +# PZ: +# PEVA municipality: + a cleanup:Job ; mu:uuid "141a5f1c-39d5-431a-99e2-9085252654a3" ; dcterms:title "Delete leftover `org:hasSubOrganization` triples for Municipalities." ; diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl index aa3e0ee..86a5898 100644 --- a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl @@ -2,6 +2,19 @@ @prefix mu: . @prefix dcterms: . +# Delete triples of the form +# +# for which no matching membership exists. + +# Province: +# +# Municipality: +# OCMW: +# AGB: +# APB: +# PEVA municipality: +# PEVA province: + a cleanup:Job ; mu:uuid "7b2f66c8-1433-47f4-b730-62316f288631" ; dcterms:title "Delete leftover `org:hasSubOrganization` triples for Provinces." ;