diff --git a/.gitignore b/.gitignore index d6b6a17..3f398c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Virtuoso files /data/db +/data/db.bck/** /data/db/* !/data/db/virtuoso.ini !/data/db/toLoad diff --git a/config/authorization/config.ex b/config/authorization/config.ex index e52cb73..82b2d30 100644 --- a/config/authorization/config.ex +++ b/config/authorization/config.ex @@ -8,70 +8,87 @@ alias Acl.GroupSpec.GraphCleanup, as: GraphCleanup defmodule Acl.UserGroups.Config do - @error_type [ - "https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/core-vocab.html#Error" - ] + @error_type [ + "https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/core-vocab.html#Error" + ] - @protected_resource_type [ - "http://www.w3.org/ns/org#Organization", - "http://data.vlaanderen.be/ns/besluit#Besluit", - "https://data.vlaanderen.be/ns/besluitvorming#Beslissingsactiviteit", - "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", + @worship_type [ + "http://data.lblod.info/vocabularies/erediensten/EredienstMandataris", "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", "http://data.lblod.info/vocabularies/erediensten/EredienstBestuurseenheid", "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", "http://data.lblod.info/vocabularies/erediensten/RolBedienaar", "http://data.lblod.info/vocabularies/erediensten/VoorwaardenBedienaar", - "https://data.vlaanderen.be/ns/persoon#Geboorte", - "http://mu.semte.ch/vocabularies/ext/GeslachtCode", "http://data.lblod.info/vocabularies/erediensten/PositieBedienaar", - "http://www.w3.org/ns/adms#Identifier", - "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator", - "http://www.w3.org/ns/org#ChangeEvent", "http://data.lblod.info/vocabularies/erediensten/BetrokkenLokaleBesturen", "http://data.lblod.info/vocabularies/erediensten/VerbondenJuridischeStructuren", - "http://www.w3.org/ns/prov#Location", - "http://www.w3.org/ns/org#Site", - "http://www.w3.org/ns/locn#Address", - "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", "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan", + ] + + @public_type [ "http://www.w3.org/ns/org#Role", - "http://www.w3.org/ns/org#Post", - "http://data.lblod.info/vocabularies/contacthub/AgentInPositie", + "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", + "http://xmlns.com/foaf/0.1/Person", + "http://xmlns.com/foaf/0.1/OnlineAccount", + "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject", + "http://www.w3.org/ns/dcat#Dataset", + "http://www.w3.org/ns/dcat#Distribution", + "http://www.w3.org/ns/dcat#Catalog", + "http://mu.semte.ch/vocabularies/ext/GeslachtCode", + "http://data.lblod.info/vocabularies/leidinggevenden/FunctionarisStatusCode", "http://lblod.data.gift/vocabularies/organisatie/OrganisatieStatusCode", "http://lblod.data.gift/vocabularies/organisatie/BestuursfunctieCode", "http://lblod.data.gift/vocabularies/organisatie/BestuursorgaanClassificatieCode", - "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/TypeEredienst", + "http://www.w3.org/2004/02/skos/core#ConceptScheme", + "http://lblod.data.gift/vocabularies/organisatie/BedienaarFinanceringCode", + "http://www.w3.org/2004/02/skos/core#Concept", + "http://publications.europa.eu/ontology/euvoc#Country", + "http://lblod.data.gift/vocabularies/organisatie/TypeVestiging", + "http://lblod.data.gift/vocabularies/organisatie/HelftVerkiezing", + "http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis", "http://lblod.data.gift/vocabularies/organisatie/TypeBetrokkenheid", "http://lblod.data.gift/vocabularies/organisatie/VoorwaardenBedienaarCriterium", "http://lblod.data.gift/vocabularies/organisatie/BedienaarCriteriumBewijsstuk", "http://lblod.data.gift/vocabularies/organisatie/EredienstBeroepen", - "http://lblod.data.gift/vocabularies/organisatie/BedienaarFinanceringCode", - "http://lblod.data.gift/vocabularies/organisatie/TypeVestiging", - "http://lblod.data.gift/vocabularies/organisatie/Rechtsvormtype", - "http://www.w3.org/2004/02/skos/core#ConceptScheme", - "http://www.w3.org/2004/02/skos/core#Concept", + "http://lblod.data.gift/vocabularies/organisatie/Rechtsvormtype" + ] + + @org_type [ + "http://www.w3.org/ns/org#Organization", + "http://data.vlaanderen.be/ns/besluit#Besluit", + "https://data.vlaanderen.be/ns/besluitvorming#Beslissingsactiviteit", + "http://www.w3.org/ns/org#Site", + "http://www.w3.org/ns/locn#Address", + "http://www.w3.org/ns/person#Person", + "http://schema.org/ContactPoint", + "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", + "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", + "http://www.w3.org/ns/adms#Identifier", + "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator", + "http://data.vlaanderen.be/ns/mandaat#Mandaat", + "http://data.vlaanderen.be/ns/mandaat#Mandataris", + "http://data.lblod.info/vocabularies/leidinggevenden/Functionaris", + "http://data.lblod.info/vocabularies/leidinggevenden/Bestuursfunctie", + "http://lblod.data.gift/vocabularies/organisatie/VeranderingsgebeurtenisResultaat", + "http://www.w3.org/ns/org#Post", + "http://www.w3.org/ns/org#ChangeEvent", + "http://data.lblod.info/vocabularies/contacthub/AgentInPositie" + ] + + @shared_protected_type [ + "http://www.w3.org/ns/prov#Location", "http://xmlns.com/foaf/0.1/Image", - "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject", - "http://publications.europa.eu/ontology/euvoc#Country" - ] + "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject" + ] + defp access_by_role( group_string ) do %AccessByQuery{ # vars: ["session_group","session_role"], todo we might have to create multiple graph depending on role - vars: [], + vars: [], query: sparql_query_for_access_role( group_string ) } end @@ -80,48 +97,88 @@ defmodule Acl.UserGroups.Config do PREFIX mu: SELECT distinct ?session_group ?session_role WHERE { ext:sessionGroup/mu:uuid ?session_group; - ext:sessionRole ?session_role. + ext:activeSessionRole ?session_role. FILTER( ?session_role = \"#{group_string}\" ) }" end def user_groups do [ - %GroupSpec{ + + %GroupSpec{ name: "acmidm-lezer", useage: [:read], access: access_by_role( "ABBOrganisatiePortaalGebruiker-lezer" ), graphs: [ %GraphSpec{ - graph: "http://mu.semte.ch/graphs/organisatieportaal", + graph: "http://mu.semte.ch/graphs/administrative-unit", constraint: %ResourceConstraint{ - resource_types: @protected_resource_type + resource_types: @org_type } } ] }, - %GroupSpec{ + %GroupSpec{ name: "acmidm-editeerder", useage: [:read, :write, :read_for_write], access: access_by_role( "ABBOrganisatiePortaalGebruiker-editeerder" ), graphs: [ %GraphSpec{ - graph: "http://mu.semte.ch/graphs/organisatieportaal", + graph: "http://mu.semte.ch/graphs/administrative-unit", constraint: %ResourceConstraint{ - resource_types: @protected_resource_type ++ @error_type + resource_types: @org_type ++ @error_type } } ] }, - %GroupSpec{ + %GroupSpec{ name: "acmidm-beheerder", useage: [:read, :write, :read_for_write], access: access_by_role( "ABBOrganisatiePortaalGebruiker-beheerder" ), graphs: [ %GraphSpec{ - graph: "http://mu.semte.ch/graphs/organisatieportaal", + graph: "http://mu.semte.ch/graphs/administrative-unit", constraint: %ResourceConstraint{ - resource_types: @protected_resource_type ++ @error_type + resource_types: @org_type ++ @error_type + } + } + ] + }, + %GroupSpec{ + name: "acmidm-worship-lezer", + useage: [:read], + access: access_by_role( "ABBOrganisatiePortaalErediensten-lezer" ), + graphs: [ + %GraphSpec{ + graph: "http://mu.semte.ch/graphs/worship-service", + constraint: %ResourceConstraint{ + resource_types: @org_type ++ @worship_type + } + } + ] + }, + %GroupSpec{ + name: "acmidm-worship-editeerder", + useage: [:read, :write, :read_for_write], + access: access_by_role( "ABBOrganisatiePortaalErediensten-editeerder" ), + graphs: [ + %GraphSpec{ + graph: "http://mu.semte.ch/graphs/worship-service", + constraint: %ResourceConstraint{ + resource_types: @org_type ++ @error_type ++ @worship_type + } + } + ] + }, + %GroupSpec{ + name: "acmidm-worship-beheerder", + useage: [:read, :write, :read_for_write], + access: access_by_role( "ABBOrganisatiePortaalErediensten-beheerder" ), + graphs: [ + %GraphSpec{ + graph: "http://mu.semte.ch/graphs/worship-service", + constraint: %ResourceConstraint{ + resource_types: @org_type ++ @error_type ++ @worship_type } } ] @@ -130,19 +187,21 @@ defmodule Acl.UserGroups.Config do name: "public", useage: [:read], access: %AlwaysAccessible{}, - graphs: [ %GraphSpec{ - graph: "http://mu.semte.ch/graphs/public", # mock login only + graphs: [ + %GraphSpec{ + graph: "http://mu.semte.ch/graphs/public", constraint: %ResourceConstraint{ - resource_types: [ - "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", - "http://xmlns.com/foaf/0.1/Person", - "http://xmlns.com/foaf/0.1/OnlineAccount", - "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject", - "http://www.w3.org/ns/dcat#Dataset", - "http://www.w3.org/ns/dcat#Distribution", - "http://www.w3.org/ns/dcat#Catalog" - ] - } }]}, + resource_types: @public_type + } + }, + %GraphSpec{ + graph: "http://mu.semte.ch/graphs/shared", + constraint: %ResourceConstraint{ + resource_types: @shared_protected_type ++ @org_type + } + } + + ]}, # // CLEANUP # diff --git a/config/delta-producer/administrative-units/export.json b/config/delta-producer/administrative-units/export.json deleted file mode 100644 index d38b7b0..0000000 --- a/config/delta-producer/administrative-units/export.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "export": [ - { - "type": "http://lblod.data.gift/vocabularies/organisatie/BestuurseenheidClassificatieCode", - "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" - ], - "properties": [ - "http://mu.semte.ch/vocabularies/core/uuid", - "http://www.w3.org/2004/02/skos/core#prefLabel", - "http://www.w3.org/2004/02/skos/core#scopeNote" - ] - }, - { - "type": "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", - "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" - ], - "properties": [ - "http://mu.semte.ch/vocabularies/core/uuid", - "http://www.w3.org/2004/02/skos/core#prefLabel", - "http://www.w3.org/2004/02/skos/core#altLabel", - "http://data.vlaanderen.be/ns/besluit#werkingsgebied", - "http://www.w3.org/ns/org#classification" - ] - }, - { - "type": "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", - "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" - ], - "properties": [ - "http://mu.semte.ch/vocabularies/core/uuid", - "http://www.w3.org/2004/02/skos/core#prefLabel", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#classification", - "http://data.vlaanderen.be/ns/mandaat#bindingEinde", - "http://data.vlaanderen.be/ns/mandaat#bindingStart", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan" - ] - }, - { - "type": "http://lblod.data.gift/vocabularies/organisatie/BestuursorgaanClassificatieCode", - "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" - ], - "properties": [ - "http://mu.semte.ch/vocabularies/core/uuid", - "http://www.w3.org/2004/02/skos/core#prefLabel", - "http://www.w3.org/2004/02/skos/core#scopeNote" - ] - } - ] -} diff --git a/config/delta-producer/dump-file-publisher/config.json b/config/delta-producer/dump-file-publisher/config.json index d8c54f3..42c183f 100644 --- a/config/delta-producer/dump-file-publisher/config.json +++ b/config/delta-producer/dump-file-publisher/config.json @@ -1,20 +1,4 @@ { - "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/administrative-units": { - "dcatDataSetSubject": "http://data.lblod.info/datasets/delta-producer/dumps/AdministrativeUnitsCacheGraphDump", - "targetGraph": "http://redpencil.data.gift/id/deltas/producer/administrative-units", - "fileBaseName": "dump-administrative-units", - "targetDcatGraph": "http://mu.semte.ch/graphs/public", - "targetFilesGraph": "http://mu.semte.ch/graphs/public", - "cleanupOldDumps": true - }, - "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/administrative-units": { - "dcatDataSetSubject": "http://data.lblod.info/datasets/delta-producer/dumps/AdministrativeUnitsCacheGraphDump", - "targetGraph": "http://redpencil.data.gift/id/deltas/producer/administrative-units", - "fileBaseName": "dump-administrative-units", - "targetDcatGraph": "http://mu.semte.ch/graphs/public", - "targetFilesGraph": "http://mu.semte.ch/graphs/public", - "cleanupOldDumps": true - }, "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/organizations": { "dcatDataSetSubject": "http://data.lblod.info/datasets/delta-producer/dumps/OrganizationsCacheGraphDump", "targetGraph": "http://redpencil.data.gift/id/deltas/producer/organizations", @@ -47,7 +31,7 @@ "targetFilesGraph": "http://mu.semte.ch/graphs/public", "cleanupOldDumps": true }, - "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/worship-posts" : { + "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/worship-posts": { "dcatDataSetSubject": "http://data.lblod.info/datasets/delta-producer/dumps/WorshipPostsCacheGraphDump", "targetGraph": "http://redpencil.data.gift/id/deltas/producer/worship-posts", "fileBaseName": "dump-worship-posts", @@ -55,7 +39,7 @@ "targetFilesGraph": "http://mu.semte.ch/graphs/public", "cleanupOldDumps": true }, - "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/worship-posts" : { + "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/worship-posts": { "dcatDataSetSubject": "http://data.lblod.info/datasets/delta-producer/dumps/WorshipPostsCacheGraphDump", "targetGraph": "http://redpencil.data.gift/id/deltas/producer/worship-posts", "fileBaseName": "dump-worship-posts", diff --git a/config/delta-producer/organizations/export.json b/config/delta-producer/organizations/export.json index bb86cfb..510c48b 100644 --- a/config/delta-producer/organizations/export.json +++ b/config/delta-producer/organizations/export.json @@ -3,9 +3,11 @@ { "type": "http://www.w3.org/ns/person#Person", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" ], - "properties": [ + "properties": [ "http://xmlns.com/foaf/0.1/givenName", "http://xmlns.com/foaf/0.1/familyName", "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam", @@ -16,7 +18,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/MandatarisStatusCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -26,7 +28,8 @@ "type": "http://data.lblod.info/vocabularies/erediensten/EredienstMandataris", "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared" ], "properties": [ "http://data.lblod.info/vocabularies/contacthub/startdatum", @@ -46,7 +49,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/HelftVerkiezing", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -55,7 +58,8 @@ { "type": "http://schema.org/ContactPoint", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "http://schema.org/email", @@ -67,7 +71,9 @@ { "type": "http://data.vlaanderen.be/ns/mandaat#Mandaat", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "http://www.w3.org/ns/org#role", @@ -78,7 +84,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/BestuursfunctieCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -87,7 +93,7 @@ { "type": "http://www.w3.org/ns/org#Role", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -96,7 +102,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/BestuurseenheidClassificatieCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -105,7 +111,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/TypeEredienst", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -115,7 +121,8 @@ "type": "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel", @@ -142,7 +149,8 @@ "type": "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel", @@ -166,7 +174,8 @@ "type": "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan", "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel", @@ -187,7 +196,9 @@ "type": "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "http://data.vlaanderen.be/ns/mandaat#bindingEinde", @@ -201,7 +212,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/BestuursorgaanClassificatieCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -210,7 +221,8 @@ { "type": "http://data.lblod.info/vocabularies/erediensten/BetrokkenLokaleBesturen", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://data.lblod.info/vocabularies/erediensten/financieringspercentage", @@ -221,7 +233,9 @@ { "type": "http://www.w3.org/ns/adms#Identifier", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/administrative-unit", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://www.w3.org/2004/02/skos/core#notation", @@ -231,7 +245,9 @@ { "type": "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/administrative-unit", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "https://data.vlaanderen.be/ns/generiek#lokaleIdentificator" @@ -240,7 +256,9 @@ { "type": "http://www.w3.org/ns/locn#Address", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "https://data.vlaanderen.be/ns/adres#Adresvoorstelling.huisnummer", @@ -258,7 +276,8 @@ { "type": "http://www.w3.org/ns/org#Site", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "http://www.w3.org/ns/org#siteAddress", @@ -269,7 +288,8 @@ { "type": "http://www.w3.org/ns/org#ChangeEvent", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ "http://purl.org/dc/terms/date", @@ -282,7 +302,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -291,7 +311,7 @@ { "type": "http://www.w3.org/2004/02/skos/core#Concept", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -300,7 +320,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/OrganisatieStatusCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -309,16 +329,17 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/TypeBetrokkenheid", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" ] }, { - "type": "http://data.lblod.info/vocabularies/erediensten/RolBedienaar", + "type": "http://data.lblod.info/vocabularies/erediensten/RolBedienaar", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://data.lblod.info/vocabularies/contacthub/startdatum", @@ -333,26 +354,30 @@ { "type": "http://data.lblod.info/vocabularies/erediensten/VoorwaardenBedienaar", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://data.lblod.info/vocabularies/erediensten/voldaan", "http://data.lblod.info/vocabularies/erediensten/criterium", "http://data.lblod.info/vocabularies/erediensten/criteriumbewijsstuktype" ] - },{ + }, + { "type": "http://publications.europa.eu/ontology/euvoc#Country", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel", "http://www.w3.org/2000/01/rdf-schema#label" ] - },{ + }, + { "type": "http://data.lblod.info/vocabularies/erediensten/PositieBedienaar", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://www.w3.org/ns/org#role", @@ -364,7 +389,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/EredienstBeroepen", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -373,7 +398,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/BedienaarFinanceringCode", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -382,7 +407,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/VoorwaardenBedienaarCriterium", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -391,7 +416,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/BedienaarCriteriumBewijsstuk", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" @@ -400,7 +425,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/TypeVestiging", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/public" ], "properties": [ "http://www.w3.org/2004/02/skos/core#prefLabel" diff --git a/config/delta-producer/public/export.json b/config/delta-producer/public/export.json index 8a726f9..c298ce4 100644 --- a/config/delta-producer/public/export.json +++ b/config/delta-producer/public/export.json @@ -5,6 +5,7 @@ "type": "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", "strictTypeExport": "true", "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", "http://mu.semte.ch/graphs/worship-service" ], "pathToConceptScheme": [ @@ -35,6 +36,7 @@ "type": "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", "strictTypeExport": "true", "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", "http://mu.semte.ch/graphs/worship-service" ], "pathToConceptScheme": [ @@ -144,7 +146,6 @@ "^http://www.w3.org/ns/org#hasPrimarySite", "http://www.w3.org/ns/org#classification", "http://www.w3.org/2004/02/skos/core#inScheme" - ], "properties": [ "http://mu.semte.ch/vocabularies/core/uuid", @@ -165,7 +166,6 @@ "^http://www.w3.org/ns/org#hasPrimarySite", "http://www.w3.org/ns/org#classification", "http://www.w3.org/2004/02/skos/core#inScheme" - ], "properties": [ "http://mu.semte.ch/vocabularies/core/uuid", @@ -203,7 +203,6 @@ "http://xmlns.com/foaf/0.1/page", "http://schema.org/email", "http://schema.org/telephone" - ] }, { @@ -353,9 +352,7 @@ { "type": "http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis", "graphsFilter": [ - "http://mu.semte.ch/graphs/shared", - "http://mu.semte.ch/graphs/worship-service", - "http://mu.semte.ch/graphs/administrative-unit" + "http://mu.semte.ch/graphs/public" ], "pathToConceptScheme": [ "http://www.w3.org/2004/02/skos/core#inScheme" diff --git a/config/delta-producer/worship-posts/export.json b/config/delta-producer/worship-posts/export.json index 9c4b9ad..0f540bd 100644 --- a/config/delta-producer/worship-posts/export.json +++ b/config/delta-producer/worship-posts/export.json @@ -3,7 +3,8 @@ { "type": "http://data.vlaanderen.be/ns/mandaat#Mandaat", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://mu.semte.ch/vocabularies/core/uuid", @@ -12,36 +13,282 @@ "additionalFilter": "?orgaan ?subject ; / ?bestuurseenheid . ?bestuurseenheid a ?type. FILTER (?type IN (, ))" }, { - "type": "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", - "strictTypeExport": "true", + "type": "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" ], "properties": [ - "http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor" + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#altLabel", + "http://www.w3.org/ns/regorg#orgStatus", + "http://data.lblod.info/vocabularies/erediensten/typeEredienst", + "http://www.w3.org/ns/org#classification", + "http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", + "http://www.w3.org/ns/org#hasPrimarySite", + "http://www.w3.org/ns/org#hasSite", + "http://www.w3.org/ns/adms#identifier", + "http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur" + ], + "additionalFilter": "?subject ?bestuurClassification . FILTER (?bestuurClassification IN (, , , ))" + }, + { + "type": "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", + "graphsFilter": [ + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#altLabel", + "http://www.w3.org/ns/regorg#orgStatus", + "http://data.lblod.info/vocabularies/erediensten/typeEredienst", + "http://www.w3.org/ns/org#classification", + "http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", + "http://www.w3.org/ns/org#hasPrimarySite", + "http://www.w3.org/ns/org#hasSite", + "http://www.w3.org/ns/adms#identifier" + ] + }, + { + "type": "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", + "strictTypeExport": "true", + "graphsFilter": [ + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#altLabel", + "http://www.w3.org/ns/regorg#orgStatus", + "http://data.lblod.info/vocabularies/erediensten/typeEredienst", + "http://www.w3.org/ns/org#classification", + "http://www.w3.org/ns/org#hasPrimarySite", + "http://www.w3.org/ns/org#hasSite", + "http://www.w3.org/ns/adms#identifier" ] }, { "type": "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan", - "strictTypeExport": "true", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://data.vlaanderen.be/ns/besluit#bestuurt", + "http://www.w3.org/ns/org#classification", + "http://data.vlaanderen.be/ns/mandaat#bindingEinde", + "http://data.vlaanderen.be/ns/mandaat#bindingStart", + "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", "http://www.w3.org/ns/org#hasPost" ], - "additionalFilter": "?subject / ?bestuurseenheid . ?bestuurseenheid a ?type. FILTER (?type IN (, ))" + "additionalFilter": "?subject (//)|(/) ?bestuurClassification . FILTER (?bestuurClassification IN (, , , ))" }, { "type": "http://data.lblod.info/vocabularies/erediensten/PositieBedienaar", "graphsFilter": [ - "http://mu.semte.ch/graphs/organisatieportaal" + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" ], "properties": [ "http://mu.semte.ch/vocabularies/core/uuid", "http://www.w3.org/ns/org#role", "http://data.lblod.info/vocabularies/erediensten/functie" ] + }, + { + "type": "http://data.lblod.info/vocabularies/erediensten/BetrokkenLokaleBesturen", + "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://data.lblod.info/vocabularies/erediensten/typebetrokkenheid", + "http://www.w3.org/ns/org#organization" + ] + }, + { + "type": "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan", + "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#altLabel", + "http://www.w3.org/ns/regorg#orgStatus", + "http://www.w3.org/ns/org#hasPrimarySite", + "http://www.w3.org/ns/org#hasSite", + "http://www.w3.org/ns/org#linkedTo", + "http://data.lblod.info/vocabularies/erediensten/typeEredienst", + "http://www.w3.org/ns/adms#identifier" + ] + }, + { + "type": "http://www.w3.org/ns/adms#Identifier", + "graphsFilter": [ + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#notation", + "https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator" + ], + "additionalFilter": "?subject \"KBO nummer\" ." + }, + { + "type": "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator", + "graphsFilter": [ + "http://mu.semte.ch/graphs/worship-service", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/administrative-unit" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "https://data.vlaanderen.be/ns/generiek#lokaleIdentificator" + ], + "additionalFilter": "?subject ^/ \"KBO nummer\" ." + }, + { + "type": "http://www.w3.org/ns/org#Site", + "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "https://data.vlaanderen.be/ns/organisatie#bestaatUit", + "http://data.lblod.info/vocabularies/erediensten/vestigingstype" + ] + }, + { + "type": "http://www.w3.org/ns/locn#Address", + "graphsFilter": [ + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/worship-service" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "https://data.vlaanderen.be/ns/adres#Adresvoorstelling.huisnummer", + "https://data.vlaanderen.be/ns/adres#Adresvoorstelling.busnummer", + "http://www.w3.org/ns/locn#thoroughfare", + "http://www.w3.org/ns/locn#postCode", + "https://data.vlaanderen.be/ns/adres#gemeentenaam", + "http://www.w3.org/ns/locn#adminUnitL2", + "http://www.w3.org/ns/locn#fullAddress" + ], + "additionalFilter": "?subject ^ ?site. ?site a ." + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/BestuurseenheidClassificatieCode", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#scopeNote" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/BestuursorgaanClassificatieCode", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel", + "http://www.w3.org/2004/02/skos/core#scopeNote" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/TypeVestiging", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/OrganisatieStatusCode", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/TypeBetrokkenheid", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/TypeEredienst", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/BestuursfunctieCode", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://lblod.data.gift/vocabularies/organisatie/EredienstBeroepen", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://mu.semte.ch/vocabularies/ext/GeslachtCode", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] + }, + { + "type": "http://publications.europa.eu/ontology/euvoc#Country", + "graphsFilter": [ + "http://mu.semte.ch/graphs/public" + ], + "properties": [ + "http://mu.semte.ch/vocabularies/core/uuid", + "http://www.w3.org/2000/01/rdf-schema#label", + "http://www.w3.org/2004/02/skos/core#prefLabel" + ] } ] } diff --git a/config/delta/rules.js b/config/delta/rules.js index 2b2899f..b502977 100644 --- a/config/delta/rules.js +++ b/config/delta/rules.js @@ -3,7 +3,7 @@ export default [ match: { graph: { type: "uri", - value: "http://mu.semte.ch/graphs/organisatieportaal" + value: "http://mu.semte.ch/graphs/administrative-unit" } }, callback: { @@ -20,7 +20,25 @@ export default [ match: { graph: { type: "uri", - value: "http://mu.semte.ch/graphs/organisatieportaal" + value: "http://mu.semte.ch/graphs/worship-service" + } + }, + callback: { + url: 'http://search/update', + method: 'POST' + }, + options: { + resourceFormat: "v0.0.1", + gracePeriod: 10000, + ignoreFromSelf: true + } + }, + + { + match: { + graph: { + type: "uri", + value: "http://mu.semte.ch/graphs/administrative-unit" } }, callback: { @@ -33,6 +51,25 @@ export default [ ignoreFromSelf: true } }, + + { + match: { + graph: { + type: "uri", + value: "http://mu.semte.ch/graphs/worship-service" + } + }, + callback: { + url: 'http://resource/.mu/delta', + method: 'POST' + }, + options: { + resourceFormat: "v0.0.1", + gracePeriod: 250, + ignoreFromSelf: true + } + }, + { match: { predicate: { @@ -48,42 +85,7 @@ export default [ resourceFormat: 'v0.0.1', gracePeriod: 1000, ignoreFromSelf: true, - optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] - } - }, - { - match: { - }, - callback: { - url: 'http://delta-producer-pub-graph-maintainer-administrative-units/delta', - method: 'POST' - }, - options: { - resourceFormat: 'v0.0.1', - gracePeriod: 1000, - ignoreFromSelf: true, - optOutMuScopeIds: [ - "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", - "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" - ] - } - }, - { - match: { - graph: { - type: 'uri', - value: 'http://redpencil.data.gift/id/deltas/producer/administrative-units' - } - }, - callback: { - url: 'http://delta-producer-json-diff-publisher-administrative-units/delta', - method: 'POST' - }, - options: { - resourceFormat: 'v0.0.1', - gracePeriod: 1000, - ignoreFromSelf: true, - optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"] } }, { @@ -98,9 +100,9 @@ export default [ gracePeriod: 1000, ignoreFromSelf: true, optOutMuScopeIds: [ - "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", - "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" - ] + "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", + "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" + ] } }, { @@ -118,7 +120,7 @@ export default [ resourceFormat: 'v0.0.1', gracePeriod: 1000, ignoreFromSelf: true, - optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"] } }, { @@ -133,9 +135,9 @@ export default [ gracePeriod: 1000, ignoreFromSelf: true, optOutMuScopeIds: [ - "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", - "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" - ] + "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", + "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" + ] } }, { @@ -153,7 +155,7 @@ export default [ resourceFormat: 'v0.0.1', gracePeriod: 1000, ignoreFromSelf: true, - optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"] } }, { @@ -169,9 +171,9 @@ export default [ gracePeriod: 1000, ignoreFromSelf: true, optOutMuScopeIds: [ - "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", - "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" - ] + "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync", + "http://redpencil.data.gift/id/concept/muScope/deltas/publicationGraphMaintenance" + ] } }, { @@ -193,7 +195,7 @@ export default [ resourceFormat: 'v0.0.1', gracePeriod: 1000, ignoreFromSelf: true, - optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"] } } ] diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index a426f37..c4128ef 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -77,7 +77,7 @@ defmodule Dispatcher do end match "/administrative-units/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/administrative-units/" + Proxy.forward conn, path, "http://resource/administrative-units/" end match "/administrative-unit-classification-codes/*path", %{ accept: [:json], layer: :api} do @@ -85,7 +85,7 @@ defmodule Dispatcher do end match "/worship-administrative-units/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/worship-administrative-units/" + Proxy.forward conn, path, "http://resource/worship-administrative-units/" end match "/worship-services/*path", %{ accept: [:json], layer: :api} do @@ -220,11 +220,14 @@ defmodule Dispatcher do ############### match "/accounts", %{ accept: [:json], layer: :api} do - Proxy.forward conn, [], "http://resource/accounts/" + Proxy.forward conn, [], "http://resource/accounts/" end match "/accounts/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://accountdetail/accounts/" end + match "/active-role/*path", %{ accept: [:json], layer: :api} do + Proxy.forward conn, path, "http://roles/" + end match "/groups/*path", %{ accept: [:json], layer: :api} do Proxy.forward conn, path, "http://resource/groups/" end @@ -242,7 +245,7 @@ defmodule Dispatcher do ############################################################### match "/search/*path", %{ accept: %{ json: true }, layer: :api_services} do - IO.puts("hey") + IO.puts("hey") Proxy.forward conn, path, "http://search/" end @@ -262,20 +265,36 @@ defmodule Dispatcher do forward conn, path, "http://adressenregister/" end + match "/worship/person-information-updates/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://privacy-worship/person-information-updates" + end + + match "/worship/person-information-requests/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://privacy-worship/person-information-requests" + end + + match "/worship/person-information-ask/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://privacy-worship/person-information-ask/" + end + + match "/worship/person-information-validate-ssn/*path", %{ layer: :api_services, accept: %{ json: true } } do + forward conn, path, "http://privacy-worship/person-information-validate-ssn/" + end + match "/person-information-updates/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://privacy/person-information-updates" + forward conn, path, "http://privacy-unit/person-information-updates" end match "/person-information-requests/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://privacy/person-information-requests" + forward conn, path, "http://privacy-unit/person-information-requests" end match "/person-information-ask/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://privacy/person-information-ask/" + forward conn, path, "http://privacy-unit/person-information-ask/" end match "/person-information-validate-ssn/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://privacy/person-information-validate-ssn/" + forward conn, path, "http://privacy-unit/person-information-validate-ssn/" end get "/uri-info/*path", %{ layer: :api_services, accept: %{ json: true } } do @@ -303,7 +322,7 @@ defmodule Dispatcher do end get "/files/*path" , %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://cache/files/" + Proxy.forward conn, path, "http://resource/files/" end ################################################################# @@ -311,11 +330,11 @@ defmodule Dispatcher do ################################################################# get "/datasets/*path", %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://cache/datasets/" + Proxy.forward conn, path, "http://resource/datasets/" end get "/distributions/*path", %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://cache/distributions/" + Proxy.forward conn, path, "http://resource/distributions/" end diff --git a/config/loket-consumer/leidinggevenden-dispatching/config.js b/config/loket-consumer/leidinggevenden-dispatching/config.js index e280733..2afb525 100644 --- a/config/loket-consumer/leidinggevenden-dispatching/config.js +++ b/config/loket-consumer/leidinggevenden-dispatching/config.js @@ -7,7 +7,7 @@ const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_AT const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000); const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000); const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000); -const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/organisatieportaal`; +const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`; if (!process.env.FILE_SYNC_GRAPH) @@ -26,4 +26,4 @@ module.exports = { SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION, INGEST_GRAPH, FILE_SYNC_GRAPH -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/leidinggevenden-dispatching/delta-sync-dispatching.js b/config/loket-consumer/leidinggevenden-dispatching/delta-sync-dispatching.js index c8d8ba1..669895b 100644 --- a/config/loket-consumer/leidinggevenden-dispatching/delta-sync-dispatching.js +++ b/config/loket-consumer/leidinggevenden-dispatching/delta-sync-dispatching.js @@ -1,13 +1,10 @@ -const { transformStatements, batchedDbUpdate, partition, deleteFromAllGraphs } = require('./util'); -const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, - DIRECT_DATABASE_ENDPOINT, - MU_CALL_SCOPE_ID_INITIAL_SYNC, +const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util'); +const { BATCH_SIZE, MAX_DB_RETRY_ATTEMPTS, SLEEP_BETWEEN_BATCHES, SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - INGEST_GRAPH, - FILE_SYNC_GRAPH + INGEST_GRAPH } = require('./config'); /** @@ -34,43 +31,40 @@ async function dispatch(lib, data) { const insertStatements = inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`); if (deleteStatements.length) { - await transformStatements(fetch, deleteStatements).then( - transformedStatements => { - deleteFromAllGraphs( - muAuthSudo.updateSudo, - transformedStatements, - { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, - process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - ); - } - ) + const transformedStatementsToDelete = await transformStatements(fetch, deleteStatements); + if (transformedStatementsToDelete.length) { + await deleteFromAllGraphs( + muAuthSudo.updateSudo, + transformedStatementsToDelete, + { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, + process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION, + ); + } } - if (insertStatements.length) { - await transformStatements(fetch, insertStatements).then( - transformedStatements => { - batchedDbUpdate( - muAuthSudo.updateSudo, - INGEST_GRAPH, - transformedStatements, - { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, - process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - "INSERT" - ); - } - ) + const transformedStatementsToInsert = await transformStatements(fetch, insertStatements); + if (transformedStatementsToInsert.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + INGEST_GRAPH, + transformedStatementsToInsert, + { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, + process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION, + "INSERT" + ); + } } } } module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/leidinggevenden-dispatching/initial-sync-dispatching.js b/config/loket-consumer/leidinggevenden-dispatching/initial-sync-dispatching.js index 88017c1..7967073 100644 --- a/config/loket-consumer/leidinggevenden-dispatching/initial-sync-dispatching.js +++ b/config/loket-consumer/leidinggevenden-dispatching/initial-sync-dispatching.js @@ -1,4 +1,4 @@ -const { transformStatements, batchedDbUpdate, partition } = require('./util'); +const { transformStatements, batchedDbUpdate } = require('./util'); const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, DIRECT_DATABASE_ENDPOINT, MU_CALL_SCOPE_ID_INITIAL_SYNC, @@ -6,8 +6,7 @@ const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, MAX_DB_RETRY_ATTEMPTS, SLEEP_BETWEEN_BATCHES, SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - INGEST_GRAPH, - FILE_SYNC_GRAPH + INGEST_GRAPH } = require('./config'); const endpoint = BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES ? DIRECT_DATABASE_ENDPOINT : process.env.MU_SPARQL_ENDPOINT; @@ -36,24 +35,23 @@ async function dispatch(lib, data) { if (termObjects.length) { originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`) - await transformStatements(fetch, originalInsertTriples).then( - transformedInsertTriples => { - batchedDbUpdate( - muAuthSudo.updateSudo, - INGEST_GRAPH, - transformedInsertTriples, - { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, - endpoint, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION - ) - } - ) + const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples); + if (transformedStatementsToInsert.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + INGEST_GRAPH, + transformedStatementsToInsert, + { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, + endpoint, + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION + ); + } } } module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/leidinggevenden-dispatching/util.js b/config/loket-consumer/leidinggevenden-dispatching/util.js index ff3932f..bdf477b 100644 --- a/config/loket-consumer/leidinggevenden-dispatching/util.js +++ b/config/loket-consumer/leidinggevenden-dispatching/util.js @@ -150,4 +150,4 @@ module.exports = { deleteFromAllGraphs, partition, transformStatements -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/mandate-dispatching/config.js b/config/loket-consumer/mandate-dispatching/config.js index e280733..2afb525 100644 --- a/config/loket-consumer/mandate-dispatching/config.js +++ b/config/loket-consumer/mandate-dispatching/config.js @@ -7,7 +7,7 @@ const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_AT const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000); const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000); const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000); -const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/organisatieportaal`; +const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`; if (!process.env.FILE_SYNC_GRAPH) @@ -26,4 +26,4 @@ module.exports = { SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION, INGEST_GRAPH, FILE_SYNC_GRAPH -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/mandate-dispatching/delta-sync-dispatching.js b/config/loket-consumer/mandate-dispatching/delta-sync-dispatching.js index c8d8ba1..669895b 100644 --- a/config/loket-consumer/mandate-dispatching/delta-sync-dispatching.js +++ b/config/loket-consumer/mandate-dispatching/delta-sync-dispatching.js @@ -1,13 +1,10 @@ -const { transformStatements, batchedDbUpdate, partition, deleteFromAllGraphs } = require('./util'); -const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, - DIRECT_DATABASE_ENDPOINT, - MU_CALL_SCOPE_ID_INITIAL_SYNC, +const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util'); +const { BATCH_SIZE, MAX_DB_RETRY_ATTEMPTS, SLEEP_BETWEEN_BATCHES, SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - INGEST_GRAPH, - FILE_SYNC_GRAPH + INGEST_GRAPH } = require('./config'); /** @@ -34,43 +31,40 @@ async function dispatch(lib, data) { const insertStatements = inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`); if (deleteStatements.length) { - await transformStatements(fetch, deleteStatements).then( - transformedStatements => { - deleteFromAllGraphs( - muAuthSudo.updateSudo, - transformedStatements, - { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, - process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - ); - } - ) + const transformedStatementsToDelete = await transformStatements(fetch, deleteStatements); + if (transformedStatementsToDelete.length) { + await deleteFromAllGraphs( + muAuthSudo.updateSudo, + transformedStatementsToDelete, + { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, + process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION, + ); + } } - if (insertStatements.length) { - await transformStatements(fetch, insertStatements).then( - transformedStatements => { - batchedDbUpdate( - muAuthSudo.updateSudo, - INGEST_GRAPH, - transformedStatements, - { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, - process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - "INSERT" - ); - } - ) + const transformedStatementsToInsert = await transformStatements(fetch, insertStatements); + if (transformedStatementsToInsert.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + INGEST_GRAPH, + transformedStatementsToInsert, + { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, + process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION, + "INSERT" + ); + } } } } module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/mandate-dispatching/initial-sync-dispatching.js b/config/loket-consumer/mandate-dispatching/initial-sync-dispatching.js index 88017c1..152abda 100644 --- a/config/loket-consumer/mandate-dispatching/initial-sync-dispatching.js +++ b/config/loket-consumer/mandate-dispatching/initial-sync-dispatching.js @@ -1,4 +1,4 @@ -const { transformStatements, batchedDbUpdate, partition } = require('./util'); +const { transformStatements, batchedDbUpdate } = require('./util'); const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, DIRECT_DATABASE_ENDPOINT, MU_CALL_SCOPE_ID_INITIAL_SYNC, @@ -6,8 +6,7 @@ const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, MAX_DB_RETRY_ATTEMPTS, SLEEP_BETWEEN_BATCHES, SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - INGEST_GRAPH, - FILE_SYNC_GRAPH + INGEST_GRAPH } = require('./config'); const endpoint = BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES ? DIRECT_DATABASE_ENDPOINT : process.env.MU_SPARQL_ENDPOINT; @@ -36,24 +35,23 @@ async function dispatch(lib, data) { if (termObjects.length) { originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`) - await transformStatements(fetch, originalInsertTriples).then( - transformedInsertTriples => { - batchedDbUpdate( - muAuthSudo.updateSudo, - INGEST_GRAPH, - transformedInsertTriples, - { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, - endpoint, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION - ) - } - ) + const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples); + if (transformedStatementsToInsert.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + INGEST_GRAPH, + transformedStatementsToInsert, + { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, + endpoint, + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION + ) + } } } module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/mandate-dispatching/util.js b/config/loket-consumer/mandate-dispatching/util.js index ff3932f..bdf477b 100644 --- a/config/loket-consumer/mandate-dispatching/util.js +++ b/config/loket-consumer/mandate-dispatching/util.js @@ -150,4 +150,4 @@ module.exports = { deleteFromAllGraphs, partition, transformStatements -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/positions-dispatching/config.js b/config/loket-consumer/positions-dispatching/config.js index 911277b..ab34eca 100644 --- a/config/loket-consumer/positions-dispatching/config.js +++ b/config/loket-consumer/positions-dispatching/config.js @@ -1,18 +1,32 @@ const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100; -const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync'; -const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false; -const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://virtuoso:8890/sparql'; +const MU_CALL_SCOPE_ID_INITIAL_SYNC = + process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || + "http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync"; +const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = + process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == "true" ? true : false; +const DIRECT_DATABASE_ENDPOINT = + process.env.DIRECT_DATABASE_ENDPOINT || "http://virtuoso:8890/sparql"; const MAX_DB_RETRY_ATTEMPTS = parseInt(process.env.MAX_DB_RETRY_ATTEMPTS || 5); -const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_ATTEMPTS || 5); -const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000); -const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000); -const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000); -const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/organisatieportaal`; -const PRIVACY_SENSITIVE_GRAPH = process.env.PRIVACY_SENSITIVE_GRAPH || `http://mu.semte.ch/graphs/privacy-centric-graph`; -const UNFILTERED_MAPPING = 'main'; -const MAIN_INFO_MAPPING = 'main-info'; -const PRIVATE_INFO_MAPPING = 'private-info'; - +const MAX_REASONING_RETRY_ATTEMPTS = parseInt( + process.env.MAX_REASONING_RETRY_ATTEMPTS || 5 +); +const SLEEP_BETWEEN_BATCHES = parseInt( + process.env.SLEEP_BETWEEN_BATCHES || 1000 +); +const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt( + process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000 +); +const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt( + process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000 +); +const INGEST_GRAPH = + process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/worship-service`; +const PRIVACY_SENSITIVE_GRAPH = + process.env.PRIVACY_SENSITIVE_GRAPH || + `http://mu.semte.ch/graphs/worship-privacy-centric-graph`; +const UNFILTERED_MAPPING = "main"; +const MAIN_INFO_MAPPING = "main-info"; +const PRIVATE_INFO_MAPPING = "private-info"; if (!process.env.FILE_SYNC_GRAPH) throw `Expected 'FILE_SYNC_GRAPH' to be provided.`; @@ -33,4 +47,5 @@ module.exports = { UNFILTERED_MAPPING, MAIN_INFO_MAPPING, PRIVATE_INFO_MAPPING, -}; \ No newline at end of file + FILE_SYNC_GRAPH, +}; diff --git a/config/loket-consumer/positions-dispatching/delta-sync-dispatching.js b/config/loket-consumer/positions-dispatching/delta-sync-dispatching.js index d826b2e..5384005 100644 --- a/config/loket-consumer/positions-dispatching/delta-sync-dispatching.js +++ b/config/loket-consumer/positions-dispatching/delta-sync-dispatching.js @@ -1,4 +1,4 @@ -const { transformStatements, batchedDbUpdate, partition, deleteFromAllGraphs } = require('./util'); +const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util'); const { BATCH_SIZE, MAX_DB_RETRY_ATTEMPTS, @@ -72,7 +72,7 @@ async function dispatch(lib, data) { PRIVACY_SENSITIVE_GRAPH, transformedStatementsToInsertPrivate, { 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' }, - process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth + process.env.MU_SPARQL_ENDPOINT, // Note: this is the default endpoint through auth BATCH_SIZE, MAX_DB_RETRY_ATTEMPTS, SLEEP_BETWEEN_BATCHES, @@ -85,4 +85,4 @@ async function dispatch(lib, data) { module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/positions-dispatching/initial-sync-dispatching.js b/config/loket-consumer/positions-dispatching/initial-sync-dispatching.js index f5fedc8..86f34b7 100644 --- a/config/loket-consumer/positions-dispatching/initial-sync-dispatching.js +++ b/config/loket-consumer/positions-dispatching/initial-sync-dispatching.js @@ -38,43 +38,38 @@ async function dispatch(lib, data) { if (termObjects.length) { originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`) - await transformStatements(fetch, originalInsertTriples, MAIN_INFO_MAPPING).then( - transformedInsertTriples => { - if (transformedInsertTriples.length) { - batchedDbUpdate( - muAuthSudo.updateSudo, - INGEST_GRAPH, - transformedInsertTriples, - { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, - endpoint, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION - ) - } - } - ); - await transformStatements(fetch, originalInsertTriples, PRIVATE_INFO_MAPPING).then( - transformedInsertTriples => { - if (transformedInsertTriples.length) { - batchedDbUpdate( - muAuthSudo.updateSudo, - PRIVACY_SENSITIVE_GRAPH, - transformedInsertTriples, - { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, - endpoint, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION - ) - } - } - ); + const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples, MAIN_INFO_MAPPING); + if (transformedStatementsToInsert.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + INGEST_GRAPH, + transformedStatementsToInsert, + { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, + endpoint, + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION + ); + } + + const transformedStatementsToInsertPrivate = await transformStatements(fetch, originalInsertTriples, PRIVATE_INFO_MAPPING); + if (transformedStatementsToInsertPrivate.length) { + await batchedDbUpdate( + muAuthSudo.updateSudo, + PRIVACY_SENSITIVE_GRAPH, + transformedStatementsToInsertPrivate, + { 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC }, + endpoint, + BATCH_SIZE, + MAX_DB_RETRY_ATTEMPTS, + SLEEP_BETWEEN_BATCHES, + SLEEP_TIME_AFTER_FAILED_DB_OPERATION + ); + } } } module.exports = { dispatch -}; \ No newline at end of file +}; diff --git a/config/loket-consumer/positions-dispatching/util.js b/config/loket-consumer/positions-dispatching/util.js index ce38369..f6411a2 100644 --- a/config/loket-consumer/positions-dispatching/util.js +++ b/config/loket-consumer/positions-dispatching/util.js @@ -151,4 +151,4 @@ module.exports = { deleteFromAllGraphs, partition, transformStatements -}; \ No newline at end of file +}; diff --git a/config/migrations-triggering-indexing/2023/20230202100000-delete-mandatarissen.sparql b/config/migrations-triggering-indexing/2023/20230202100000-delete-mandatarissen.sparql new file mode 100644 index 0000000..2d05f67 --- /dev/null +++ b/config/migrations-triggering-indexing/2023/20230202100000-delete-mandatarissen.sparql @@ -0,0 +1,33 @@ +PREFIX org: +PREFIX locn: +PREFIX schema: + +DELETE { + GRAPH { + + ?mandatarissen ?pMandatarissen ?oMandatarissen . + ?contactPoint ?pContactPoint ?oContactPoint . + ?address ?pAddress ?oAddress . + + } +} +WHERE { + GRAPH { + + VALUES ?mandatarissen { + + + } + + ?mandatarissen ?pMandatarissen ?oMandatarissen . + + OPTIONAL { + ?mandatarissen schema:contactPoint ?contactPoint . + ?contactPoint ?pContactPoint ?oContactPoint. + OPTIONAL { + ?contactPoint locn:address ?address . + ?address ?pAddress ?oAddress . + } + } + } +} \ No newline at end of file diff --git a/config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql b/config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql new file mode 100644 index 0000000..314c464 --- /dev/null +++ b/config/migrations-triggering-indexing/2023/20230203150000-remove-dummy-worship.sparql @@ -0,0 +1,50 @@ +PREFIX org: +PREFIX adms: +PREFIX generiek: +PREFIX organisatie: + +DELETE { + GRAPH { + ?bestuur ?pbestuur ?obestuur . + ?primarySite ?pprimarySite ?oprimarySite . + ?address ?paddress ?oaddress . + ?contactPoint ?pcontactPoint ?ocontactPoint . + ?identifier ?pidentifier ?oidentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } +} WHERE { + GRAPH { + BIND( as ?bestuur) + + ?bestuur ?pbestuur ?obestuur . + + OPTIONAL { + + ?bestuur org:hasPrimarySite ?primarySite . + + OPTIONAL { + ?primarySite organisatie:bestaatUit ?address . + ?address ?paddress ?oaddress . + } + OPTIONAL { + ?primarySite org:siteAddress ?contactPoint . + ?contactPoint ?pcontactPoint ?ocontactPoint . + } + + ?primarySite ?pprimarySite ?oprimarySite . + + } + OPTIONAL { + + ?bestuur adms:identifier ?identifier . + + OPTIONAL { + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } + + ?identifier ?pidentifier ?oidentifier . + + } + } +} diff --git a/config/migrations/2023/20230124100000-delete-person-mandatarissen.sparql b/config/migrations/2023/20230124100000-delete-person-mandatarissen.sparql new file mode 100644 index 0000000..9deef26 --- /dev/null +++ b/config/migrations/2023/20230124100000-delete-person-mandatarissen.sparql @@ -0,0 +1,59 @@ +PREFIX mandaat: +PREFIX schema: +PREFIX locn: +PREFIX org: + +DELETE { + GRAPH { + ?mandatarissen ?pMandatarissen ?oMandatarissen . + ?mandaat ?pMandaat ?oMandaat . + ?person ?pPerson ?oPerson . + ?contactPoint ?pContactPoint ?oContactPoint . + ?address ?pAddress ?oAddress . + } +} WHERE { + GRAPH { + VALUES ?mandatarissen { + #1 + #2 + } + + ?mandatarissen org:holds ?mandaat ; + mandaat:isBestuurlijkeAliasVan ?person ; + ?pMandatarissen ?oMandatarissen . + + OPTIONAL { + ?mandatarissen schema:contactPoint ?contactPoint . + OPTIONAL { + ?contactPoint locn:address ?address ; + ?pContactPoint ?oContactPoint . + ?address ?pAddress ?oAddress . + } + } + + ?person ?pPerson ?oPerson . + ?mandaat ?pMandaat ?oMandaat . + } +} + +# An associated call to trigger a reindex is: + +# curl --location --request POST '172.32.0.21/update' \ +# --header 'Content-Type: application/vnd.api+json' \ +# --data-raw ' [ +# { +# "deletes": [ +# { +# "subject": { "type": "uri", "value": "http://data.lblod.info/id/mandatarissen/807a3e07c95fe40962d64695069af946" }, +# "predicate": { "type": "uri", "value": "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan" }, +# "object": { "type": "uri", "value": "http://data.lblod.info/id/personen/620523C451BFC225E4ECFA97" } +# }, +# { +# "subject": { "type": "uri", "value": "http://data.lblod.info/id/mandatarissen/40ed3cb19f9fa33e47b39016780dce1d" }, +# "predicate": { "type": "uri", "value": "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan" }, +# "object": { "type": "uri", "value": "http://data.lblod.info/id/personen/620523C451BFC225E4ECFA97" } +# } +# ], +# "inserts": [] +# } +# ]' \ No newline at end of file diff --git a/config/migrations/2023/20230125140612-add-missing-governing-body.sparql b/config/migrations/2023/20230125140612-add-missing-governing-body.sparql new file mode 100644 index 0000000..2eb46bb --- /dev/null +++ b/config/migrations/2023/20230125140612-add-missing-governing-body.sparql @@ -0,0 +1,35 @@ +PREFIX mu: +PREFIX org: +PREFIX besluit: +PREFIX generiek: + +# OP-2070 +INSERT DATA { + GRAPH { + + a ; + mu:uuid "56c71a29-bff0-4b67-804d-2c98fd4bd10f"; + besluit:bestuurt ; + org:classification . + a ; + mu:uuid "54f16d44-2f2c-45df-83c1-5a9fbe4756ca"; + generiek:isTijdspecialisatieVan . + } +} + +; + +# OP-2084 + +INSERT DATA { + GRAPH { + + a ; + mu:uuid "1179426b-69d4-4974-8aa2-c4d46a22c9cc"; + besluit:bestuurt ; + org:classification . + a ; + mu:uuid "b3db6a8d-d6cb-4b78-af87-b80dfda580c7"; + generiek:isTijdspecialisatieVan . + } +} diff --git a/config/migrations/2023/20230131100000-add-city-change-event.sparql b/config/migrations/2023/20230131100000-add-city-change-event.sparql new file mode 100644 index 0000000..aeee525 --- /dev/null +++ b/config/migrations/2023/20230131100000-add-city-change-event.sparql @@ -0,0 +1,26 @@ +PREFIX rdf: +PREFIX org: +PREFIX mu: +PREFIX ext: +PREFIX ch: +PREFIX code: + +INSERT DATA { + GRAPH { + + + rdf:type code:VeranderingsgebeurtenisResultaat; + mu:uuid "0b2f1b62-a15d-11ed-a8fc-0242ac120002" ; + code:resulterendeStatus ; + ext:resultingOrganization . + + + rdf:type org:ChangeEvent ; + mu:uuid "63D7E7E07A8167ED439EC88E" ; + ch:typeWijziging ; + org:resultingOrganization ; + org:originalOrganization ; + code:veranderingsgebeurtenisResultaat . + + } +} diff --git a/config/migrations/2023/20230131172200-delete-region.sparql b/config/migrations/2023/20230131172200-delete-region.sparql new file mode 100644 index 0000000..2c549fb --- /dev/null +++ b/config/migrations/2023/20230131172200-delete-region.sparql @@ -0,0 +1,25 @@ +PREFIX rdf: +PREFIX besluit: +PREFIX geo: + +DELETE { + GRAPH { + + ?werkingsgebied geo:sfWithin ?locatie . + + } +} WHERE { + GRAPH { + + VALUES ?bestuurseenheid { + # OP-2033 + # OP-1994 + } + + ?bestuurseenheid rdf:type besluit:Bestuurseenheid ; + besluit:werkingsgebied ?werkingsgebied . + + ?werkingsgebied geo:sfWithin ?locatie . + + } +} \ No newline at end of file diff --git a/config/migrations/2023/20230202100000-change-kbo-number.sparql b/config/migrations/2023/20230202100000-change-kbo-number.sparql new file mode 100644 index 0000000..a63d2e1 --- /dev/null +++ b/config/migrations/2023/20230202100000-change-kbo-number.sparql @@ -0,0 +1,18 @@ +PREFIX generiek: + +DELETE { + GRAPH ?g { + + generiek:lokaleIdentificator ?kbo . + } +} INSERT { + GRAPH ?g { + + generiek:lokaleIdentificator "0655698422" . + } +} WHERE { + GRAPH ?g { + + generiek:lokaleIdentificator ?kbo . + } +} \ No newline at end of file diff --git a/config/migrations/2023/20230213113324-add-new-codelist.sparql b/config/migrations/2023/20230213113324-add-new-codelist.sparql new file mode 100644 index 0000000..ca4a6d3 --- /dev/null +++ b/config/migrations/2023/20230213113324-add-new-codelist.sparql @@ -0,0 +1,18 @@ + +PREFIX org: +PREFIX ere: +PREFIX skos: +PREFIX mu: + + +INSERT DATA { + graph { + a ; + mu:uuid "7d8e0c15-7726-4196-9416-6dc40ed858bb"; + skos:prefLabel "Waarnemende Imam"; + ; + . + } +} + + diff --git a/config/migrations/2023/20230214163952-clear-admin-unit-producer-data.sparql b/config/migrations/2023/20230214163952-clear-admin-unit-producer-data.sparql new file mode 100644 index 0000000..e5938f6 --- /dev/null +++ b/config/migrations/2023/20230214163952-clear-admin-unit-producer-data.sparql @@ -0,0 +1,61 @@ +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + ?s a ; + ; + ?p ?o . + } +} +; +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + ?s a ; + ; + ?p ?o . + } +} +; +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + ?s a ; + ; + ?p ?o . + } +} +; +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + ?s a ; + ; + ?p ?o . + } +} +; +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + ?s a ; + ; + ?p ?o . + } +} +; +CLEAR GRAPH diff --git a/config/migrations/2023/20230215094055-add-missing-position.graph b/config/migrations/2023/20230215094055-add-missing-position.graph new file mode 100644 index 0000000..00b1762 --- /dev/null +++ b/config/migrations/2023/20230215094055-add-missing-position.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/organisatieportaal diff --git a/config/migrations/2023/20230215094055-add-missing-position.ttl b/config/migrations/2023/20230215094055-add-missing-position.ttl new file mode 100644 index 0000000..f385e01 --- /dev/null +++ b/config/migrations/2023/20230215094055-add-missing-position.ttl @@ -0,0 +1,613 @@ +@prefix ns0: . +@prefix ns1: . +@prefix ns2: . +@prefix rdf: . +@prefix ns4: . +@prefix ns5: . + + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:e06b3e3d005d25e4a23459dd5773c00e . + + ns0:wordtBediendDoor ns1:a3d7cda7f4acad34682b8086d13ea397 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:a6735a9f75e9f30f8d31198e18e39192 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:e39958a6e2d38e23b5669a3b9ae1e719 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:c1efedae090d2c4be97d529c73b5ae87 . + + ns0:wordtBediendDoor ns1:ef9ebb3d9429b24c87a6576bfe302d85 . + + ns0:wordtBediendDoor . +ns2:ef77bb3094fdc4a7ed7e09551500acfe + ns0:wordtBediendDoor . +ns2:a8faa182c59167da7551f40979dc5022 + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:c924a44f9163ec6c946505f5f687708d . +ns2:ca0daee18a29e187017bf236e26f1ec2 + ns0:wordtBediendDoor ns1:cb4bf613bd82f99785df7aedb65b3367 . +ns2:f95b761af55091b491fd62bd6bed11dc + ns0:wordtBediendDoor ns1:d1dd10ca84303e547546f7e7a502dc6c . + + ns0:wordtBediendDoor . +ns2:c1c334a2cc56ac501badce5e879aec65 + ns0:wordtBediendDoor ns1:b74b9e77b49bbe8f5be5766be677c9bb . + + ns0:wordtBediendDoor ns1:bfe1868d6a41e073f114dd2efdcf51a5 . + + ns0:wordtBediendDoor . +ns2:a6e0531c6c4b5885552604163cfabfbc + ns0:wordtBediendDoor ns1:cdb151adeceb026fc5e81ea80d729391 . + + ns0:wordtBediendDoor ns1:c94d252366917f598a19df33680bbb29 . +ns2:cd7d4208e8e6291d75b33d89e3a0a439 + ns0:wordtBediendDoor . +ns2:a8d9f1a45c11c6761306bdf680349593 + ns0:wordtBediendDoor ns1:fad9626cd2ab433ce884ef75d06e840b . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:d5ef4ca7efebfdafc4d28d2d8ab019b1 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . +ns2:a8880f3d8b482788c5f3adbf58f01b4f + ns0:wordtBediendDoor . +ns2:adeaab8a02815bf2c5816165a45ad4c5 + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . +ns2:c7d6827eb88cd977146e72583461071b + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . +ns2:b81199eddd02f291bd4c1a0e29e5b9c8 + ns0:wordtBediendDoor ns1:cf320c8fb2e9db3a488b0ac016440f33 . +ns2:db46915e77fbf8f083e9861c802b2b13 + ns0:wordtBediendDoor ns1:b6c9aeea4bf9daa1520156b9fe5a49e5 . +ns2:fd4ae252fffca29852354b12ef37b086 + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . +ns2:b540096ac8be2c9c72dafd59e61080c5 + ns0:wordtBediendDoor ns1:f9a134e17b7ac4a42a66b7b66d86d00b . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:d4505963c15a4dd1cc77b34977b727c0 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:f90bc6678d032b1203c3e003b05a903e . + + ns0:wordtBediendDoor ns1:a1a4364ce6767907e600d8025c2f8cb9 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:baa288870012628b450bd134175cb91a . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:f1ac3ad7a3cf88917b6ff453bcdae693 . + + ns0:wordtBediendDoor ns1:e3c51e910902a9b4087f9d2dfe8629a2 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:ad8e06f595ccd82c799c81e7838db45e . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:e32bf54030b9a31d84249386a289287a . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:cf701aabf06d091083135506f7d8b785 . + + ns0:wordtBediendDoor ns1:f484ae309f3f981489724334f7a9e90b . + + ns0:wordtBediendDoor ns1:ebfd92d4fa2fb375fb407070e5275bc1 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:d82546b18b55081cc9c8e46aff579c75 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "72c14871c7a0f28cd52ebeb73d6d0fee" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "203b6f9c7e6eec3f62860b378e8371b0" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "79a1d65018cd0f86fa5757f9594ed52b" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "6436abc14a9615cfaa26f4dc7609bef8" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "116c6e00577975a5f41d4789166549d4" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "4a0c024fae6dcfb732006eeacf926c1c" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0cde683248e90e543936deea015ec7f8" ; + ns0:functie . +ns1:e06b3e3d005d25e4a23459dd5773c00e + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "e06b3e3d005d25e4a23459dd5773c00e" ; + ns0:functie . +ns1:a3d7cda7f4acad34682b8086d13ea397 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "a3d7cda7f4acad34682b8086d13ea397" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "16c09cdc3608605b3ee88bf9ab9c7dac" ; + ns0:functie . +ns1:a6735a9f75e9f30f8d31198e18e39192 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "a6735a9f75e9f30f8d31198e18e39192" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0351db31503375a8fb31b7089c65ec83" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "85d28128b4cc9476fef4eeeffa2530a2" ; + ns0:functie . +ns1:e39958a6e2d38e23b5669a3b9ae1e719 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "e39958a6e2d38e23b5669a3b9ae1e719" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "594841e8ec952d28ee1f09bbe1d3890a" ; + ns0:functie . +ns1:c1efedae090d2c4be97d529c73b5ae87 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "c1efedae090d2c4be97d529c73b5ae87" ; + ns0:functie . +ns1:ef9ebb3d9429b24c87a6576bfe302d85 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "ef9ebb3d9429b24c87a6576bfe302d85" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "569b7a4720c5d44269ab96663f3f5021" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "453521f31bee624be96caa2f1a2e7048" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "87db8210da3911674adf40d01076fd81" ; + ns0:functie . +ns1:c924a44f9163ec6c946505f5f687708d + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "c924a44f9163ec6c946505f5f687708d" ; + ns0:functie . +ns1:cb4bf613bd82f99785df7aedb65b3367 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "cb4bf613bd82f99785df7aedb65b3367" ; + ns0:functie . +ns1:d1dd10ca84303e547546f7e7a502dc6c + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "d1dd10ca84303e547546f7e7a502dc6c" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "95222f20d3ff233e0623dc8c811375e4" ; + ns0:functie . +ns1:b74b9e77b49bbe8f5be5766be677c9bb + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "b74b9e77b49bbe8f5be5766be677c9bb" ; + ns0:functie . +ns1:bfe1868d6a41e073f114dd2efdcf51a5 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "bfe1868d6a41e073f114dd2efdcf51a5" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "59b02bc348ce9c8b26fd2eb6b6a9bd86" ; + ns0:functie . +ns1:cdb151adeceb026fc5e81ea80d729391 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "cdb151adeceb026fc5e81ea80d729391" ; + ns0:functie . +ns1:c94d252366917f598a19df33680bbb29 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "c94d252366917f598a19df33680bbb29" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "5a87bfd76cc6d2f582ef1272116c863a" ; + ns0:functie . +ns1:fad9626cd2ab433ce884ef75d06e840b + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "fad9626cd2ab433ce884ef75d06e840b" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "9cea42c28a90ce1ac0cdf3bdb01199b8" ; + ns0:functie . +ns1:d5ef4ca7efebfdafc4d28d2d8ab019b1 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "d5ef4ca7efebfdafc4d28d2d8ab019b1" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "8ef8c30c7e682a8c56af185c91c898ad" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "1903dde5ac84bece6238f20175ba583e" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "1bb5f658bd511ed2752ae4ad57ef8528" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "57bce94d3031b52f361a3c043b1678d9" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "776bc597d74bba0ad0c60c81b4c22529" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "259b382ef9f0a8eaaf84954bc09e3f38" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "09ee3daf174b1069b4ae66e31f5b8728" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "77e3e5bcb167367015c391dfa91cb01f" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "8b98c482cb67f55c2fb7174a00cdf09d" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "5963146dc30cba248bb24e29b5002b78" ; + ns0:functie . +ns1:cf320c8fb2e9db3a488b0ac016440f33 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "cf320c8fb2e9db3a488b0ac016440f33" ; + ns0:functie . +ns1:b6c9aeea4bf9daa1520156b9fe5a49e5 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "b6c9aeea4bf9daa1520156b9fe5a49e5" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "8eab113defa6ac21fd87c0828292e926" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0aaf20e1103fec92356373dd7de19887" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "46cac4be99a8036f729ddd2df0cbc3c4" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "8c2ab509b1e9cfa3dba90f9a4cb3037d" ; + ns0:functie . +ns1:f9a134e17b7ac4a42a66b7b66d86d00b + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "f9a134e17b7ac4a42a66b7b66d86d00b" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0a46fb4249e6a218b943a8f6fe1ac090" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "19838c3b991ad9f816ef491d96a721d3" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "76419a6001ca12e313e13bde8840e405" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "60ae1e4b56e80af0b81a20b96d4187b1" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "1c1d1fd0c40ffe62076203d7ea2060a6" ; + ns0:functie . +ns1:d4505963c15a4dd1cc77b34977b727c0 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "d4505963c15a4dd1cc77b34977b727c0" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0a69b193cce1416d4d6366fff46add3f" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "41ae97e88af106e5c9ee3588adc9e2ba" ; + ns0:functie . +ns1:f90bc6678d032b1203c3e003b05a903e + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "f90bc6678d032b1203c3e003b05a903e" ; + ns0:functie . +ns1:a1a4364ce6767907e600d8025c2f8cb9 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "a1a4364ce6767907e600d8025c2f8cb9" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "5687522854e85ab6f4c324b273467ce4" ; + ns0:functie . +ns1:baa288870012628b450bd134175cb91a + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "baa288870012628b450bd134175cb91a" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "031e9b8845e50e0f2484ed7eac94324e" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "233a795834c4f862342250b0c8647d15" ; + ns0:functie . +ns1:f1ac3ad7a3cf88917b6ff453bcdae693 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "f1ac3ad7a3cf88917b6ff453bcdae693" ; + ns0:functie . +ns1:e3c51e910902a9b4087f9d2dfe8629a2 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "e3c51e910902a9b4087f9d2dfe8629a2" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "02c677db7c013653e475984bebf59b58" ; + ns0:functie . +ns1:ad8e06f595ccd82c799c81e7838db45e + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "ad8e06f595ccd82c799c81e7838db45e" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "57fdb71d4feb243e727005e16d31d98a" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "2a425d7fa4022573cb4824e91e2f5264" ; + ns0:functie . +ns1:e32bf54030b9a31d84249386a289287a + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "e32bf54030b9a31d84249386a289287a" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "0315bd04919b2884af8f3c0a8b820ba0" ; + ns0:functie . +ns1:cf701aabf06d091083135506f7d8b785 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "cf701aabf06d091083135506f7d8b785" ; + ns0:functie . +ns1:f484ae309f3f981489724334f7a9e90b + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "f484ae309f3f981489724334f7a9e90b" ; + ns0:functie . +ns1:ebfd92d4fa2fb375fb407070e5275bc1 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "ebfd92d4fa2fb375fb407070e5275bc1" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "638c32d8700a7c8891e7ae2ed1f86dfc" ; + ns0:functie . +ns1:d82546b18b55081cc9c8e46aff579c75 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "d82546b18b55081cc9c8e46aff579c75" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "87e2496b12c3a58672970e4db4a013ed" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "6c177d4df98c1ae795146245e1b8ded3" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "41ee849be721d50f1012987ec14cf4d5" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "36357858aff9e011120ce12a4c9a735d" ; + ns0:functie . +ns1:c654c9e1b47c7acd6c994f9213c02671 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "c654c9e1b47c7acd6c994f9213c02671" ; + ns0:functie . +ns1:face7445fb50e36d72b142e862381b05 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "face7445fb50e36d72b142e862381b05" ; + ns0:functie . +ns1:f24f1b4a152c70b2dbe51ad0c3171de3 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "f24f1b4a152c70b2dbe51ad0c3171de3" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "09bbb9454457c17975696ac680349a0a" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "809e08adf06dad4286658ba80dcb3ec0" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "014c834f16b6e3780d6e0613e1b469e1" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "2715eda6c886e5931ae16e7bc877db6c" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "06c83ff34ec4231674e90095e24fbb12" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "9e59891d2fff60c9a325c0760263ac53" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "8eccf8c0577135ac23cfc2514d4e41ce" ; + ns0:functie . +ns1:dd14c36fdcb4c93c80d8b8b6a9d7c400 + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "dd14c36fdcb4c93c80d8b8b6a9d7c400" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "7708bcfebdd905bd82c3dddd7861e7a1" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "49641427d736deffcdcbe2d086a6238f" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "5f0961a539d8dc48fcfef822f71d735c" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "5b18d66f489d69900a22782a1fd9f273" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "6f10f26c5cfbe3398b24a5d0cb360ee2" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "87fb9d24420b7def7d58e9eb5d014145" ; + ns0:functie . +ns1:d45e2fdff3725615b024f7b71fadef7e + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "d45e2fdff3725615b024f7b71fadef7e" ; + ns0:functie . +ns1:c275c2b71b28e21ccaf2e16582f59e0d + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "c275c2b71b28e21ccaf2e16582f59e0d" ; + ns0:functie . + + rdf:type ns4:Post , ns0:PositieBedienaar ; + ns5:uuid "25a8dd65997f9ba30e7416bbf774594f" ; + ns0:functie . + + ns0:wordtBediendDoor ns1:c654c9e1b47c7acd6c994f9213c02671 . + + ns0:wordtBediendDoor ns1:face7445fb50e36d72b142e862381b05 . + + ns0:wordtBediendDoor ns1:f24f1b4a152c70b2dbe51ad0c3171de3 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:dd14c36fdcb4c93c80d8b8b6a9d7c400 . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor . + + ns0:wordtBediendDoor ns1:d45e2fdff3725615b024f7b71fadef7e . + + ns0:wordtBediendDoor ns1:c275c2b71b28e21ccaf2e16582f59e0d . + + ns0:wordtBediendDoor . diff --git a/config/migrations/2023/20230227114600-remove-worship-not-actif.sparql b/config/migrations/2023/20230227114600-remove-worship-not-actif.sparql new file mode 100644 index 0000000..10d16d7 --- /dev/null +++ b/config/migrations/2023/20230227114600-remove-worship-not-actif.sparql @@ -0,0 +1,50 @@ +PREFIX org: +PREFIX adms: +PREFIX generiek: +PREFIX organisatie: + +DELETE { + GRAPH { + ?bestuur ?pbestuur ?obestuur . + ?primarySite ?pprimarySite ?oprimarySite . + ?address ?paddress ?oaddress . + ?contactPoint ?pcontactPoint ?ocontactPoint . + ?identifier ?pidentifier ?oidentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } +} WHERE { + GRAPH { + BIND( as ?bestuur) + + ?bestuur ?pbestuur ?obestuur . + + OPTIONAL { + + ?bestuur org:hasPrimarySite ?primarySite . + + OPTIONAL { + ?primarySite organisatie:bestaatUit ?address . + ?address ?paddress ?oaddress . + } + OPTIONAL { + ?primarySite org:siteAddress ?contactPoint . + ?contactPoint ?pcontactPoint ?ocontactPoint . + } + + ?primarySite ?pprimarySite ?oprimarySite . + + } + OPTIONAL { + + ?bestuur adms:identifier ?identifier . + + OPTIONAL { + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier . + ?structuredIdentifier ?pstructuredIdentifier ?ostructuredIdentifier . + } + + ?identifier ?pidentifier ?oidentifier . + + } + } +} diff --git a/config/migrations/2023/20230227115900-delete-duplicate-change-event.sparql b/config/migrations/2023/20230227115900-delete-duplicate-change-event.sparql new file mode 100644 index 0000000..8b6bf15 --- /dev/null +++ b/config/migrations/2023/20230227115900-delete-duplicate-change-event.sparql @@ -0,0 +1,37 @@ +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: + +DELETE WHERE { + graph ?g { + ?changeEvent a ; + ?changeEventResult; + mu:uuid ?uuidChangeEvent; + ?p ?o. + + ?changeEventResult a ; + mu:uuid ?uuidChangeEventResult; + ?cP ?cO. + + filter(?uuidChangeEvent ="63E4B56D1C2DE4F40F38C089") + + } +} + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228105324-move-jobs-to-specific-graph.sparql b/config/migrations/2023/20230228112800-hard-split/20230228105324-move-jobs-to-specific-graph.sparql new file mode 100644 index 0000000..9cf2b5b --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228105324-move-jobs-to-specific-graph.sparql @@ -0,0 +1,21 @@ +DELETE { + GRAPH ?g { + ?s ?p ?o . + } +} INSERT { + GRAPH { + ?s ?p ?o . + } +} WHERE { + GRAPH ?g { + VALUES ?type { + + + + + } + + ?s a ?type ; + ?p ?o . + } +} diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132500-delete-elastic-index.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132500-delete-elastic-index.sparql new file mode 100644 index 0000000..8d7e1b4 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132500-delete-elastic-index.sparql @@ -0,0 +1 @@ +delete where { graph ?g{ ?s a ; ?p ?o } } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132600-move-all-worship-types.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132600-move-all-worship-types.sparql new file mode 100644 index 0000000..7a791af --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132600-move-all-worship-types.sparql @@ -0,0 +1,44 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?s ?p ?o + } +} +INSERT { + GRAPH { + ?s ?p ?o + } +} + +WHERE { + GRAPH { + ?s a ?type; ?p ?o. + + filter (?type in ( + ere:EredienstMandataris, + ere:BestuurVanDeEredienst, + ere:PositieBedienaar, + ere:BetrokkenLokaleBesturen, + ere:VerbondenJuridischeStructuren, + ere:RolBedienaar, + ere:EredienstBestuurseenheid, + ere:VoorwaardenBedienaar, + ere:CentraalBestuurVanDeEredienst, + ere:RepresentatiefOrgaan + )) + + } +} diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132601-move-all-worsip-governing-bodies.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132601-move-all-worsip-governing-bodies.sparql new file mode 100644 index 0000000..ef16265 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132601-move-all-worsip-governing-bodies.sparql @@ -0,0 +1,90 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?governingBody ?p ?o. + } +} +INSERT { + GRAPH { + ?governingBody ?p ?o. + } +} + +WHERE { + GRAPH { + ?governingBody ?post; ?p ?o. + + filter exists { + GRAPH { + ?mandatories ?post. + + } + } + } + +} + +; + +DELETE { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} +INSERT { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} + +WHERE { + GRAPH { + ?specialization ?specializationP ?specializationO. + + filter exists { + GRAPH { + ?governingBody generiek:isTijdspecialisatieVan ?specialization. + } + } + } + +} + +; + +DELETE { + GRAPH { + ?bestuur ?bestuurP ?bestuurO. + } +} +INSERT { + GRAPH { + ?bestuur ?bestuurP ?bestuurO. + } +} + +WHERE { + GRAPH { + ?bestuur ?bestuurP ?bestuurO. + filter exists { + GRAPH { + + ?specialization besluit:bestuurt ?bestuur. + } + } + } + +} diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132602-move-all-worsip-governing-bodies-2.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132602-move-all-worsip-governing-bodies-2.sparql new file mode 100644 index 0000000..173d4dc --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132602-move-all-worsip-governing-bodies-2.sparql @@ -0,0 +1,73 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?governingBody ?p ?o. + } +} +INSERT { + GRAPH { + ?governingBody ?p ?o. + } +} + +WHERE { + GRAPH { + ?governingBody + ?post; ?p ?o. + + filter exists { + GRAPH { + ?mandatories ?post. + + } + } + } + +} +; + + +DELETE { + GRAPH { + ?post a ?type; + mu:uuid ?uuid; + ?role. + } +} +INSERT { + GRAPH { + ?post a ?type; mu:uuid ?uuid; + ?role. + } +} + +WHERE { + GRAPH { + ?post a ?type; + mu:uuid ?uuid; + + ?role. + + filter exists { + GRAPH { + ?mandatories ?post. + + } + } + } + +} + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132603-move-all-worsip-governing-bodies-3.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132603-move-all-worsip-governing-bodies-3.sparql new file mode 100644 index 0000000..e4ece33 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132603-move-all-worsip-governing-bodies-3.sparql @@ -0,0 +1,93 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?governingBody ?p ?o. + } +} +INSERT { + GRAPH { + ?governingBody ?p ?o. + } +} + +WHERE { + GRAPH { + ?governingBody ?post; ?p ?o. + + filter exists { + GRAPH { + ?mandatories ?post. + + } + } + } + +} + +; + +DELETE { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} +INSERT { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} + +WHERE { + GRAPH { + ?specialization ?specializationP ?specializationO. + + filter exists { + GRAPH { + ?governingBody generiek:isTijdspecialisatieVan ?specialization. + } + } + } + +} + +; + + +PREFIX besluit: + +DELETE { + GRAPH { + ?bestuur ?bestuurP ?bestuurO. + } +} +INSERT { + GRAPH { + ?bestuur ?bestuurP ?bestuurO. + } +} + +WHERE { + GRAPH { + ?bestuur besluit:bestuurt ?s;?bestuurP ?bestuurO. + filter exists { + GRAPH { + + ?s ?p ?o. + } + } + } + +} diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132604-move-bestrokken.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132604-move-bestrokken.sparql new file mode 100644 index 0000000..62a10af --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132604-move-bestrokken.sparql @@ -0,0 +1,36 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?s ?bestrokke. + } +} +INSERT { + GRAPH { + ?s ?bestrokke. + } +} + +WHERE { + GRAPH { + + ?s ?bestrokke. + + } + +} + + + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132605-move-all-worsip-change-events.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132605-move-all-worsip-change-events.sparql new file mode 100644 index 0000000..b07ee2f --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132605-move-all-worsip-change-events.sparql @@ -0,0 +1,87 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + + +DELETE { + GRAPH { + ?s ?p ?o. + } +} +INSERT { + GRAPH { + ?s ?p ?o. + } +} + +WHERE { + GRAPH { + ?resultingOrganization a ?type. + + } + GRAPH { + + ?s ext:resultingOrganization ?resultingOrganization. + ?s ?p ?o. + } + +} +; + +DELETE { + GRAPH { + ?s ?p ?o. + } +} +INSERT { + GRAPH { + ?s ?p ?o. + } +} + +WHERE { + GRAPH { + ?resultingOrganization a ?type. + + } + GRAPH { + + ?s ?resultingOrganization. + ?s ?p ?o. + } + +} +; +DELETE { + GRAPH { + ?s ?p ?o. + } +} +INSERT { + GRAPH { + ?s ?p ?o. + } +} + +WHERE { + GRAPH { + ?resultingOrganization a ?type. + + } + GRAPH { + + ?s org:resultingOrganization ?resultingOrganization. + ?s ?p ?o. + } + +} + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132606-duplicate-person.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132606-duplicate-person.sparql new file mode 100644 index 0000000..6ccb0ab --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132606-duplicate-person.sparql @@ -0,0 +1,76 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + +INSERT { + graph { + ?person a person:Person; + mu:uuid ?uuid; + foaf:givenName ?givenName; + foaf:familyName ?familyName; + ?isAangesteldAls; + persoon:gebruikteVoornaam ?firstNameUsed. + } + +} +WHERE { + graph { + ?person a person:Person; + mu:uuid ?uuid; + foaf:givenName ?givenName; + foaf:familyName ?familyName. + optional {?person persoon:gebruikteVoornaam ?firstNameUsed. } + optional {?person ?isAangesteldAls.} + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; + +# delete orphans +DELETE { + graph { + ?person a person:Person; + foaf:givenName ?givenName; + foaf:familyName ?familyName; + ?isAangesteldAls; + persoon:gebruikteVoornaam ?firstNameUsed. + } + +} +WHERE { + graph { + ?person a person:Person; + foaf:givenName ?givenName; + foaf:familyName ?familyName. + optional{?person persoon:gebruikteVoornaam ?firstNameUsed.} + optional {?person ?isAangesteldAls.} + + FILTER((NOT EXISTS { ?mandatories ?person. }) + && (NOT EXISTS { ?ministers ?person. })) + + } +} + + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132607-move-shared-types.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132607-move-shared-types.sparql new file mode 100644 index 0000000..1376169 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132607-move-shared-types.sparql @@ -0,0 +1,290 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: +PREFIX skos: +PREFIX schema: +PREFIX organisatie: +PREFIX locn: +# move geboorte to private graph + +DELETE { + GRAPH { + ?s ?p ?o + } +} + INSERT { + GRAPH { + ?s ?p ?o + } +} +WHERE { + + GRAPH { + ?s a ; ?p ?o. + } +} + +; + +DELETE { + graph { + ?contactPoint ?p ?o. + ?addr ?x ?y. + } +} +insert { + graph { + ?contactPoint ?p ?o. + ?addr ?x ?y. + + } +} +where { + graph { + + ?contactPoint ?p ?o. + optional { + ?contactPoint ?addr. + ?addr ?x ?y. + } + filter (exists { + graph { + ?s ?contactPoint. + } + }) + } +} +; + + +DELETE { + GRAPH { + ?primarySite ?siteAddr; ?p ?o. + ?siteAddr ?x ?y. + ?addr ?addrP ?addrO. + ?locAddr ?locP ?locO + } +} +INSERT { + GRAPH { + ?primarySite ?siteAddr; ?p ?o. + ?siteAddr ?x ?y. + ?addr ?addrP ?addrO. + ?locAddr ?locP ?locO + } +} +Where { + Graph { + ?primarySite ?siteAddr; + ?p ?o. + ?siteAddr ?x ?y. + optional { + ?siteAddr locn:address ?locAddr . + ?locAddr ?locP ?locO. + } + optional { + ?primarySite organisatie:bestaatUit ?addr. + ?addr ?addrP ?addrO. + } + + + filter (exists { + graph { + ?s ?primarySite. + } + } + ) + + + } +} +; + +DELETE { + GRAPH { + ?s a ?type; ?p ?o. + } +} +INSERT { + GRAPH { + ?s a ?type; ?p ?o. + } +} +Where { + Graph { + ?s a ?type; ?p ?o. + filter (?type in(, + , + + ) + && exists { + graph { + ?x ?y ?z. + filter(?z=?s) + } + } + ) + + + } +} + +; + +DELETE { + GRAPH { + + ?primarySite ?bestaatUit; ?p ?o. + ?bestaatUit ?bestaatUitP ?bestaatUitO. + + } +} +INSERT { + GRAPH { + + ?primarySite ?bestaatUit; ?p ?o. + ?bestaatUit ?bestaatUitP ?bestaatUitO. +} +} +Where { + Graph { + ?primarySite ?bestaatUit; ?p ?o. + ?bestaatUit ?bestaatUitP ?bestaatUitO. + + + filter (exists { + graph { + ?unit ?primarySite. + } + } + ) + + + } +} +; + +DELETE { + GRAPH { + ?s a ?type; ?p ?o. + } +} +INSERT { + GRAPH { + ?s a ?type; ?p ?o. + } +} + +Where { + Graph { + ?s a ?type; ?p ?o. + filter (?type in(, + , + , + + ) + ) + + + } +} + + + +; + +DELETE { + GRAPH { + ?s a ; + mu:uuid ?uuid; + ?classification; + org:hasSubOrganization ?subOrg; + skos:prefLabel ?name. + + + } +} +INSERT { + GRAPH { + ?s a ; + mu:uuid ?uuid; + ?classification; + org:hasSubOrganization ?subOrg; + skos:prefLabel ?name. + + } +} + +WHERE { + GRAPH { + ?s a ; + ?classification; + mu:uuid ?uuid; + org:hasSubOrganization ?subOrg; + skos:prefLabel ?name. + + filter(?classification in ( + , + + )) + + + } +} + +; + +DELETE { + GRAPH { + ?s a ; + mu:uuid ?uuid; + ?classification; + skos:prefLabel ?name. + + + } +} +INSERT { + GRAPH { + ?s a ; + mu:uuid ?uuid; + ?classification; + + skos:prefLabel ?name. + + } +} + +WHERE { + GRAPH { + ?s a ; + ?classification; + mu:uuid ?uuid; + skos:prefLabel ?name. + + + filter(?classification in ( + , + + )&& exists { + + graph { + + ?subOrg org:hasSubOrganization ?s . +} + +}) + + + } +} + diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132608-move-public-types.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132608-move-public-types.sparql new file mode 100644 index 0000000..9b929d1 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132608-move-public-types.sparql @@ -0,0 +1,40 @@ +delete { + graph { + ?s ?p ?o + } +} +insert { + graph { + ?s ?p ?o + } +} +where { + graph { + ?s a ?type; ?p ?o. + filter (?type in ( + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + + + + )) + } +} diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132609-move-to-administrative-unit.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132609-move-to-administrative-unit.sparql new file mode 100644 index 0000000..bab2563 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132609-move-to-administrative-unit.sparql @@ -0,0 +1,3 @@ +# must be the latest to run + +MOVE TO diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132610-add-mock-user-1.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132610-add-mock-user-1.sparql new file mode 100644 index 0000000..192c7b5 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132610-add-mock-user-1.sparql @@ -0,0 +1,44 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + besluit:Bestuurseenheid . + mu:uuid "141d9d6b-54af-4d17-b313-8d1c30bc3f5b" . + skos:prefLabel "Agentschap Binnenlands Bestuur" . + dcterms:identifier "OVO001835" . + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3470" . + foaf:firstName "Josephine" . + foaf:familyName "Lezer" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0989" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalGebruiker-lezer" . + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3471" . + foaf:firstName "Josephine" . + foaf:familyName "Editeerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0957" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalGebruiker-editeerder" . + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3472" . + foaf:firstName "Josephine" . + foaf:familyName "Beheerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0958" . + foaf:accountServiceHomepage . + } + } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132611-add-mock-user-2.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132611-add-mock-user-2.sparql new file mode 100644 index 0000000..361ea9e --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132611-add-mock-user-2.sparql @@ -0,0 +1,42 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + ext:sessionRole "ABBOrganisatiePortaalGebruiker-beheerder" . + foaf:Person . + mu:uuid "2fe9885b-d058-4059-b036-69b54444273d" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipLezer" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "8d411fea-5bf0-4925-ba97-14b2223f65ea" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-lezer" . + foaf:Person . + mu:uuid "4925580c-a1a9-43d4-b3f6-10bd7ff57e25" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipEditeerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "fe45b266-715c-481e-9a97-a70f6121166c" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-editeerder" . + foaf:Person . + mu:uuid "f3610493-f6e1-4490-9723-628fe0213491" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipBeheerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "2a88a4b4-4672-45eb-b072-c930bf3b40ae" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder" . + } + } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132612-add-mock-user-3.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132612-add-mock-user-3.sparql new file mode 100644 index 0000000..33e912c --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132612-add-mock-user-3.sparql @@ -0,0 +1,30 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3470" . + foaf:firstName "Josephine" . + foaf:familyName "Lezer" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0989" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalGebruiker-lezer" . + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3471" . + foaf:firstName "Josephine" . + foaf:familyName "Editeerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0957" . + foaf:accountServiceHomepage . + } + } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228132613-add-mock-user-4.sparql b/config/migrations/2023/20230228112800-hard-split/20230228132613-add-mock-user-4.sparql new file mode 100644 index 0000000..68534f9 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228132613-add-mock-user-4.sparql @@ -0,0 +1,53 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + ext:sessionRole "ABBOrganisatiePortaalGebruiker-editeerder" . + foaf:Person . + mu:uuid "d39fe09e-d339-4e43-8680-dbbcfb3d3472" . + foaf:firstName "Josephine" . + foaf:familyName "Beheerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "3a91ff60-07c1-4136-ac5e-55cf401e0958" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalGebruiker-beheerder" . + foaf:Person . + mu:uuid "2fe9885b-d058-4059-b036-69b54444273d" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipLezer" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "8d411fea-5bf0-4925-ba97-14b2223f65ea" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-lezer" . + foaf:Person . + mu:uuid "4925580c-a1a9-43d4-b3f6-10bd7ff57e25" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipEditeerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "fe45b266-715c-481e-9a97-a70f6121166c" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-editeerder" . + foaf:Person . + mu:uuid "f3610493-f6e1-4490-9723-628fe0213491" . + foaf:firstName "Josephine" . + foaf:familyName "WorshipBeheerder" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "2a88a4b4-4672-45eb-b072-c930bf3b40ae" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder" . + +} + } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228142612-add-mock-user-5.sparql b/config/migrations/2023/20230228112800-hard-split/20230228142612-add-mock-user-5.sparql new file mode 100644 index 0000000..c87920f --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228142612-add-mock-user-5.sparql @@ -0,0 +1,23 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + foaf:Person . + mu:uuid "6928a160-f3fc-4b46-bae8-fb72a0ae833e" . + foaf:firstName "Josephine" . + foaf:familyName "BothRoles" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "cd52ed34-7bcd-41df-a7d4-c805c1d1a197" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder", + "ABBOrganisatiePortaalGebruiker-beheerder" . + + } + } diff --git a/config/migrations/2023/20230228112800-hard-split/20230228142712-add-mock-user-6.sparql b/config/migrations/2023/20230228112800-hard-split/20230228142712-add-mock-user-6.sparql new file mode 100644 index 0000000..1f3e984 --- /dev/null +++ b/config/migrations/2023/20230228112800-hard-split/20230228142712-add-mock-user-6.sparql @@ -0,0 +1,22 @@ +PREFIX ext: + PREFIX besluit: + PREFIX mu: + PREFIX skos: + PREFIX dcterms: + PREFIX foaf: + + INSERT DATA { + GRAPH { + foaf:Person . + mu:uuid "6928a160-f3fc-4b46-bae8-fb72a0ae833e" . + foaf:firstName "Josephine" . + foaf:familyName "BothRoles" . + foaf:member . + foaf:account . + foaf:OnlineAccount . + mu:uuid "cd52ed34-7bcd-41df-a7d4-c805c1d1a197" . + foaf:accountServiceHomepage . + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder", "ABBOrganisatiePortaalGebruiker-beheerder" . + + } + } diff --git a/config/migrations/2023/20230228152117-remove-beheerder.sparql b/config/migrations/2023/20230228152117-remove-beheerder.sparql new file mode 100644 index 0000000..40f987c --- /dev/null +++ b/config/migrations/2023/20230228152117-remove-beheerder.sparql @@ -0,0 +1,58 @@ +PREFIX ext: +DELETE where { + graph { + ?p ?o. + ?aP ?aO. + ?wp ?wo. + ?wpap ?wpao. + } +} +; +DELETE where { + graph { + ?p ?o. + ?aP ?aO. + ?wp ?wo. + ?wpap ?wpao. + } +} +; + +DELETE WHERE { + graph { + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder", + "ABBOrganisatiePortaalGebruiker-beheerder" . + + } +} + +; + +; + +DELETE WHERE { + graph { + ext:sessionRole "ABBOrganisatiePortaalErediensten-beheerder", + "ABBOrganisatiePortaalGebruiker-beheerder" . + + + } +} + + +INSERT DATA { +GRAPH { + ext:sessionRole "ABBOrganisatiePortaalErediensten-editeerder", + "ABBOrganisatiePortaalGebruiker-editeerder" . + +} +} +; + +INSERT DATA { +GRAPH { + ext:sessionRole "ABBOrganisatiePortaalErediensten-editeerder", + "ABBOrganisatiePortaalGebruiker-editeerder" . + +} +} diff --git a/config/migrations/2023/20230306122751-add-missing-applies-within-link.sparql b/config/migrations/2023/20230306122751-add-missing-applies-within-link.sparql new file mode 100644 index 0000000..4f1478a --- /dev/null +++ b/config/migrations/2023/20230306122751-add-missing-applies-within-link.sparql @@ -0,0 +1,12 @@ +PREFIX mu: +PREFIX ext: + +INSERT DATA { + GRAPH { + ext:appliesWithin . # Centraal bestuur + ext:appliesWithin . # Comité + ext:appliesWithin . # Bestuursraad + ext:appliesWithin . # Kerkfabriekraad + ext:appliesWithin . # Kathedrale kerkraad + } +} diff --git a/config/migrations/2023/20230306142222-move-orgaan-to-worship.sparql b/config/migrations/2023/20230306142222-move-orgaan-to-worship.sparql new file mode 100644 index 0000000..7bef175 --- /dev/null +++ b/config/migrations/2023/20230306142222-move-orgaan-to-worship.sparql @@ -0,0 +1,107 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: +PREFIX ere: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + +DELETE { + GRAPH { + ?s ?p ?o. + } +} +INSERT { + GRAPH { + ?s ?p ?o. + } +} + +WHERE { + GRAPH { + ?s a ; + ?classification; + ?p ?o. + +filter exists { + graph { + ?classification ?appliesWithin. + ?appliesWithin mu:uuid ?classificationUuid. + + filter(?classificationUuid in ("66ec74fd-8cfc-4e16-99c6-350b35012e86","f9cac08a-13c1-49da-9bcb-f650b0604054")) + } +} + + + + +} + +} +; + +DELETE { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} +INSERT { + GRAPH { + ?specialization ?specializationP ?specializationO. + } +} + +WHERE { + GRAPH { + ?specialization a ; generiek:isTijdspecialisatieVan ?specialization2; ?specializationP ?specializationO. + +filter exists{ + +graph { + + + ?specialization2 a . +} +} +} + + +} +; + + + + +; + + + +DELETE { + GRAPH { + ?mandaat ?p ?o. + } +} +INSERT { + GRAPH { + ?mandaat ?p ?o. + } +} + +WHERE { + GRAPH { + ?mandaat ?p ?o. + filter exists { + GRAPH { + ?orgaan ?mandaat. + + } + } +} + + +} diff --git a/config/migrations/2023/20230307091456-fix-wrong-resulting-org-after-merge.sparql b/config/migrations/2023/20230307091456-fix-wrong-resulting-org-after-merge.sparql new file mode 100644 index 0000000..dfb815b --- /dev/null +++ b/config/migrations/2023/20230307091456-fix-wrong-resulting-org-after-merge.sparql @@ -0,0 +1,47 @@ +# Update status of the bestuurseenheden as well as the resulting status of the change event + +PREFIX regorg: +PREFIX lblodOrg: + +DELETE { + GRAPH ?g { + + regorg:orgStatus . # Actief + + lblodOrg:resulterendeStatus . # Actief + + + regorg:orgStatus . # Niet Actief + + lblodOrg:resulterendeStatus . # Niet Actief + . + } +} INSERT { + GRAPH ?g { + + regorg:orgStatus . # Niet Actief + + lblodOrg:resulterendeStatus . # Niet Actief + + + regorg:orgStatus . # Actief + + lblodOrg:resulterendeStatus . # Actief + . + + } +} WHERE { + GRAPH ?g { + + regorg:orgStatus . # Actief + + lblodOrg:resulterendeStatus . # Actief + + + regorg:orgStatus . # Niet Actief + + lblodOrg:resulterendeStatus . # Niet Actief + . + + } +} diff --git a/config/migrations/2023/20230307125956-move-identifiers.sparql b/config/migrations/2023/20230307125956-move-identifiers.sparql new file mode 100644 index 0000000..120c565 --- /dev/null +++ b/config/migrations/2023/20230307125956-move-identifiers.sparql @@ -0,0 +1,37 @@ +PREFIX regorg: +PREFIX lblodOrg: +PREFIX adms: +PREFIX mu: +PREFIX generiek: + +DELETE { + GRAPH { + + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier; + ?p ?o. + ?structuredIdentifier ?sp ?so. + + } +} INSERT { + GRAPH { + + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier; + ?p ?o. + ?structuredIdentifier ?sp ?so. + + } +} WHERE { + GRAPH { + + ?identifier generiek:gestructureerdeIdentificator ?structuredIdentifier; + ?p ?o. + ?structuredIdentifier ?sp ?so. + filter exists { + GRAPH { + ?org adms:identifier ?identifier. + + } + } + + } +} diff --git a/config/migrations/2023/20230308112614-move-privacy-data.sparql b/config/migrations/2023/20230308112614-move-privacy-data.sparql new file mode 100644 index 0000000..33dfbd4 --- /dev/null +++ b/config/migrations/2023/20230308112614-move-privacy-data.sparql @@ -0,0 +1,293 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: + +DELETE { + GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + } +} +INSERT { +GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + + } +} +WHERE { + GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; + +DELETE { + GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + } +} +INSERT { +GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + + } +} +WHERE { + GRAPH { + ?person persoon:heeftGeboorte ?heeftGeboorte. + ?heeftGeboorte ?p ?o. + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; + +# geslacht + +DELETE { + GRAPH { + ?person persoon:geslacht ?geslacht. + } +} +INSERT { +GRAPH { + ?person persoon:geslacht ?geslacht. + + + } +} +WHERE { + GRAPH { + ?person persoon:geslacht ?geslacht. + + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; +DELETE { + GRAPH { + ?person persoon:geslacht ?geslacht. + } +} +INSERT { +GRAPH { + ?person persoon:geslacht ?geslacht. + + } +} +WHERE { + GRAPH { + + ?person persoon:geslacht ?geslacht. + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; + +# nationaliteit +DELETE { + GRAPH { + ?person persoon:heeftNationaliteit ?nationaliteit. + } +} +INSERT { +GRAPH { + ?person persoon:heeftNationaliteit ?nationaliteit. + } +} +WHERE { + GRAPH { + ?person persoon:heeftNationaliteit ?nationaliteit. + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; +DELETE { + GRAPH { + ?person persoon:heeftNationaliteit ?nationaliteit. + } +} +INSERT { +GRAPH { + ?person persoon:heeftNationaliteit ?nationaliteit. + } +} +WHERE { + GRAPH { + + ?person persoon:heeftNationaliteit ?nationaliteit. + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; + + +# registration +DELETE { + GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + ?registration ?t ?j. + + } +} +INSERT { +GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + ?registration ?t ?j. + } +} +WHERE { + GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + optional { ?registration ?t ?j. } + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} +; +DELETE { + GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + ?registration ?t ?j. + + } +} +INSERT { +GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + ?registration ?t ?j. + } +} +WHERE { + GRAPH { + ?person persoon:registratie ?registration. + ?registration ?identificator. + ?identificator ?x ?y. + optional {?registration ?t ?j.} + + filter (exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} + + diff --git a/config/migrations/2023/20230308112615-move-privacy-data-2a.sparql b/config/migrations/2023/20230308112615-move-privacy-data-2a.sparql new file mode 100644 index 0000000..2ad7d48 --- /dev/null +++ b/config/migrations/2023/20230308112615-move-privacy-data-2a.sparql @@ -0,0 +1,40 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: + +DELETE { + GRAPH { + ?s ?p ?o + } +} +INSERT { +GRAPH { + ?s ?p ?o + } +} +WHERE { + GRAPH { + ?s a ; ?person; ?p ?o. + filter ( + exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} + + diff --git a/config/migrations/2023/20230308112616-move-privacy-data-2b.sparql b/config/migrations/2023/20230308112616-move-privacy-data-2b.sparql new file mode 100644 index 0000000..b296ee7 --- /dev/null +++ b/config/migrations/2023/20230308112616-move-privacy-data-2b.sparql @@ -0,0 +1,40 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: + +DELETE { + GRAPH { + ?s ?p ?o + } +} +INSERT { +GRAPH { + ?s ?p ?o + } +} +WHERE { + GRAPH { + ?s a ; ?person; ?p ?o. + filter ( + exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} + + diff --git a/config/migrations/2023/20230308112617-move-privacy-data-3.sparql b/config/migrations/2023/20230308112617-move-privacy-data-3.sparql new file mode 100644 index 0000000..727170c --- /dev/null +++ b/config/migrations/2023/20230308112617-move-privacy-data-3.sparql @@ -0,0 +1,43 @@ +PREFIX xsd: +PREFIX mu: +PREFIX persoon: +PREFIX ext: +PREFIX person: +PREFIX session: +PREFIX foaf: +PREFIX besluit: + + +DELETE { + GRAPH { + ?s ?p ?o + } +} +INSERT { +GRAPH { + ?s ?p ?o + } +} +WHERE { + GRAPH { + ?s a ?type; ?person; ?p ?o. + filter ( +(?type = || ?type = ) +&& + + exists + { + graph { + ?mandatories ?person. + } + } + + || exists { + graph { + ?ministers ?person. + } + }) + + } +} + diff --git a/config/resources/domain.json b/config/resources/domain.json index a763d2a..4eba5e7 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -122,7 +122,9 @@ }, "mandatories": { "class": "mandaat:Mandataris", - "super": ["agents-in-position"], + "super": [ + "agents-in-position" + ], "attributes": { "start-date": { "type": "date", @@ -165,12 +167,16 @@ "predicate": "skos:prefLabel" } }, - "features": ["include-uri"], + "features": [ + "include-uri" + ], "new-resource-base": "http://data.vlaanderen.be/id/concept/MandatarisStatusCode/" }, "worship-mandatories": { "class": "ere:EredienstMandataris", - "super": ["mandatories"], + "super": [ + "mandatories" + ], "attributes": { "expected-end-date": { "type": "date", @@ -235,7 +241,9 @@ }, "mandates": { "class": "mandaat:Mandaat", - "super": ["posts"], + "super": [ + "posts" + ], "relationships": { "role-board": { "predicate": "org:role", @@ -259,7 +267,9 @@ }, "agents": { "class": "lblodlg:Functionaris", - "super": ["agents-in-position"], + "super": [ + "agents-in-position" + ], "attributes": { "start-date": { "type": "datetime", @@ -297,12 +307,16 @@ "predicate": "skos:prefLabel" } }, - "features": ["include-uri"], + "features": [ + "include-uri" + ], "new-resource-base": "http://data.vlaanderen.be/id/concept/functionarisStatusCode/" }, "board-positions": { "class": "lblodlg:Bestuursfunctie", - "super": ["posts"], + "super": [ + "posts" + ], "relationships": { "role-board": { "predicate": "org:role", @@ -433,7 +447,9 @@ }, "administrative-units": { "class": "besluit:Bestuurseenheid", - "super": ["organizations"], + "super": [ + "organizations" + ], "relationships": { "classification": { "predicate": "org:classification", @@ -481,7 +497,9 @@ }, "worship-administrative-units": { "class": "ere:EredienstBestuurseenheid", - "super": ["administrative-units"], + "super": [ + "administrative-units" + ], "relationships": { "recognized-worship-type": { "predicate": "ere:typeEredienst", @@ -504,7 +522,9 @@ }, "worship-services": { "class": "ere:BestuurVanDeEredienst", - "super": ["worship-administrative-units"], + "super": [ + "worship-administrative-units" + ], "attributes": { "denomination": { "type": "string", @@ -529,12 +549,16 @@ }, "central-worship-services": { "class": "ere:CentraalBestuurVanDeEredienst", - "super": ["worship-administrative-units"], + "super": [ + "worship-administrative-units" + ], "new-resource-base": "http://data.lblod.info/id/centraleBesturenVanDeEredienst/" }, "representative-bodies": { "class": "ere:RepresentatiefOrgaan", - "super": ["organizations"], + "super": [ + "organizations" + ], "relationships": { "recognized-worship-type": { "predicate": "ere:typeEredienst", @@ -765,7 +789,9 @@ "predicate": "skos:prefLabel" } }, - "features": ["include-uri"], + "features": [ + "include-uri" + ], "new-resource-base": "http://lblod.data.gift/concepts/" }, "locations": { @@ -818,7 +844,9 @@ }, "ministers": { "class": "ere:RolBedienaar", - "super": ["agents-in-position"], + "super": [ + "agents-in-position" + ], "relationships": { "minister-position": { "predicate": "org:holds", @@ -886,7 +914,9 @@ }, "minister-positions": { "class": "ere:PositieBedienaar", - "super": ["posts"], + "super": [ + "posts" + ], "relationships": { "function": { "predicate": "ere:functie", diff --git a/config/search-migrations/.gitignore b/config/search-migrations/.gitignore new file mode 100644 index 0000000..282b503 --- /dev/null +++ b/config/search-migrations/.gitignore @@ -0,0 +1 @@ +.migration_history diff --git a/data/db/virtuoso.ini b/config/search-migrations/.gitkeep old mode 100755 new mode 100644 similarity index 100% rename from data/db/virtuoso.ini rename to config/search-migrations/.gitkeep diff --git a/config/search-migrations/2023/20230307100012-change-event-move.json b/config/search-migrations/2023/20230307100012-change-event-move.json new file mode 100644 index 0000000..fb10102 --- /dev/null +++ b/config/search-migrations/2023/20230307100012-change-event-move.json @@ -0,0 +1,64 @@ +[ + { + "deletes": [ + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/besturenVanDeEredienst/e158c6378d3751b88df4a8c0c2b2f99a" + }, + "predicate": { + "type": "uri", + "value": "http://www.w3.org/ns/regorg#orgStatus" + }, + "object": { + "type": "uri", + "value": "http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6" + } + }, + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/besturenVanDeEredienst/8a90a8de8b1f6bb0a6ab29cf81428754" + }, + "predicate": { + "type": "uri", + "value": "http://www.w3.org/ns/regorg#orgStatus" + }, + "object": { + "type": "uri", + "value": "http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311" + } + } + ], + "inserts": [ + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/besturenVanDeEredienst/e158c6378d3751b88df4a8c0c2b2f99a" + }, + "predicate": { + "type": "uri", + "value": "http://www.w3.org/ns/regorg#orgStatus" + }, + "object": { + "type": "uri", + "value": "http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311" + } + }, + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/besturenVanDeEredienst/8a90a8de8b1f6bb0a6ab29cf81428754" + }, + "predicate": { + "type": "uri", + "value": "http://www.w3.org/ns/regorg#orgStatus" + }, + "object": { + "type": "uri", + "value": "http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6" + } + } + ] + } +] diff --git a/config/search/config.json b/config/search/config.json index 6649ae8..4b95f52 100644 --- a/config/search/config.json +++ b/config/search/config.json @@ -34,7 +34,7 @@ [ { "variables": [], - "name": "acmidm-beheerder" + "name": "acmidm-worship-lezer" }, { "variables": [], @@ -48,69 +48,7 @@ [ { "variables": [], - "name": "acmidm-beheerder" - }, - { - "variables": [], - "name": "acmidm-editeerder" - }, - { - "variables": [], - "name": "acmidm-lezer" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } - ], - [ - { - "variables": [], - "name": "acmidm-editeerder" - }, - { - "variables": [], - "name": "acmidm-lezer" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } - ], - [ - { - "variables": [], - "name": "acmidm-editeerder" - }, - { - "variables": [], - "name": "acmidm-beheerder" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } - ], - [ - { - "variables": [], - "name": "acmidm-lezer" - }, - { - "variables": [], - "name": "acmidm-beheerder" + "name": "acmidm-worship-editeerder" }, { "variables": [], @@ -122,19 +60,19 @@ } ] ], - "default_settings" : { + "default_settings": { "analysis": { "normalizer": { "custom_sort_normalizer": { - "type": "custom", - "char_filter": [], - "filter": [ - "lowercase", - "trim", - "asciifolding" - ] + "type": "custom", + "char_filter": [], + "filter": [ + "lowercase", + "trim", + "asciifolding" + ] } - } + } } }, "types": [ diff --git a/config/search/dev/config.json b/config/search/dev/config.json index 153ec14..22b117e 100644 --- a/config/search/dev/config.json +++ b/config/search/dev/config.json @@ -1,12 +1,12 @@ { "automatic_index_updates": true, "persist_indexes": true, - "number_of_threads": 8, + "number_of_threads": 6, "eager_indexing_groups": [ [ { "variables": [], - "name": "acmidm-lezer" + "name": "acmidm-worship-editeerder" }, { "variables": [], @@ -30,20 +30,6 @@ "variables": [], "name": "public" } - ], - [ - { - "variables": [], - "name": "acmidm-beheerder" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } ] ], "default_settings": { diff --git a/config/tlsproxy-mock/Caddyfile b/config/tlsproxy-mock/Caddyfile new file mode 100644 index 0000000..b041c33 --- /dev/null +++ b/config/tlsproxy-mock/Caddyfile @@ -0,0 +1,4 @@ +https://{$OP_ADDRESS} { + reverse_proxy identifier:80 + tls internal +} diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 5eecc28..52c53e8 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,4 +1,4 @@ -version: '3.4' +version: "3.4" services: identifier: @@ -17,6 +17,8 @@ services: volumes: - ./config/dev-migrations:/data/migrations/dev/ restart: "no" + migrations-triggering-indexing: + restart: "no" resource: restart: "no" cache: @@ -38,7 +40,9 @@ services: restart: "no" accountdetail: restart: "no" - privacy: + privacy-unit: + restart: "no" + privacy-worship: restart: "no" adressenregister: restart: "no" @@ -47,12 +51,6 @@ services: restart: "no" uri-info: restart: "no" - delta-producer-bg-jobs-initiator-administrative-units: - restart: "no" - delta-producer-pub-graph-maintainer-administrative-units: - restart: "no" - delta-producer-json-diff-publisher-administrative-units: - restart: "no" delta-producer-bg-jobs-initiator-organizations: restart: "no" delta-producer-pub-graph-maintainer-organizations: @@ -75,3 +73,13 @@ services: restart: "no" delta-producer-pub-graph-maintainer-worship-posts: restart: "no" + # use this to test acmidm + # tlsproxy: + # image: caddy:2 + # restart: "no" + # ports: + # - "443:443" + # environment: + # OP_ADDRESS: "organisaties.abb.lblod.info" + # volumes: + # - ./config/tlsproxy-mock/Caddyfile:/etc/caddy/Caddyfile diff --git a/docker-compose.yml b/docker-compose.yml index 2d3b4f0..aba21ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,6 +59,16 @@ services: - "logging=true" restart: always logging: *default-logging + migrations-triggering-indexing: + image: semtech/mu-migrations-service:0.8.0 + links: + - db:database + volumes: + - ./config/migrations-triggering-indexing:/data/migrations + labels: + - "logging=true" + restart: always + logging: *default-logging resource: image: semtech/mu-cl-resources:1.21.1 environment: @@ -138,14 +148,26 @@ services: - db:database restart: always logging: *default-logging - privacy: + privacy-worship: image: lblod/privacy-centric-service:0.6.0 labels: - "logging=true" environment: - DEFAULT_GRAPH: "http://mu.semte.ch/graphs/privacy-centric-graph" + DEFAULT_GRAPH: "http://mu.semte.ch/graphs/worship-privacy-centric-graph" SESSION_GRAPH: "http://mu.semte.ch/graphs/sessions" - APP_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + APP_GRAPH: "http://mu.semte.ch/graphs/public" + restart: always + logging: *default-logging + links: + - db:database + privacy-unit: + image: lblod/privacy-centric-service:0.6.0 + labels: + - "logging=true" + environment: + DEFAULT_GRAPH: "http://mu.semte.ch/graphs/administrative-unit-privacy-centric-graph" + SESSION_GRAPH: "http://mu.semte.ch/graphs/sessions" + APP_GRAPH: "http://mu.semte.ch/graphs/public" restart: always logging: *default-logging links: @@ -157,7 +179,7 @@ services: restart: always logging: *default-logging frontend: - image: lblod/frontend-organization-portal:1.14.0 + image: lblod/frontend-organization-portal:1.16.0-1 volumes: - ./config/frontend/add-x-frame-options-header.conf:/config/add-x-frame-options.conf environment: @@ -195,7 +217,7 @@ services: volumes: - ./config/jobs-controller/:/config/ construct-administrative-unit-relationships: - image: lblod/construct-administrative-unit-relationships-service:0.1.0 + image: lblod/construct-administrative-unit-relationships-service:0.1.1 links: - db:database restart: always @@ -217,77 +239,16 @@ services: restart: always logging: *default-logging ################################################################################ - # DELTA ADMINISTRATIVE-UNITS: START - ################################################################################ - delta-producer-bg-jobs-initiator-administrative-units: - image: lblod/delta-producer-background-jobs-initiator:0.3.1 - environment: - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" - DUMP_FILE_CREATION_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/administrative-units" - INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/administrative-units" - HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/administrative-units" - CRON_PATTERN_DUMP_JOB: "0 0 4 * * 6" # weekly on saturday - CRON_PATTERN_HEALING_JOB: "0 0 4 * * *" # everyday at 4 AM - START_INITIAL_SYNC: "false" # prefer to disable it now. We want to have feeling with how the DB acts. - labels: - - "logging=true" - links: - - db:database - restart: always - logging: *default-logging - delta-producer-pub-graph-maintainer-administrative-units: - image: lblod/delta-producer-publication-graph-maintainer:0.7.0 - environment: - MAX_BODY_SIZE: "50mb" - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" - RELATIVE_FILE_PATH: "deltas/administrative-units" - PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/administrative-units" - HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/administrative-units" - INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/administrative-units" - QUEUE_POLL_INTERVAL: 3000 - USE_VIRTUOSO_FOR_EXPENSIVE_SELECTS: "true" # some queries are just too expensive - SKIP_MU_AUTH_INITIAL_SYNC: "true" - HEALING_PATCH_GRAPH_BATCH_SIZE: 500 - volumes: - - ./config/delta-producer/administrative-units:/config - - ./data/files/:/share - links: - - db:database - - triplestore:virtuoso - restart: always - logging: *default-logging - delta-producer-json-diff-publisher-administrative-units: - image: lblod/delta-producer-json-diff-file-publisher:0.2.3 - environment: - MAX_BODY_SIZE: "50mb" - ERROR_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" - RELATIVE_FILE_PATH: "deltas/administrative-units" - PUBLISHER_URI: "http://data.lblod.info/services/delta-production-json-diff-file-manager/administrative-units" - PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/administrative-units" - DELTA_INTERVAL_MS: 10000 - PRETTY_PRINT_DIFF_JSON: "true" - volumes: - - ./data/files:/share - labels: - - "logging=true" - links: - - db:database - restart: always - logging: *default-logging - ################################################################################ - # DELTA ADMINISTRATIVE-UNITS: END - ################################################################################ - ################################################################################ # DELTA ORGANIZATIONS: START ################################################################################ delta-producer-bg-jobs-initiator-organizations: image: lblod/delta-producer-background-jobs-initiator:0.3.1 environment: - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" DUMP_FILE_CREATION_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/organizations" INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/organizations" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/organizations" - CRON_PATTERN_DUMP_JOB: "40 * * * *" # At minute 40 every hour + CRON_PATTERN_DUMP_JOB: "42 * * * *" # At minute 42 every hour CRON_PATTERN_HEALING_JOB: "0 0 4 * * *" # everyday at 4 AM START_INITIAL_SYNC: "false" # prefer to disable it now. We want to have feeling with how the DB acts. labels: @@ -300,7 +261,7 @@ services: image: lblod/delta-producer-publication-graph-maintainer:0.7.0 environment: MAX_BODY_SIZE: "50mb" - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" RELATIVE_FILE_PATH: "deltas/organizations" PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/organizations" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/organizations" @@ -309,8 +270,6 @@ services: USE_VIRTUOSO_FOR_EXPENSIVE_SELECTS: "true" # some queries are just too expensive SKIP_MU_AUTH_INITIAL_SYNC: "true" HEALING_PATCH_GRAPH_BATCH_SIZE: 500 - FILES_GRAPH: "http://redpencil.data.gift/id/deltas/producer/organizations-deltas" - ACCOUNT: "http://data.lblod.info/foaf/account/id/8df6f1e4-869f-4223-9834-961b01a7bd48" volumes: - ./config/delta-producer/organizations:/config - ./data/files/:/share @@ -323,7 +282,7 @@ services: image: lblod/delta-producer-json-diff-file-publisher:0.2.3 environment: MAX_BODY_SIZE: "50mb" - ERROR_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + ERROR_GRAPH: "http://mu.semte.ch/graphs/jobs" RELATIVE_FILE_PATH: "deltas/organizations" PUBLISHER_URI: "http://data.lblod.info/services/delta-production-json-diff-file-manager/organizations" PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/organizations" @@ -347,7 +306,7 @@ services: delta-producer-bg-jobs-initiator-public: image: lblod/delta-producer-background-jobs-initiator:0.3.1 environment: - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" DUMP_FILE_CREATION_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/public" INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/public" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/public" @@ -364,7 +323,7 @@ services: image: lblod/delta-producer-publication-graph-maintainer:0.15.1 environment: MAX_BODY_SIZE: "50mb" - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" RELATIVE_FILE_PATH: "deltas/public" PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/public" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/public" @@ -385,7 +344,7 @@ services: image: lblod/delta-producer-json-diff-file-publisher:0.2.3 environment: MAX_BODY_SIZE: "50mb" - ERROR_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + ERROR_GRAPH: "http://mu.semte.ch/graphs/jobs" RELATIVE_FILE_PATH: "deltas/public" PUBLISHER_URI: "http://data.lblod.info/services/delta-production-json-diff-file-manager/public" PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/public" @@ -409,7 +368,7 @@ services: delta-producer-bg-jobs-initiator-worship-posts: image: lblod/delta-producer-background-jobs-initiator:0.3.1 environment: - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" DUMP_FILE_CREATION_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/deltaDumpFileCreation/worship-posts" INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/initialPublicationGraphSyncing/worship-posts" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/worship-posts" @@ -423,10 +382,10 @@ services: restart: always logging: *default-logging delta-producer-pub-graph-maintainer-worship-posts: - image: lblod/delta-producer-publication-graph-maintainer:0.15.1 + image: lblod/delta-producer-publication-graph-maintainer:0.15.4 environment: MAX_BODY_SIZE: "50mb" - JOBS_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" RELATIVE_FILE_PATH: "deltas/worship-posts" PUBLICATION_GRAPH: "http://redpencil.data.gift/id/deltas/producer/worship-posts" HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/healingOperation/worship-posts" @@ -439,7 +398,7 @@ services: PUBLISHER_URI: "http://data.lblod.info/services/delta-production-json-diff-file-manager/worship-posts" DELTA_INTERVAL_MS: 10000 PRETTY_PRINT_DIFF_JSON: "true" - ERROR_GRAPH: "http://mu.semte.ch/graphs/organisatieportaal" + ERROR_GRAPH: "http://mu.semte.ch/graphs/jobs" volumes: - ./config/delta-producer/worship-posts:/config - ./data/files/:/share @@ -566,3 +525,21 @@ services: image: lblod/error-report-service:0.1.0 links: - db:database + + roles: + image: lblod/select-role-service + labels: + - "logging=true" + links: + - db:database + restart: always + logging: *default-logging + + ################################################################################### + # MU SCRIPTS + # ################################################################################# + project-scripts: + image: semtech/mu-scripts:1.0.0 + volumes: + - ./scripts/project:/app/scripts/ + restart: "no" diff --git a/scripts/project/config.json b/scripts/project/config.json new file mode 100644 index 0000000..2a8ae6f --- /dev/null +++ b/scripts/project/config.json @@ -0,0 +1,21 @@ +{ + "version": "0.1", + "scripts": [ + { + "documentation": { + "command": "mu-search-delta", + "description": "produce delta for mu-search", + "arguments": [] + }, + "environment": { + "image": "node:16", + "interactive": true, + "script": "mu-search-delta/build.sh", + "join_networks": true + }, + "mounts": { + "app": "/data/app/" + } + } + ] +} diff --git a/scripts/project/mu-search-delta/.gitignore b/scripts/project/mu-search-delta/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/scripts/project/mu-search-delta/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/scripts/project/mu-search-delta/README.md b/scripts/project/mu-search-delta/README.md new file mode 100644 index 0000000..4c4dc8f --- /dev/null +++ b/scripts/project/mu-search-delta/README.md @@ -0,0 +1,43 @@ +#### Scripts mu-search-delta +* make the script executable: `chmod a+x scripts/project/mu-search-delta/build.sh` +* add your delta messages in json format in `config/search-migrations`, e.g: + ```js + // config/search-migrations/2023/001-delete-bedinaeren.json + [ + { + "deletes": [ + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/mandatarissen/807a3e07c95fe40962d64695069af946" + }, + "predicate": { + "type": "uri", + "value": "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan" + }, + "object": { + "type": "uri", + "value": "http://data.lblod.info/id/personen/620523C451BFC225E4ECFA97" + } + }, + { + "subject": { + "type": "uri", + "value": "http://data.lblod.info/id/mandatarissen/40ed3cb19f9fa33e47b39016780dce1d" + }, + "predicate": { + "type": "uri", + "value": "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan" + }, + "object": { + "type": "uri", + "value": "http://data.lblod.info/id/personen/620523C451BFC225E4ECFA97" + } + } + ], + "inserts": [] + } + ] + ``` +* make sure virtuoso, mu-auth, elasticsearch & mu search are running +* run `mu script project-scripts mu-search-delta` diff --git a/scripts/project/mu-search-delta/build.sh b/scripts/project/mu-search-delta/build.sh new file mode 100755 index 0000000..ea8e121 --- /dev/null +++ b/scripts/project/mu-search-delta/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +mkdir -p /data/app/config/search-migrations +npm i +node script.mjs diff --git a/scripts/project/mu-search-delta/package-lock.json b/scripts/project/mu-search-delta/package-lock.json new file mode 100644 index 0000000..98598b8 --- /dev/null +++ b/scripts/project/mu-search-delta/package-lock.json @@ -0,0 +1,144 @@ +{ + "name": "mu-search-delta", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "mu-search-delta", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "node-fetch": "^3.3.0" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", + "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "engines": { + "node": ">= 8" + } + } + }, + "dependencies": { + "data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==" + }, + "fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "requires": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + } + }, + "formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "requires": { + "fetch-blob": "^3.1.2" + } + }, + "node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" + }, + "node-fetch": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", + "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" + } + } +} diff --git a/scripts/project/mu-search-delta/package.json b/scripts/project/mu-search-delta/package.json new file mode 100644 index 0000000..87120e8 --- /dev/null +++ b/scripts/project/mu-search-delta/package.json @@ -0,0 +1,14 @@ +{ + "name": "mu-search-delta", + "version": "1.0.0", + "description": "", + "main": "script.mjs", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Nordine Bittich", + "license": "MIT", + "dependencies": { + "node-fetch": "^3.3.0" + } +} diff --git a/scripts/project/mu-search-delta/script.mjs b/scripts/project/mu-search-delta/script.mjs new file mode 100644 index 0000000..1461ebd --- /dev/null +++ b/scripts/project/mu-search-delta/script.mjs @@ -0,0 +1,82 @@ +import fs from 'fs'; +import fetch from 'node-fetch'; +import path from 'path'; + +const CONFIG_PATH = process.env.SEARCH_CONFIG_PATH || '/data/app/config/search-migrations'; +const HISTORY_PATH = process.env.HISTORY_PATH || CONFIG_PATH + '/.migration_history'; +const MU_SEARCH_DELTA_URL = process.env.MU_SEARCH_DELTA_URL || 'http://search/update'; +const SEARCH_MIGRATIONS_DIR = process.env.SEARCH_MIGRATIONS_DIR || CONFIG_PATH; +const CONTENT_TYPE_JSON_API = { 'Content-Type': 'application/vnd.api+json' }; + +function read(fd, len) { + const buff = Buffer.alloc(len), + pos = 0, offset = 0; + fs.readSync(fd, buff, offset, len, pos); + return buff.toString(); +} + +function readDirRecursive(dir, filterHistory = [], filterExtensions = ["json"]) { + const files = fs.readdirSync(dir); + + const resultFiles = []; + + for (const file of files) { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + if (stat.isDirectory()) { + resultFiles.push(...(readDirRecursive(`${dir}/${file}`, filterHistory))); + } else if (filterExtensions.some((ext) => filePath.endsWith(ext)) && !filterHistory.includes(filePath)) { + resultFiles.push({ + time: stat.atimeMs, + file: filePath, + }); + } else { + console.log(`filter file ${filePath}`); + } + } + + return resultFiles.sort((a, b) => a.time - b.time); +} + +// main + +async function main() { + const historyFileDescriptor = fs.openSync(HISTORY_PATH, 'a+'); + const historyFileLen = fs.statSync(HISTORY_PATH).size; + + const history = read(historyFileDescriptor, historyFileLen) + .split(/\r?\n/) + .map((f) => f.trim()) + .filter((f) => f?.length); + + const fileNames = readDirRecursive(SEARCH_MIGRATIONS_DIR, history); + console.log(`processing ${fileNames.length} migration(s)`); + for (const { file } of fileNames) { + console.log(`Current file: ${file}`); + const payload = fs.readFileSync(file); + + try { + JSON.parse(payload); + } catch (e) { + console.error("Verify your migration. Exit..."); + process.exit(1); + } + + const r = await fetch(MU_SEARCH_DELTA_URL, { + method: "post", + body: payload, + headers: CONTENT_TYPE_JSON_API, + }); + console.log(`"[Delta]=> Status: ${r.status} `); + if (r.status == 200) { + const responseBody = await r.json(); + console.log(`response ${JSON.stringify(responseBody)}`); + fs.appendFileSync(HISTORY_PATH, file + '\n'); + } else { + console.error("an error occurred. check your migration, make sure mu search is running."); + process.exit(1); + } + } +} + +main().then(() => console.log("Done."));