Merge branch 'master' into development

This commit is contained in:
felix
2024-10-28 14:56:32 +01:00
2 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
INSERT {
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?oldVersion mandaat:bindingEinde ?newStartDate .
}
}
WHERE {
VALUES ?orgaanClass {
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/180a2fba-6ca9-4766-9b94-82006bb9c709> #Gouverneur
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e00000c> # Provincieraad
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e00000d> # deputatie
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/4955bd72cd0e4eb895fdbfab08da0284> # Burgemeester
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000005> # gemeenteraad
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000006> # college
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000007> # rmw
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000008> # Vast Bureau
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/53c0d8cd-f3a2-411d-bece-4bd83ae2bbc9> # Voorzitter van het Bijzonder Comité voor de Sociale Dienst
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000009> # Bijzonder Comité voor de Sociale Dienst
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/9314533e-891f-4d84-a492-0338af104065> #districtburgemeester
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e00000a> # Districtsraad
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e00000b> # Districtscollege
}
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?bestuursorgaan besluit:bestuurt ?bestuurseenheid;
skos:prefLabel ?orgaanLabel;
<http://www.w3.org/ns/org#classification> ?orgaanClass.
# Find the bestuursorgaan version without an end date
?oldVersion a besluit:Bestuursorgaan ;
generiek:isTijdspecialisatieVan ?bestuursorgaan ;
mandaat:bindingStart ?oldStartDate .
FILTER NOT EXISTS { ?oldVersion mandaat:bindingEinde ?_ }
# Find newer bestuursorgaan version
?newVersion a besluit:Bestuursorgaan ;
generiek:isTijdspecialisatieVan ?bestuursorgaan ;
mandaat:bindingStart ?newStartDate .
FILTER (?newStartDate > ?oldStartDate)
# Ensure there's no version with an earlier or same start date than the new one
FILTER NOT EXISTS {
?otherVersion a besluit:Bestuursorgaan ;
generiek:isTijdspecialisatieVan ?bestuursorgaan ;
mandaat:bindingStart ?otherStartDate .
FILTER (?otherStartDate > ?oldStartDate && ?otherStartDate < ?newStartDate)
}
}
}

View File

@@ -0,0 +1,38 @@
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
DELETE {
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?orgIntijdNew ?orgIntijdNewP ?orgIntijdNewO.
?bestuursfunctie ?bestuursfunctieP ?bestuursfunctieO.
}
}
WHERE {
VALUES ?class {
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/11f0af9e-016c-4e0b-983a-d8bc73804abc> # "Adjunct-algemeen directeur"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/39854196-f214-4688-87a1-d6ad12baa2fa> # "Algemeen directeur"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/41caf7e6-b040-4720-9cc2-a96cfffed5b4> # "Leidend Ambtenaar"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/62644b9c-4514-41dd-a660-4c35257f2b35> # "Financieel directeu"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/ed40469e-3b6f-4f38-99ba-18912ee352b0> # "Adjunct-financieel directeur"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/3e9f22c1-0d35-445b-8a37-494addedf2d8> # "Financieel beheerder"
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab19107-82d2-4273-a986-3da86fda050d> # Griffier
}
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
?s a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan>;
<http://www.w3.org/ns/org#classification> ?class.
?orgIntijdOld generiek:isTijdspecialisatieVan ?s;
<http://data.vlaanderen.be/ns/mandaat#bindingStart> ?old.
?orgIntijdNew generiek:isTijdspecialisatieVan ?s;
<http://data.vlaanderen.be/ns/mandaat#bindingStart> ?new.
FILTER(?new > ?old)
?orgIntijdNew ?orgIntijdNewP ?orgIntijdNewO.
?orgIntijdNew <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie> ?bestuursfunctie.
?bestuursfunctie ?bestuursfunctieP ?bestuursfunctieO.
}
}