From 3f37d7ebbc3ae378a5e2eafd4a4034188afc52b7 Mon Sep 17 00:00:00 2001 From: Nordine Bittich <3816305+nbittich@users.noreply.github.com> Date: Mon, 30 Oct 2023 09:05:06 +0100 Subject: [PATCH] Feature/non admin units (#342) --- config/dispatcher/dispatcher.ex | 4 ++ ...0355-add-representative-orgaan-code.sparql | 37 +++++++++++++++++++ ...24090355-add-organization-code-type.sparql | 24 ++++++++++++ config/resources/domain.json | 25 +++++++++++-- config/search/config.json | 3 +- config/search/dev/config.json | 3 +- 6 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 config/migrations/2023/20231023090355-add-representative-orgaan-code.sparql create mode 100644 config/migrations/2023/20231024090355-add-organization-code-type.sparql diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index e71d12d..6e1116c 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -84,6 +84,10 @@ defmodule Dispatcher do Proxy.forward conn, path, "http://cache/administrative-unit-classification-codes/" end + match "/organization-classification-codes/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/organization-classification-codes/" + end + match "/worship-administrative-units/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://resource/worship-administrative-units/" end diff --git a/config/migrations/2023/20231023090355-add-representative-orgaan-code.sparql b/config/migrations/2023/20231023090355-add-representative-orgaan-code.sparql new file mode 100644 index 0000000..0714e5e --- /dev/null +++ b/config/migrations/2023/20231023090355-add-representative-orgaan-code.sparql @@ -0,0 +1,37 @@ +prefix rdf: +prefix skos: +PREFIX org: +PREFIX ere: + +insert data { + graph { + + + rdf:type , skos:Concept ; + "89a00b5a-024f-4630-a722-65a5e68967e5" ; + skos:topConceptOf ; + skos:prefLabel "Representatief orgaan" ; + skos:inScheme . + } +} + +; + + +INSERT { + graph { + + ?representativeBody org:classification . + + } +} +WHERE { + graph { + + ?representativeBody a ere:RepresentatiefOrgaan. + FILTER NOT EXISTS { + ?representativeBody org:classification ?classification. + } + } + +} diff --git a/config/migrations/2023/20231024090355-add-organization-code-type.sparql b/config/migrations/2023/20231024090355-add-organization-code-type.sparql new file mode 100644 index 0000000..3be79e7 --- /dev/null +++ b/config/migrations/2023/20231024090355-add-organization-code-type.sparql @@ -0,0 +1,24 @@ +prefix rdf: +prefix skos: +PREFIX org: +PREFIX ere: + + + +INSERT { + graph ?g { + + ?code a . + + } +} +WHERE { + graph ?g { + + ?code a ?type. + filter (?type in (, + )) + + } + +} diff --git a/config/resources/domain.json b/config/resources/domain.json index f96ae16..5a52006 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -528,14 +528,21 @@ }, "new-resource-base": "http://data.lblod.info/id/bestuurseenheden/" }, - "administrative-unit-classification-codes": { - "class": "code:BestuurseenheidClassificatieCode", + "organization-classification-codes": { + "class": "ext:OrganizationClassificationCode", "attributes": { "label": { "type": "string", "predicate": "skos:prefLabel" } }, + "new-resource-base": "http://data.vlaanderen.be/id/concept/OrganizationClassificationCode/" + }, + "administrative-unit-classification-codes": { + "class": "code:BestuurseenheidClassificatieCode", + "super": [ + "organization-classification-codes" + ], "new-resource-base": "http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/" }, "worship-administrative-units": { @@ -603,6 +610,11 @@ "organizations" ], "relationships": { + "classification": { + "predicate": "org:classification", + "target": "representative-body-classification-codes", + "cardinality": "one" + }, "recognized-worship-type": { "predicate": "ere:typeEredienst", "target": "recognized-worship-types", @@ -617,6 +629,13 @@ }, "new-resource-base": "http://data.lblod.info/id/representatieveOrganen/" }, + "representative-body-classification-codes": { + "class": "ext:RepresentatiefOrgaanClassificatieCode", + "super": [ + "organization-classification-codes" + ], + "new-resource-base": "http://data.vlaanderen.be/id/concept/RepresentatiefOrgaanClassificatieCode/" + }, "governing-bodies": { "class": "besluit:Bestuursorgaan", "attributes": { @@ -1061,4 +1080,4 @@ "new-resource-base": "http://data.relance.lblod.info/id/nace-bel/" } } -} \ No newline at end of file +} diff --git a/config/search/config.json b/config/search/config.json index 14ba8d6..6e56567 100644 --- a/config/search/config.json +++ b/config/search/config.json @@ -760,7 +760,8 @@ "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", "http://data.lblod.info/vocabularies/erediensten/EredienstBestuurseenheid", "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", - "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst" + "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", + "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan" ], "properties": { "name": "http://www.w3.org/2004/02/skos/core#prefLabel", diff --git a/config/search/dev/config.json b/config/search/dev/config.json index 3400e70..13890ba 100644 --- a/config/search/dev/config.json +++ b/config/search/dev/config.json @@ -733,7 +733,8 @@ "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", "http://data.lblod.info/vocabularies/erediensten/EredienstBestuurseenheid", "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", - "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst" + "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", + "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan" ], "properties": { "name": "http://www.w3.org/2004/02/skos/core#prefLabel",