diff --git a/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160204-timed-governing-bodies-gemeente-2025.sparql b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160204-timed-governing-bodies-gemeente-2025.sparql new file mode 100644 index 0000000..deefd6e --- /dev/null +++ b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160204-timed-governing-bodies-gemeente-2025.sparql @@ -0,0 +1,60 @@ +PREFIX besluit: +PREFIX mu: +PREFIX generiek: +PREFIX mandaat: +PREFIX skos: +PREFIX org: +PREFIX regorg: + +INSERT { + GRAPH { + ?timedGoverningBody a besluit:Bestuursorgaan ; + mu:uuid ?timedGoverningBodyUuid ; + generiek:isTijdspecialisatieVan ?governingBody ; + mandaat:bindingStart "2025-01-01T00:00:00"^^xsd:dateTime . + } +} WHERE { + # Note: for municipalities and provinces the graphs differ, splitting this + # WHERE clause in two GRAPH clauses simplifies the generation of these + # migrations. + GRAPH { + ?organization mu:uuid ?organizationUuid ; + org:classification . # Gemeente + } + + GRAPH { + ?governingBody besluit:bestuurt ?organization ; + org:classification ?governingBodyClassification . + + # Only active organizations should get new timed governing bodies + ?organization regorg:orgStatus . # Actief (Eng. Active) + } + + FILTER ( + ?organization + NOT IN + ( # Beveren + , # Borgloon + , # Borsbeek + , # De Pinte + , # Galmaarden + , # Gooik + , # Herne + , # Hoeselt + , # Kortessem + , # Kruibeke + , # Melle + , # Merelbeke + , # Meulebeke + , # Moerbeke + , # Nazareth + , # Ruiselede + , # Tessenderlo + , # Wachtebeke + , # Zwijndrecht + ) + ) + + BIND(SHA256(CONCAT(STR(?governingBodyClassification), " 2025 ", STR(?governingBody), STR(?organizationUuid))) AS ?timedGoverningBodyUuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", STR(?timedGoverningBodyUuid))) AS ?timedGoverningBody) +} diff --git a/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160205-timed-governing-bodies-ocmw-2025.sparql b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160205-timed-governing-bodies-ocmw-2025.sparql new file mode 100644 index 0000000..8995b56 --- /dev/null +++ b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160205-timed-governing-bodies-ocmw-2025.sparql @@ -0,0 +1,60 @@ +PREFIX besluit: +PREFIX mu: +PREFIX generiek: +PREFIX mandaat: +PREFIX skos: +PREFIX org: +PREFIX regorg: + +INSERT { + GRAPH { + ?timedGoverningBody a besluit:Bestuursorgaan ; + mu:uuid ?timedGoverningBodyUuid ; + generiek:isTijdspecialisatieVan ?governingBody ; + mandaat:bindingStart "2025-01-01T00:00:00"^^xsd:dateTime . + } +} WHERE { + # Note: for municipalities and provinces the graphs differ, splitting this + # WHERE clause in two GRAPH clauses simplifies the generation of these + # migrations. + GRAPH { + ?organization mu:uuid ?organizationUuid ; + org:classification . # OCMW + } + + GRAPH { + ?governingBody besluit:bestuurt ?organization ; + org:classification ?governingBodyClassification . + + # Only active organizations should get new timed governing bodies + ?organization regorg:orgStatus . # Actief (Eng. Active) + } + + FILTER ( + ?organization + NOT IN + ( # Beveren + , # Borgloon + , # Borsbeek + , # De Pinte + , # Galmaarden + , # Gooik + , # Herne + , # Hoeselt + , # Kortessem + , # Kruibeke + , # Melle + , # Merelbeke + , # Meulebeke + , # Moerbeke + , # Nazareth + , # Ruiselede + , # Tessenderlo + , # Wachtebeke + , # Zwijndrecht + ) + ) + + BIND(SHA256(CONCAT(STR(?governingBodyClassification), " 2025 ", STR(?governingBody), STR(?organizationUuid))) AS ?timedGoverningBodyUuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", STR(?timedGoverningBodyUuid))) AS ?timedGoverningBody) +} diff --git a/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160206-timed-governing-bodies-district-2025.sparql b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160206-timed-governing-bodies-district-2025.sparql new file mode 100644 index 0000000..1c27560 --- /dev/null +++ b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160206-timed-governing-bodies-district-2025.sparql @@ -0,0 +1,35 @@ +PREFIX besluit: +PREFIX mu: +PREFIX generiek: +PREFIX mandaat: +PREFIX skos: +PREFIX org: +PREFIX regorg: + +INSERT { + GRAPH { + ?timedGoverningBody a besluit:Bestuursorgaan ; + mu:uuid ?timedGoverningBodyUuid ; + generiek:isTijdspecialisatieVan ?governingBody ; + mandaat:bindingStart "2025-01-01T00:00:00"^^xsd:dateTime . + } +} WHERE { + # Note: for municipalities and provinces the graphs differ, splitting this + # WHERE clause in two GRAPH clauses simplifies the generation of these + # migrations. + GRAPH { + ?organization mu:uuid ?organizationUuid ; + org:classification . # District + } + + GRAPH { + ?governingBody besluit:bestuurt ?organization ; + org:classification ?governingBodyClassification . + + # Only active organizations should get new timed governing bodies + ?organization regorg:orgStatus . # Actief (Eng. Active) + } + + BIND(SHA256(CONCAT(STR(?governingBodyClassification), " 2025 ", STR(?governingBody), STR(?organizationUuid))) AS ?timedGoverningBodyUuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", STR(?timedGoverningBodyUuid))) AS ?timedGoverningBody) +} diff --git a/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160207-timed-governing-bodies-provincie-2025.sparql b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160207-timed-governing-bodies-provincie-2025.sparql new file mode 100644 index 0000000..074f97d --- /dev/null +++ b/config/migrations/2024/20240828104739-governing-bodies-mandates-2025-legislation/20240829160207-timed-governing-bodies-provincie-2025.sparql @@ -0,0 +1,35 @@ +PREFIX besluit: +PREFIX mu: +PREFIX generiek: +PREFIX mandaat: +PREFIX skos: +PREFIX org: +PREFIX regorg: + +INSERT { + GRAPH { + ?timedGoverningBody a besluit:Bestuursorgaan ; + mu:uuid ?timedGoverningBodyUuid ; + generiek:isTijdspecialisatieVan ?governingBody ; + mandaat:bindingStart "2025-01-01T00:00:00"^^xsd:dateTime . + } +} WHERE { + # Note: for municipalities and provinces the graphs differ, splitting this + # WHERE clause in two GRAPH clauses simplifies the generation of these + # migrations. + GRAPH { + ?organization mu:uuid ?organizationUuid ; + org:classification . # Provincie + } + + GRAPH { + ?governingBody besluit:bestuurt ?organization ; + org:classification ?governingBodyClassification . + + # Only active organizations should get new timed governing bodies + ?organization regorg:orgStatus . # Actief (Eng. Active) + } + + BIND(SHA256(CONCAT(STR(?governingBodyClassification), " 2025 ", STR(?governingBody), STR(?organizationUuid))) AS ?timedGoverningBodyUuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", STR(?timedGoverningBodyUuid))) AS ?timedGoverningBody) +}