diff --git a/config/authorization/config.ex b/config/authorization/config.ex index 831ee72..2befca8 100644 --- a/config/authorization/config.ex +++ b/config/authorization/config.ex @@ -9,6 +9,7 @@ alias Acl.GroupSpec.GraphCleanup, as: GraphCleanup defmodule Acl.UserGroups.Config do @protected_resource_type [ "http://www.w3.org/ns/org#Organization", + "http://data.vlaanderen.be/ns/besluit#Besluit", "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", @@ -42,6 +43,7 @@ defmodule Acl.UserGroups.Config do "http://lblod.data.gift/vocabularies/organisatie/TypeEredienst", "http://lblod.data.gift/vocabularies/organisatie/HelftVerkiezing", "http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis", + "http://lblod.data.gift/vocabularies/organisatie/VeranderingsgebeurtenisResultaat", "http://lblod.data.gift/vocabularies/organisatie/MandatarisStatusCode", "http://lblod.data.gift/vocabularies/organisatie/BestuurseenheidClassificatieCode", "http://lblod.data.gift/vocabularies/organisatie/TypeBetrokkenheid", diff --git a/config/dev-migrations/20211209101400-mock-change-events.graph b/config/dev-migrations/20211209101400-mock-change-events.graph new file mode 100644 index 0000000..7489cd5 --- /dev/null +++ b/config/dev-migrations/20211209101400-mock-change-events.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/organisatieportaal \ No newline at end of file diff --git a/config/dev-migrations/20211209101400-mock-change-events.ttl b/config/dev-migrations/20211209101400-mock-change-events.ttl new file mode 100644 index 0000000..6eca203 --- /dev/null +++ b/config/dev-migrations/20211209101400-mock-change-events.ttl @@ -0,0 +1,250 @@ +# Notes: +# - current implementation has too many CE's. +# : Actief +# In oprichting +# Niet Actief + +# +# skos:prefLabel "Erkenning niet toegekend" . +# +# skos:prefLabel "Naamswijziging" . +# +# skos:prefLabel "Erkenning toegekend" . +# +# skos:prefLabel "Erkenning opgeheven" . +#concepts:d7bbc0ea17fccf7ea35c552d757c905f +# skos:prefLabel "Samenvoeging" . +# +# skos:prefLabel "Wijziging Gebiedsomschrijving" . + +PREFIX rdf: +PREFIX rdfs: +PREFIX skos: +PREFIX org: +PREFIX mu: +PREFIX xsd: +PREFIX dct: +PREFIX skos: +PREFIX concepts: +PREFIX bestuur: +PREFIX org: +PREFIX rdf: +PREFIX contacthub: +PREFIX xsd: +PREFIX ce: +PREFIX cer: +PREFIX m8g: +PREFIX besluit: +PREFIX eli: +PREFIX foaf: + +#code is a weird prefix but that's how it's called in the domain.json file so I reused it +PREFIX code: + + + +# Extende CE for ZWALM: merger of many kerkraden + + + rdf:type org:ChangeEvent ; + contacthub:typeWijziging concepts:d7bbc0ea17fccf7ea35c552d757c905f ; # Samenvoeging + org:resultingOrganization bestuur:dc32dbe8d1f85999cd39a5c9893a9c7d ; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_1; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_2; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_3; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_4; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_5; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_6; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_7; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_8; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_9; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_10; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_11; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_12; + org:originalOrganization bestuur:dc32dbe8d1f85999cd39a5c9893a9c7d; + org:originalOrganization bestuur:6b910ac3244fb94f6ff2574cd5c91df0; + org:originalOrganization bestuur:cace83d9d7b40b310b43defd0acb9da5; + org:originalOrganization bestuur:3eb0946f3c30eeec932be0cccba15645; + org:originalOrganization bestuur:750db3adf47c16061911818dcbefacc2; + org:originalOrganization bestuur:3c8596af2a8aa4d11a6dcc0d32993c7a; + org:originalOrganization bestuur:57137d40d46aeb342b89ae2d50b127c3; + org:originalOrganization bestuur:9a1ca4b0731d15b683d116fef02f0f9e; + org:originalOrganization bestuur:10ccaccbbfcd79c5fad7fbd3747221a1; + org:originalOrganization bestuur:a6451f9c7503c2b7c56898fe12e97993; + org:originalOrganization bestuur:bbd46776125da4bd88e82e879863bbd6; + org:originalOrganization bestuur:edca1c6822af59d219d3652bd749f7fb; + dct:date "2019-07-15T00:00:00"^^xsd:dateTime ; + m8g:hasFormalFramework ; + dct:description "Opheffing 11 parochies, allen samengevoegd bij de parochie Alle Heiligen Nederzwalm - MB 15 juli 2019" . + + + a besluit:Besluit; + mu:uuid "f2ec4db3-6154-41b4-a5be-e0bc129e98d7"; + eli:date_publication "2019-07-14T00:00:00"^^xsd:dateTime; + foaf:page "https://www.vlaanderen.be/agentschap-binnenlands-bestuur". + +cer:71879559ac2045499def_DUMMY_CER_1 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_1"; + code:resulterendeStatus ; #Actief + org:organization bestuur:dc32dbe8d1f85999cd39a5c9893a9c7d . + +cer:71879559ac2045499def_DUMMY_CER_2 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_2"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:6b910ac3244fb94f6ff2574cd5c91df0 . + +cer:71879559ac2045499def_DUMMY_CER_3 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_3"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:cace83d9d7b40b310b43defd0acb9da5 . + +cer:71879559ac2045499def_DUMMY_CER_4 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_4"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:3eb0946f3c30eeec932be0cccba15645 . + +cer:71879559ac2045499def_DUMMY_CER_5 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_5"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:750db3adf47c16061911818dcbefacc2 . + +cer:71879559ac2045499def_DUMMY_CER_6 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_6"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:3c8596af2a8aa4d11a6dcc0d32993c7a . + +cer:71879559ac2045499def_DUMMY_CER_7 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_7"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:57137d40d46aeb342b89ae2d50b127c3 . + +cer:71879559ac2045499def_DUMMY_CER_8 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_8"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:9a1ca4b0731d15b683d116fef02f0f9e . + +cer:71879559ac2045499def_DUMMY_CER_9 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_9"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:10ccaccbbfcd79c5fad7fbd3747221a1 . + +cer:71879559ac2045499def_DUMMY_CER_10 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_10"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:a6451f9c7503c2b7c56898fe12e97993 . + +cer:71879559ac2045499def_DUMMY_CER_11 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_11"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:bbd46776125da4bd88e82e879863bbd6 . + +cer:71879559ac2045499def_DUMMY_CER_12 + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_12"; + code:resulterendeStatus ; #Niet Actief + org:organization bestuur:edca1c6822af59d219d3652bd749f7fb . + + +# Dummy naamsverandering + + rdf:type org:ChangeEvent ; + mu:uuid "3940cca35440_DUMMY_CE_A" ; + contacthub:typeWijziging concepts:6651dc69b0ae8f7ff9974e8a23db1dec ; # Naamswijziging + org:resultingOrganization bestuur:edca1c6822af59d219d3652bd749f7fb ; + dct:date "2010-01-01T00:00:00"^^xsd:dateTime ; + dct:description "Dummy CE de parochie previously known as something else" ; + m8g:hasFormalFramework ; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_A. + + + a besluit:Besluit; + mu:uuid "db80b68d-c858-4c75-ae27-92b9125881c4"; + eli:date_publication "2010-01-01T00:00:00"^^xsd:dateTime; + foaf:page "https://www.vlaanderen.be/agentschap-binnenlands-bestuur". + +cer:71879559ac2045499def_DUMMY_CER_A + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_A"; + code:resulterendeStatus ; #Actief + org:organization bestuur:edca1c6822af59d219d3652bd749f7fb . + + +#Dummy erkenningen + + rdf:type org:ChangeEvent ; + mu:uuid "3940cca35440_DUMMY_CE_B" ; + contacthub:typeWijziging concepts:3dd7550843eaf18e1fa1ca6c6c3f2610 ; # Erkenning Toegekend + org:resultingOrganization bestuur:edca1c6822af59d219d3652bd749f7fb ; + dct:date "2000-01-01T00:00:00"^^xsd:dateTime ; + dct:description "Dummy CE erkenning toegekend (1)" ; + m8g:hasFormalFramework ; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_B. + + + a besluit:Besluit; + mu:uuid "7151e2ca-21f9-42a9-a657-0bbab6aeec7d"; + eli:date_publication "2000-01-01T00:00:00"^^xsd:dateTime; + foaf:page "https://www.vlaanderen.be/agentschap-binnenlands-bestuur". + +cer:71879559ac2045499def_DUMMY_CER_B + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_B"; + code:resulterendeStatus ; #Actief + org:organization bestuur:edca1c6822af59d219d3652bd749f7fb . + + + + rdf:type org:ChangeEvent ; + mu:uuid "3940cca35440_DUMMY_CE_C" ; + contacthub:typeWijziging concepts:3dd7550843eaf18e1fa1ca6c6c3f2610 ; # Erkenning Toegekend + org:resultingOrganization bestuur:bbd46776125da4bd88e82e879863bbd6 ; + dct:date "2001-01-01T00:00:00"^^xsd:dateTime ; + dct:description "Dummy CE erkenning toegekend (2)"; + m8g:hasFormalFramework ; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_C. + + + a besluit:Besluit; + mu:uuid "3e9b2e03-2888-4397-a2df-bc5a240accc1"; + eli:date_publication "2001-01-01T00:00:00"^^xsd:dateTime; + foaf:page "https://www.vlaanderen.be/agentschap-binnenlands-bestuur". + +cer:71879559ac2045499def_DUMMY_CER_C + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_C"; + code:resulterendeStatus ; #Actief + org:organization bestuur:bbd46776125da4bd88e82e879863bbd6 . + + + + rdf:type org:ChangeEvent ; + mu:uuid "3940cca35440_DUMMY_CE_D" ; + contacthub:typeWijziging concepts:3dd7550843eaf18e1fa1ca6c6c3f2610 ; # Erkenning Toegekend + org:resultingOrganization bestuur:dc32dbe8d1f85999cd39a5c9893a9c7d ; + dct:date "2002-01-01T00:00:00"^^xsd:dateTime ; + dct:description "Dummy CE erkenning toegekend (3)"; + m8g:hasFormalFramework ; + code:veranderingsgebeurtenisResultaat cer:71879559ac2045499def_DUMMY_CER_D. + + + a besluit:Besluit; + mu:uuid "e09c3d9e-9230-4a13-9ba7-83cf1a055a05"; + eli:date_publication "2002-01-01T00:00:00"^^xsd:dateTime; + foaf:page "https://www.vlaanderen.be/agentschap-binnenlands-bestuur". + +cer:71879559ac2045499def_DUMMY_CER_D + a code:VeranderingsgebeurtenisResultaat; + mu:uuid "71879559ac2045499def_DUMMY_CER_D"; + code:resulterendeStatus ; #Actief + org:organization bestuur:dc32dbe8d1f85999cd39a5c9893a9c7d . diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index cc7cce7..fb94483 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -128,6 +128,10 @@ defmodule Dispatcher do Proxy.forward conn, path, "http://cache/change-event-types/" end + match "/change-event-results/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/change-event-results/" + end + match "/organization-status-codes/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://cache/organization-status-codes/" end @@ -186,11 +190,15 @@ defmodule Dispatcher do match "/site-types/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://cache/site-types/" end - + match "/request-reasons/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://cache/request-reasons/" end + match "/decisions/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://cache/decisions/" + end + ############### # LOGIN diff --git a/config/resources/change-events.json b/config/resources/change-events.json new file mode 100644 index 0000000..eb8cc0f --- /dev/null +++ b/config/resources/change-events.json @@ -0,0 +1,104 @@ +{ + "version": "0.1", + "prefixes": { + "ch": "http://data.lblod.info/vocabularies/contacthub/", + "code": "http://lblod.data.gift/vocabularies/organisatie/", + "dc_terms": "http://purl.org/dc/terms/", + "euro": "http://data.europa.eu/m8g/", + "ext": "http://mu.semte.ch/vocabularies/ext/", + "org": "http://www.w3.org/ns/org#", + "regorg": "http://www.w3.org/ns/regorg#", + "skos": "http://www.w3.org/2004/02/skos/core#", + "foaf": "http://xmlns.com/foaf/0.1/" + }, + "resources": { + "change-events": { + "class": "org:ChangeEvent", + "attributes": { + "date": { + "type": "datetime", + "predicate": "dc_terms:date" + }, + "description": { + "type": "string", + "predicate": "dc_terms:description" + } + }, + "relationships": { + "type": { + "predicate": "ch:typeWijziging", + "target": "change-event-types", + "cardinality": "one" + }, + "resulting-organizations": { + "predicate": "org:resultingOrganization", + "target": "organizations", + "cardinality": "many" + }, + "original-organizations": { + "predicate": "org:originalOrganization", + "target": "organizations", + "cardinality": "many" + }, + "results": { + "predicate": "code:veranderingsgebeurtenisResultaat", + "target": "change-event-results", + "cardinality": "many" + }, + "decision": { + "predicate": "http://data.europa.eu/m8g/hasFormalFramework", + "target": "decisions", + "cardinality": "one" + } + }, + "new-resource-base": "http://data.lblod.info/id/veranderingsgebeurtenissen/" + }, + "change-event-results": { + "class": "code:VeranderingsgebeurtenisResultaat", + "attributes": {}, + "relationships": { + "resulting-organization": { + "predicate": "org:organization", + "target": "organizations", + "cardinality": "one" + }, + "status": { + "predicate": "code:resulterendeStatus", + "target": "organization-status-codes", + "cardinality": "one" + }, + "result-from": { + "predicate": "code:veranderingsgebeurtenisResultaat", + "target": "change-events", + "cardinality": "one", + "inverse": true + } + }, + "new-resource-base": "http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/" + }, + "change-event-types": { + "class": "code:Veranderingsgebeurtenis", + "attributes": { + "label": { + "type": "string", + "predicate": "skos:prefLabel" + } + }, + "new-resource-base": "http://lblod.data.gift/concepts/" + }, + "decisions": { + "class": "http://data.vlaanderen.be/ns/besluit#Besluit", + "attributes": { + "publication-date": { + "type": "datetime", + "predicate": "http://data.europa.eu/eli/ontology#date_publication" + }, + "document-link": { + "type": "url", + "predicate": "foaf:page" + } + }, + "new-resource-base": "http://lblod.data.info/id/besluiten/" + } + } +} diff --git a/config/resources/domain.json b/config/resources/domain.json index 0786afe..6e263be 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -299,14 +299,22 @@ "cardinality": "many" }, "changed-by": { - "predicate": "org:changedBy", + "predicate": "org:originalOrganization", "target": "change-events", - "cardinality": "many" + "cardinality": "many", + "inverse": true }, "resulted-from": { - "predicate": "org:resultedFrom", + "predicate": "org:resultingOrganization", "target": "change-events", - "cardinality": "many" + "cardinality": "many", + "inverse": true + }, + "change-event-results": { + "predicate": "org:organization", + "target": "change-event-results", + "cardinality": "many", + "inverse": true }, "positions": { "predicate": "org:hasPost", @@ -628,49 +636,6 @@ }, "new-resource-base": "http://data.lblod.info/id/vestigingen/" }, - "change-events": { - "class": "org:ChangeEvent", - "attributes": { - "date": { - "type": "datetime", - "predicate": "dc_terms:date" - }, - "description": { - "type": "string", - "predicate": "dc_terms:description" - } - }, - "relationships": { - "type": { - "predicate": "ch:typeWijziging", - "target": "change-event-types", - "cardinality": "one" - }, - "resulting-organization": { - "predicate": "org:resultedFrom", - "target": "organizations", - "cardinality": "many", - "inverse": true - }, - "original-organization": { - "predicate": "org:changedBy", - "target": "organizations", - "cardinality": "many", - "inverse": true - } - }, - "new-resource-base": "http://data.lblod.info/id/veranderingsgebeurtenissen/" - }, - "change-event-types": { - "class": "code:Veranderingsgebeurtenis", - "attributes": { - "label": { - "type": "string", - "predicate": "skos:prefLabel" - } - }, - "new-resource-base": "http://lblod.data.gift/concepts/" - }, "concepts": { "class": "skos:Concept", "attributes": { diff --git a/config/resources/domain.lisp b/config/resources/domain.lisp index 964c273..2f6b2a8 100644 --- a/config/resources/domain.lisp +++ b/config/resources/domain.lisp @@ -12,6 +12,7 @@ (read-domain-file "domain.json") (read-domain-file "auth.json") +(read-domain-file "change-events.json") (read-domain-file "files-domain.lisp") (read-domain-file "dcat.json") (read-domain-file "privacy-centric-service.json")