From cd2b92973ddc8db98fda40ab831a6822763d2cf4 Mon Sep 17 00:00:00 2001 From: Claire Lovisa Date: Mon, 1 Aug 2022 09:39:30 +0200 Subject: [PATCH] Add functionarissen backend --- config/authorization/config.ex | 2 + config/dispatcher/dispatcher.ex | 12 +++++ config/resources/domain.json | 78 +++++++++++++++++++++++++++++++-- 3 files changed, 89 insertions(+), 3 deletions(-) diff --git a/config/authorization/config.ex b/config/authorization/config.ex index 8e97fae..f7a758d 100644 --- a/config/authorization/config.ex +++ b/config/authorization/config.ex @@ -35,6 +35,8 @@ defmodule Acl.UserGroups.Config do "http://www.w3.org/ns/person#Person", "http://data.vlaanderen.be/ns/mandaat#Mandaat", "http://data.vlaanderen.be/ns/mandaat#Mandataris", + "http://data.lblod.info/vocabularies/leidinggevenden/FunctionarisStatusCode", + "http://data.lblod.info/vocabularies/leidinggevenden/Functionaris", "http://data.lblod.info/vocabularies/erediensten/EredienstMandataris", "http://schema.org/ContactPoint", "http://data.lblod.info/vocabularies/leidinggevenden/Bestuursfunctie", diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index 92dd21f..de1a513 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -56,6 +56,18 @@ defmodule Dispatcher do Proxy.forward conn, path, "http://cache/board-positions/" end + match "/board-position-codes/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/board-position-codes/" + end + + match "/agents/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/agents/" + end + + match "/agent-status-codes/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/agent-status-codes/" + end + match "/roles/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://cache/roles/" end diff --git a/config/resources/domain.json b/config/resources/domain.json index f9af760..fbbe46e 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -17,7 +17,7 @@ "generiek": "https://data.vlaanderen.be/ns/generiek#", "mandaat": "http://data.vlaanderen.be/ns/mandaat#", "besluit": "http://data.vlaanderen.be/ns/besluit#", - "lblodlg": "https://data.lblod.info/vocabularies/leidinggevenden/", + "lblodlg": "http://data.lblod.info/vocabularies/leidinggevenden/", "dc_terms": "http://purl.org/dc/terms/", "foaf": "http://xmlns.com/foaf/0.1/", "skos": "http://www.w3.org/2004/02/skos/core#", @@ -57,7 +57,13 @@ "target": "agents-in-position", "cardinality": "many", "inverse": true - } + }, + "agents": { + "predicate": "mandaat:isBestuurlijkeAliasVan", + "target": "agents", + "cardinality": "many", + "inverse": true + }, }, "new-resource-base": "http://data.lblod.info/id/personen/" }, @@ -233,7 +239,7 @@ "relationships": { "role-board": { "predicate": "org:role", - "target": "board-positions", + "target": "board-position-codes", "cardinality": "one" }, "governing-body": { @@ -251,7 +257,73 @@ }, "new-resource-base": "http://data.lblod.info/id/mandaten/" }, + "agents": { + "class": "lblodlg:Functionaris", + "super": ["agents-in-position"], + "attributes": { + "start-date": { + "type": "datetime", + "predicate": "mandaat:start" + }, + "end-date": { + "type": "datetime", + "predicate": "mandaat:einde" + } + }, + "relationships": { + "board-position": { + "predicate": "org:holds", + "target": "board-positions", + "cardinality": "one" + }, + "status": { + "predicate": "mandaat:status", + "target": "agent-status-codes", + "cardinality": "one" + }, + "governing-alias": { + "predicate": "mandaat:isBestuurlijkeAliasVan", + "target": "people", + "cardinality": "one" + } + }, + "new-resource-base": "http://data.lblod.info/id/functionarissen/" + }, + "agent-status-codes": { + "class": "lblodlg:FunctionarisStatusCode", + "attributes": { + "label": { + "type": "string", + "predicate": "skos:prefLabel" + } + }, + "features": ["include-uri"], + "new-resource-base": "http://data.vlaanderen.be/id/concept/functionarisStatusCode/" + }, "board-positions": { + "class": "lblodlg:Bestuursfunctie", + "super": ["posts"], + "relationships": { + "role-board": { + "predicate": "org:role", + "target": "board-position-codes", + "cardinality": "one" + }, + "contact-point": { + "predicate": "schema:contactPoint", + "target": "contact-points", + "cardinality": "one" + }, + "governing-body": { + "predicate": "lblodlg:heeftBestuursfunctie", + "target": "governing-bodies", + "cardinality": "one", + "inverse": true + } + }, + "new-resource-base": "http://data.lblod.info/id/bestuursfuncties/" + }, + "board-position-codes": { "class": "code:BestuursfunctieCode", "attributes": { "label": {