diff --git a/.gitignore b/.gitignore index 2ec899d..a06be4d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ docker-compose.override.yml /config/migrations/private-data/* /config/migrations/local/* +/config/migrations-triggering-indexing/local/* /config/proxy/nginx.htpasswd diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ec5e10..312463d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,50 @@ # Changelog +## Unreleased + +## v1.30.0 (prerelease v1.30.0-0: 2025-02-18) +### Frontend +- Bump to version [v1.29.0](TODO: link to release) +### Backend +- Datafix: delete duplicate identifiers [OP-3157] +- Feature: replace different relations between organisations by memberships [OP-3195 (epic), OP-2606, OP-3156, OP-3198, OP-3199, OP-3258, OP-3259, OP-3260, OP-3265, OP-3293, OP-3305] +- Added `db-cleanup-service` to keep membership data backwards compatible [OP-3369] +- Datafix: delete incorrect change event [OP-3363] +- Feature: re-enable contact data editing [OP-3425] +- Remove gemeente and provincie classifications from admin unit graph [OP-3393] +- Remove several OCMW bcsd faciliteitgemeenten [OP-3535] +- Completely remove AGB Stekene's data. [OP-3409] +- Remove reasoner service, replaced by new consumer logic + +### Deploy Notes +- Before pulling the changes + + Shut down the reasoner and thank it for its good service: `drc down reasoner` +- Re-enable contact date editing: + + remove `EMBER_ENABLE_EDIT_CONTACT_DATA_FEATURE` flag in `docker-compose.override.yml` + + Stop and remove the `clb-contact-data-consumer` service + + Remove the `clb-contact-data-consumer` configuration in `docker-compose.override.yml` +- Rebuild the `search` service before starting the re-indexing +- To enable the membership functionality: + + Restart migration service + + Restart services for which the configuration was changed: `resource`, `dispatcher` and `db` + + Start the `db-cleanup-service` + + Pull and restart the frontend + + Perform a re-index using `reset-elastic.sh` script +#### Deploy commands +``` +drc down clb-contact-data-consumer +drc up -d search +drc restart migrations; drc logs -ft --tail=200 migrations +drc restart migrations-triggering-indexing && drc logs -ft --tail=200 migrations-triggering-indexing +drc restart resource dispatcher db +drc up -d db-cleanup-service +drc pull frontend; drc up -d frontend +./scripts/reset-elastic.sh +``` + ## 1.29.2 (2025-02-17) ### Data fix - - restore bestrokken lokale besturen that have been accidentally flushed [OP-3546] + - restore betrokken lokale besturen that have been accidentally flushed [OP-3546] + ## 1.29.1 (2025-02-14) ### Backend - re-init `worship-services-sensitive-consumer` [OP-3483] diff --git a/config/authorization/config.ex b/config/authorization/config.ex index 9baae38..1983140 100644 --- a/config/authorization/config.ex +++ b/config/authorization/config.ex @@ -79,6 +79,8 @@ defmodule Acl.UserGroups.Config do "http://www.w3.org/ns/org#ChangeEvent", "http://data.lblod.info/vocabularies/contacthub/AgentInPositie", "http://mu.semte.ch/vocabularies/ext/KboOrganisatie", + "http://www.w3.org/ns/org#Membership", + "http://www.w3.org/2006/time#ProperInterval" ] @shared_protected_type [ diff --git a/config/clb-consumer/contact-data/config.js b/config/clb-consumer/contact-data/config.js deleted file mode 100644 index 052d8f7..0000000 --- a/config/clb-consumer/contact-data/config.js +++ /dev/null @@ -1,30 +0,0 @@ -const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 1000; -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 || 100); -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); - -// Graphs -const LANDING_ZONE_GRAPH = process.env.DCR_LANDING_ZONE_GRAPH || `http://mu.semte.ch/graphs/landing-zone/clb-contact-data`; - -// ENDPOINTS -const LANDING_ZONE_DATABASE = process.env.DCR_LANDING_ZONE_DATABASE || 'database'; -const LANDING_ZONE_DATABASE_ENDPOINT = process.env.DCR_LANDING_ZONE_DATABASE_ENDPOINT || `http://${LANDING_ZONE_DATABASE}:8890/sparql`; - -module.exports = { - BATCH_SIZE, - MU_CALL_SCOPE_ID_INITIAL_SYNC, - BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, - DIRECT_DATABASE_ENDPOINT, - MAX_DB_RETRY_ATTEMPTS, - MAX_REASONING_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION, - LANDING_ZONE_GRAPH, - LANDING_ZONE_DATABASE_ENDPOINT -}; \ No newline at end of file diff --git a/config/clb-consumer/contact-data/delta-context-config.js b/config/clb-consumer/contact-data/delta-context-config.js deleted file mode 100644 index edbe30b..0000000 --- a/config/clb-consumer/contact-data/delta-context-config.js +++ /dev/null @@ -1,268 +0,0 @@ - -const PREFIXES = ` -PREFIX besluit: - PREFIX skos: - PREFIX lblodgeneriek: - PREFIX org: - PREFIX code: - PREFIX adms: - PREFIX generiek: - PREFIX ere: - PREFIX organisatie: - PREFIX mu: - PREFIX euvoc: - PREFIX prov: - PREFIX schema: - PREFIX locn: - PREFIX ext: ` - -const contextConfig = { - addTypes: { - scope: 'all', // 'inserts, 'deletes', 'all' or none. To add rdf:type to subjects of inserts, deletes or both - exhausitive: false, // true or false: find all types for a subject, even if one is already present in delta - }, - contextQueries: [ - { - trigger: { // subjectType or predicateValue - subjectType: "org:Site" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ${subject} ext:goesInGraph ?graphOne. - ${subject} ext:goesInGraph ?graphTwo. - ${subject} ext:goesInGraph ?graphThree. - ${subject} ext:goesInGraph ?graphFour. - } WHERE { - OPTIONAL { - GRAPH { - ?adminUnitOne org:hasPrimarySite ${subject}. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ?adminUnitTwo org:hasSite ${subject}. - } - BIND( AS ?graphTwo) - } - OPTIONAL { - GRAPH { - ?adminUnitThree org:hasPrimarySite ${subject}. - } - BIND( AS ?graphThree) - } - OPTIONAL { - GRAPH { - ?adminUnitFour org:hasSite ${subject}. - } - BIND( AS ?graphFour) - } - }` - }, - { - trigger: { // subjectType or predicateValue - subjectType: "schema:ContactPoint" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ${subject} ext:goesInGraph ?graphOne. - ${subject} ext:goesInGraph ?graphTwo. - } WHERE { - OPTIONAL { - GRAPH { - ?siteOne org:siteAddress ${subject}. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ?siteTwo org:siteAddress ${subject}. - } - BIND( AS ?graphTwo) - } - }` - }, - { - trigger: { // subjectType or predicateValue - subjectType: "locn:Address" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ${subject} ext:goesInGraph ?graphOne. - ${subject} ext:goesInGraph ?graphTwo. - } WHERE { - OPTIONAL { - GRAPH { - ?siteOne organisatie:bestaatUit ${subject}. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ?siteTwo organisatie:bestaatUit ${subject}. - } - BIND( AS ?graphTwo) - } - }` - }, - //Predicate triggers to solve out of order deltas - { - trigger: { // subjectType or predicateValue - predicateValue: "org:hasSite" - }, - //We assume that only administrative units are in the shared graph of OP due to the need of sharing the prefLabel with worships services - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ${subject} ext:goesInGraph ?graphOne. - ${subject} ext:goesInGraph ?graphTwo. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } WHERE { - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphTwo) - } - ${subject} org:hasSite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - }` - }, - { - trigger: { // subjectType or predicateValue - predicateValue: "org:hasPrimarySite" - }, - //We assume that only administrative units are in the shared graph of OP due to the need of sharing the prefLabel with worships services - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ${subject} ext:goesInGraph ?graphOne. - ${subject} ext:goesInGraph ?graphTwo. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } WHERE { - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphOne) - } - OPTIONAL { - GRAPH { - ${subject} a ?type. - } - BIND( AS ?graphTwo) - } - ${subject} org:hasPrimarySite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - }` - }, - { - trigger: { // subjectType or predicateValue - predicateValue: "org:siteAddress" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ?contact ?pContact ?oContact. - ?addressContact ?pAddressContact ?oAddressContact. - } WHERE { - ${subject} org:siteAddress ?contact. - ?contact ?pContact ?oContact. - OPTIONAL { - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - }` - }, - { - trigger: { // subjectType or predicateValue - predicateValue: "locn:address" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ?addressContact ?pAddressContact ?oAddressContact. - } WHERE { - ${subject} locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - }` - }, - { - trigger: { // subjectType or predicateValue - predicateValue: "organisatie:bestaatUit" - }, - queryTemplate: (subject) => ` - ${PREFIXES} - CONSTRUCT { - ?address ?pAddress ?oAddress. - } WHERE { - ${subject} organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - }` - } - ] -} - -module.exports = { - contextConfig, - PREFIXES -}; \ No newline at end of file diff --git a/config/clb-consumer/contact-data/delta-sync-dispatching.js b/config/clb-consumer/contact-data/delta-sync-dispatching.js deleted file mode 100644 index 5f8c603..0000000 --- a/config/clb-consumer/contact-data/delta-sync-dispatching.js +++ /dev/null @@ -1,104 +0,0 @@ -const { - deleteFromPublicGraph, - insertIntoPublicGraph, - deleteFromSpecificGraphs, - insertIntoSpecificGraphs -} = require('./util'); - -const { - LANDING_ZONE_GRAPH -} = require('./config') - -const publicTypes = [ - '' -] - -/** -* Dispatch the fetched information to a target graph. -* Note: will be ADDED to it's own graph. -* We take only care of adding them, not updating triples, this is a TODO -* @param { mu, muAuthSudo } lib - The provided libraries from the host service. -* @param { termObjectChangeSets: { deletes, inserts } } data - The fetched changes sets, which objects of serialized Terms -* [ { -* graph: "", -* subject: "", -* predicate: "", -* object: "^^" -* } -* ] -* @return {void} Nothing -*/ -async function dispatch(lib, data) { - let { termObjectChangeSets, termObjectChangeSetsWithContext } = data; - - // Both arrays are the same length, so we can zip them together for easier processing - zippedChangeSets = termObjectChangeSets.map((o, i) => ({ - original: o, - withContext: termObjectChangeSetsWithContext && termObjectChangeSetsWithContext[i] - })); - - console.log(`Received ${zippedChangeSets.length} change sets`) - - for (let { original, withContext } of zippedChangeSets) { - - const {public: insertsOnPublic, target: insertsOnGraphs} = separateBetweenTargetAndPublic(original.inserts, withContext.inserts) - const {public: deletesOnPublic, target: deletesOnGraphs} = separateBetweenTargetAndPublic(original.deletes, withContext.deletes) - - await deleteFromPublicGraph(lib, deletesOnPublic); - await deleteFromSpecificGraphs(lib, deletesOnGraphs); - await insertIntoPublicGraph(lib, insertsOnPublic); - await insertIntoSpecificGraphs(lib, insertsOnGraphs); - - } -} - -function separateBetweenTargetAndPublic(changes, context) { - const changesOnPublic = new Set(); - const changesOnGraphs = {}; - for(let change of changes) { - const subject = change.subject; - const contextTriples = context.filter((context) => context.subject === subject); - const graphTriple = contextTriples.find( - (context) => context.predicate === '' - && context.object !== `<${LANDING_ZONE_GRAPH}>` - ) - const otherContextTriples = context.filter( - (context) => context.predicate !== '' - && context.predicate !== '' - && !(context.subject === subject && context.predicate === '') - ); - if(graphTriple) { - const graph = graphTriple.object.slice(1,-1); // We have to slice it to remove the "<" and ">" - if(change.object !== '') { - if(!changesOnGraphs[graph]) { - changesOnGraphs[graph] = new Set(); - } - changesOnGraphs[graph].add(`${change.subject} ${change.predicate} ${change.object}.`) - } - for(let triple of otherContextTriples) { - if(triple.object === '') continue; - if(!changesOnGraphs[graph]) { - changesOnGraphs[graph] = new Set(); - } - changesOnGraphs[graph].add(`${triple.subject} ${triple.predicate} ${triple.object}.`) - } - } - const typeTriple = contextTriples.find( - (context) => context.subject === subject - && context.predicate === '' - ); - if(!typeTriple) continue; - const type = typeTriple.object; - if(publicTypes.includes(type)) { - changesOnPublic.add(`${change.subject} ${change.predicate} ${change.object}.`) - for(let triple of otherContextTriples) { - changesOnPublic.add(`${triple.subject} ${triple.predicate} ${triple.object}.`) - } - } - } - return {public: changesOnPublic, target: changesOnGraphs} -} - -module.exports = { - dispatch -}; \ No newline at end of file diff --git a/config/clb-consumer/contact-data/initial-sync-dispatching.js b/config/clb-consumer/contact-data/initial-sync-dispatching.js deleted file mode 100644 index d3b037f..0000000 --- a/config/clb-consumer/contact-data/initial-sync-dispatching.js +++ /dev/null @@ -1,69 +0,0 @@ -const { batchedDbUpdate, moveDataAfterInitialSync } = require('./util'); -const { - BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES, - DIRECT_DATABASE_ENDPOINT, - MU_CALL_SCOPE_ID_INITIAL_SYNC, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - LANDING_ZONE_GRAPH, -} = require('./config'); - -const endpoint = BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES ? DIRECT_DATABASE_ENDPOINT : process.env.MU_SPARQL_ENDPOINT; - -/** -* Dispatch the fetched information to a target graph. -* @param { mu, muAuthSudo } lib - The provided libraries from the host service. -* @param { termObjects } data - The fetched quad information, which objects of serialized Terms -* [ { -* graph: "", -* subject: "", -* predicate: "", -* object: "^^" -* } -* ] -* @return {void} Nothing -*/ -async function dispatch(lib, data) { - const { mu, muAuthSudo } = lib; - const { termObjects } = data; - - // Steps: - // 1. Write the triples to the landing zone graph - without any mapping or filtering - // 2. One-time reasoning run with the full landing zone graph and write the results to the target graph (on-finish) - - if (BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES) { - console.warn(`Service configured to skip MU_AUTH!`); - } - console.log(`Using ${endpoint} to insert triples`); - - if (termObjects.length) { - const originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`); - - await batchedDbUpdate( - muAuthSudo.updateSudo, - LANDING_ZONE_GRAPH, - originalInsertTriples, - { '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 - ); - } -} - -async function onFinishInitialIngest(lib,data) { - const { muAuthSudo } = lib; - - console.log(`!! On-finish triggered !!`); - - await moveDataAfterInitialSync(muAuthSudo.updateSudo, endpoint) -} - -module.exports = { - dispatch, - onFinishInitialIngest -}; \ No newline at end of file diff --git a/config/clb-consumer/contact-data/util.js b/config/clb-consumer/contact-data/util.js deleted file mode 100644 index 1e47cc5..0000000 --- a/config/clb-consumer/contact-data/util.js +++ /dev/null @@ -1,337 +0,0 @@ -const { - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - LANDING_ZONE_GRAPH, - BATCH_SIZE, -} = require('./config'); - -const prefixes = ` -PREFIX besluit: -PREFIX skos: -PREFIX lblodgeneriek: -PREFIX org: -PREFIX code: -PREFIX adms: -PREFIX generiek: -PREFIX ere: -PREFIX organisatie: -PREFIX mu: -PREFIX euvoc: -PREFIX prov: -PREFIX schema: -PREFIX locn: -PREFIX foaf: -PREFIX ext: -` - -async function batchedDbUpdate( - muUpdate, - graph, - triples, - extraHeaders, - endpoint, - batchSize, - maxAttempts, - sleepBetweenBatches = 1000, - sleepTimeOnFail = 1000, - operation = 'INSERT' -) { - for (let i = 0; i < triples.length; i += batchSize) { - console.log(`Inserting triples in batch: ${i}-${i + batchSize}`); - - const batch = triples.slice(i, i + batchSize).join('\n'); - - const insertCall = async () => { - await muUpdate(` -${operation} DATA { -GRAPH <${graph}> { -${batch} -} -} -`, extraHeaders, endpoint); - }; - - await operationWithRetry(insertCall, 0, maxAttempts, sleepTimeOnFail); - - console.log(`Sleeping before next query execution: ${sleepBetweenBatches}`); - await new Promise(r => setTimeout(r, sleepBetweenBatches)); - } -} - -async function operationWithRetry(callback, - attempt, - maxAttempts, - sleepTimeOnFail) { - try { - if (typeof callback === "function") - return await callback(); - else // Catch error from promise - not how I would do it normally, but allows re use of existing code. - return await callback; - } - catch (e) { - console.log(`Operation failed for ${callback.toString()}, attempt: ${attempt} of ${maxAttempts}`); - console.log(`Error: ${e}`); - console.log(`Sleeping ${sleepTimeOnFail} ms`); - - if (attempt >= maxAttempts) { - console.log(`Max attempts reached for ${callback.toString()}, giving up`); - throw e; - } - - await new Promise(r => setTimeout(r, sleepTimeOnFail)); - return operationWithRetry(callback, ++attempt, maxAttempts, sleepTimeOnFail); - } -} - - -async function insertIntoPublicGraph(lib, statements) { - console.log(`Inserting ${statements.length} statements into public graph`); - - await batchedDbUpdate( - lib.muAuthSudo.updateSudo, - 'http://mu.semte.ch/graphs/public', - Array.from(statements), - {}, - process.env.MU_SPARQL_ENDPOINT, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - 'INSERT'); -} - -async function insertIntoSpecificGraphs(lib, statementsWithGraphs) { - - for( let graph in statementsWithGraphs) { - console.log(`Inserting ${statementsWithGraphs[graph].length} statements into ${graph} graph`); - await batchedDbUpdate( - lib.muAuthSudo.updateSudo, - graph, - Array.from(statementsWithGraphs[graph]), - {}, - process.env.MU_SPARQL_ENDPOINT, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - 'INSERT'); - } - -} - -async function deleteFromPublicGraph(lib, statements) { - console.log(`Deleting ${statements.length} statements from public graph`); - - await batchedDbUpdate( - lib.muAuthSudo.updateSudo, - 'http://mu.semte.ch/graphs/public', - Array.from(statements), - {}, - process.env.MU_SPARQL_ENDPOINT, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - 'DELETE'); -} - -async function deleteFromSpecificGraphs(lib, statementsWithGraphs) { - - - for( let graph in statementsWithGraphs) { - console.log(`Deleting ${statementsWithGraphs[graph].length} statements from ${graph} graph`); - await batchedDbUpdate( - lib.muAuthSudo.updateSudo, - graph, - Array.from(statementsWithGraphs[graph]), - {}, - process.env.MU_SPARQL_ENDPOINT, - BATCH_SIZE, - MAX_DB_RETRY_ATTEMPTS, - SLEEP_BETWEEN_BATCHES, - SLEEP_TIME_AFTER_FAILED_DB_OPERATION, - 'DELETE'); - } - -} - - -async function moveDataAfterInitialSync(muUpdate, endpoint) { - // Move primary sites admin units - await muUpdate(` - ${prefixes} - INSERT { - GRAPH { - ?adminUnit org:hasPrimarySite ?site. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } - } WHERE { - GRAPH { - ?adminUnit a ?type. - } - GRAPH <${LANDING_ZONE_GRAPH}> { - ?adminUnit org:hasPrimarySite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - } - } - `, undefined, endpoint) - - // Move sites administrative units - await muUpdate(` - ${prefixes} - INSERT { - GRAPH { - ?adminUnit org:hasSite ?site. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } - } WHERE { - GRAPH { - ?adminUnit a ?type. - } - GRAPH <${LANDING_ZONE_GRAPH}> { - ?adminUnit org:hasSite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - } - } - `, undefined, endpoint) - - // Move primary sites worships - await muUpdate(` - ${prefixes} - INSERT { - GRAPH { - ?adminUnit org:hasPrimarySite ?site. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } - } WHERE { - GRAPH { - ?adminUnit a ?type. - } - GRAPH <${LANDING_ZONE_GRAPH}> { - ?adminUnit org:hasPrimarySite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - } - } - `, undefined, endpoint) - - // Move sites worships - await muUpdate(` - ${prefixes} - INSERT { - GRAPH { - ?adminUnit org:hasSite ?site. - ?site ?pSite ?oSite. - ?contact ?pContact ?oContact. - ?address ?pAddress ?oAddress. - ?addressContact ?pAddressContact ?oAddressContact. - } - } WHERE { - GRAPH { - ?adminUnit a ?type. - } - GRAPH <${LANDING_ZONE_GRAPH}> { - ?adminUnit org:hasSite ?site. - ?site ?pSite ?oSite. - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - ?contact locn:address ?addressContact. - ?addressContact ?pAddressContact ?oAddressContact. - } - UNION - { - ?site org:siteAddress ?contact. - ?contact ?pContact ?oContact. - } - UNION - { - ?site organisatie:bestaatUit ?address. - ?address ?pAddress ?oAddress. - } - } - } - `, undefined, endpoint) - - // Move sites worships - await muUpdate(` - ${prefixes} - INSERT { - GRAPH { - ?type a . - ?type ?a ?b. - } - } WHERE { - GRAPH <${LANDING_ZONE_GRAPH}> { - ?type a . - ?type ?a ?b. - } - } - `, undefined, endpoint) -} - -module.exports = { - batchedDbUpdate, - moveDataAfterInitialSync, - insertIntoPublicGraph, - deleteFromPublicGraph, - insertIntoSpecificGraphs, - deleteFromSpecificGraphs, -}; \ No newline at end of file diff --git a/config/dev-migrations/20241003152155-remove-invalid-generic-memberships.sparql b/config/dev-migrations/20241003152155-remove-invalid-generic-memberships.sparql new file mode 100644 index 0000000..9d8bca3 --- /dev/null +++ b/config/dev-migrations/20241003152155-remove-invalid-generic-memberships.sparql @@ -0,0 +1,31 @@ +PREFIX org: + +DELETE { + GRAPH { + ?membership ?p ?o . + } +} WHERE { + GRAPH { + ?membership a org:Membership ; + org:member ?member ; + org:organization ?organization ; + org:role ; # has a relation with + ?p ?o . + + ?organization org:classification ?organizationClass . + FILTER (?organizationClass IN + ( + , # HVZ + , # APB + , # Dienstverlenende vereniging + , # Opdrachthoudende vereniging + , # Opdrachthoudende vereniging met private deelname + , # Projectvereniging + , # Politiezone + , # Autonome verzorgingsinstelling + , # AGB + # Welzijnsvereniging + ) + ) + } +} diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index d3d2574..a58f69a 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -1,364 +1,387 @@ defmodule Dispatcher do use Matcher - define_accept_types [ + define_accept_types( html: ["text/html", "application/xhtml+html"], json: ["application/json", "application/vnd.api+json"], upload: ["multipart/form-data"], sparql_json: ["application/sparql-results+json"], - any: [ "*/*" ], - ] - - define_layers [ :api_services, :api, :frontend, :not_found ] + any: ["*/*"] + ) + define_layers([:api_services, :api, :frontend, :not_found]) ############################################################### # domain.json ############################################################### - match "/people/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/people/" + match "/people/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/people/") end - match "/agents-in-position/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/agents-in-position/" + match "/agents-in-position/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/agents-in-position/") end - match "/posts/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/posts/" + match "/posts/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/posts/") end - match "/mandatories/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/mandatories/" + match "/mandatories/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/mandatories/") end - match "/mandatory-status-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/mandatory-status-codes/" + match "/mandatory-status-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/mandatory-status-codes/") end - match "/worship-mandatories/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/worship-mandatories/" + match "/worship-mandatories/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/worship-mandatories/") end - match "/half-elections/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/half-elections/" + match "/half-elections/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/half-elections/") end - match "/contact-points/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/contact-points/" + match "/contact-points/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/contact-points/") end - match "/mandates/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/mandates/" + match "/mandates/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/mandates/") end - match "/board-positions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/board-positions/" + match "/board-positions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/board-positions/") end - match "/board-position-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/board-position-codes/" + match "/board-position-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/board-position-codes/") end - match "/functionaries/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/functionaries/" + match "/functionaries/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/functionaries/") end - match "/agent-status-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/agent-status-codes/" + match "/agent-status-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/agent-status-codes/") end - match "/roles/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/roles/" + match "/roles/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/roles/") end - match "/organizations/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/organizations/" + match "/organizations/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/organizations/") end - match "/registered-organizations/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/registered-organizations/" + match "/registered-organizations/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/registered-organizations/") end - match "/administrative-units/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/administrative-units/" + match "/administrative-units/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/administrative-units/") end - match "/administrative-unit-classification-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/administrative-unit-classification-codes/" + match "/administrative-unit-classification-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/administrative-unit-classification-codes/") end - match "/organization-classification-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/organization-classification-codes/" + match "/organization-classification-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/organization-classification-codes/") end - match "/registered-organization-classification-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/registered-organization-classification-codes/" + match "/registered-organization-classification-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/registered-organization-classification-codes/") end - match "/worship-administrative-units/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/worship-administrative-units/" + match "/worship-administrative-units/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/worship-administrative-units/") end - match "/worship-services/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/worship-services/" + match "/worship-services/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/worship-services/") end - match "/recognized-worship-types/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/recognized-worship-types/" + match "/recognized-worship-types/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/recognized-worship-types/") end - match "/central-worship-services/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/central-worship-services/" + match "/central-worship-services/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/central-worship-services/") end - match "/representative-bodies/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/representative-bodies/" + match "/representative-bodies/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/representative-bodies/") end - match "/governing-bodies/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/governing-bodies/" + match "/governing-bodies/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/governing-bodies/") end - match "/governing-body-classification-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/governing-body-classification-codes/" + match "/governing-body-classification-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/governing-body-classification-codes/") end - match "/local-involvements/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/local-involvements/" + match "/local-involvements/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/local-involvements/") end - match "/identifiers/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/identifiers/" + match "/identifiers/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/identifiers/") end - match "/structured-identifiers/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/structured-identifiers/" + match "/structured-identifiers/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/structured-identifiers/") end - match "/addresses/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/addresses/" + match "/addresses/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/addresses/") end - match "/sites/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/sites/" + match "/sites/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/sites/") end - match "/change-events/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/change-events/" + match "/change-events/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/change-events/") end - match "/change-event-types/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/change-event-types/" + match "/change-event-types/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/change-event-types/") end - match "/change-event-results/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/change-event-results/" + match "/change-event-results/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/change-event-results/") end - match "/organization-status-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/organization-status-codes/" + match "/organization-status-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/organization-status-codes/") end - match "/locations/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/locations/" + match "/locations/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/locations/") end - match "/involvement-types/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/involvement-types/" + match "/involvement-types/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/involvement-types/") end - match "/ministers/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/ministers/" + match "/ministers/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/ministers/") end - match "/minister-conditions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/minister-conditions/" + match "/minister-conditions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/minister-conditions/") end - match "/dates-of-birth/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/dates-of-birth/" + match "/dates-of-birth/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/dates-of-birth/") end - match "/nationalities/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/nationalities/" + match "/nationalities/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/nationalities/") end - match "/gender-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/gender-codes/" - end - match "/concepts/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/concepts/" + match "/gender-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/gender-codes/") end - match "/minister-positions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/minister-positions/" + match "/concepts/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/concepts/") end - match "/minister-position-functions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/minister-position-functions/" + match "/minister-positions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/minister-positions/") end - match "/financing-codes/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/financing-codes/" + match "/minister-position-functions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/minister-position-functions/") end - match "/minister-condition-criterions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/minister-condition-criterions/" + match "/financing-codes/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/financing-codes/") end - match "/document-types-criterions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/document-types-criterions/" + match "/minister-condition-criterions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/minister-condition-criterions/") end - match "/site-types/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/site-types/" + match "/document-types-criterions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/document-types-criterions/") end - match "/request-reasons/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/request-reasons/" + match "/site-types/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/site-types/") end - match "/decisions/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/decisions/" + match "/request-reasons/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/request-reasons/") end - match "/decision-activities/*path", %{ accept: [:json], layer: :api} do - Proxy.forward conn, path, "http://cache/decision-activities/" + match "/decisions/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/decisions/") + end + + match "/decision-activities/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/decision-activities/") + end + + match "/memberships/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/memberships/") + end + + match "/membership-roles/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://cache/membership-roles/") end # There is currently no logic to invalidate the kboOrganization cache when wegwijse updates the content - match "/kbo-organizations/*path", %{ accept: [:any], layer: :api} do - Proxy.forward conn, path, "http://resource/kbo-organizations/" + match "/kbo-organizations/*path", %{accept: [:any], layer: :api} do + Proxy.forward(conn, path, "http://resource/kbo-organizations/") end ############### # LOGIN ############### - match "/accounts", %{ accept: [:json], layer: :api} do - 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/" + match "/accounts", %{accept: [:json], layer: :api} do + Proxy.forward(conn, [], "http://resource/accounts/") end - match "/mock/sessions/*path", %{ accept: [:any], layer: :api} do - Proxy.forward conn, path, "http://mocklogin/sessions/" + match "/accounts/*path", %{accept: [:json], layer: :api} do + Proxy.forward(conn, path, "http://accountdetail/accounts/") end - match "/sessions/*path", %{ accept: [:any], layer: :api} do - Proxy.forward conn, path, "http://login/sessions/" + 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 + + match "/mock/sessions/*path", %{accept: [:any], layer: :api} do + Proxy.forward(conn, path, "http://mocklogin/sessions/") + end + + match "/sessions/*path", %{accept: [:any], layer: :api} do + Proxy.forward(conn, path, "http://login/sessions/") end ############################################################### # SEARCH ############################################################### - match "/search/*path", %{ accept: %{ json: true }, layer: :api_services} do - Proxy.forward conn, path, "http://search/" + match "/search/*path", %{accept: %{json: true}, layer: :api_services} do + Proxy.forward(conn, path, "http://search/") end ############### # API SERVICES ############### - match "/v3/api-docs/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://kalliope-api/v3/api-docs/" + match "/v3/api-docs/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://kalliope-api/v3/api-docs/") end - match "/consolidated/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://kalliope-api/consolidated/" + match "/consolidated/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://kalliope-api/consolidated/") end - match "/adresses-register/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://adressenregister/" + match "/adresses-register/*path", %{layer: :api_services, accept: %{json: true}} 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" + 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" + 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/" + 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/" + 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-unit/person-information-updates" + match "/person-information-updates/*path", %{layer: :api_services, accept: %{json: true}} do + 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-unit/person-information-requests" + match "/person-information-requests/*path", %{layer: :api_services, accept: %{json: true}} do + 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-unit/person-information-ask/" + match "/person-information-ask/*path", %{layer: :api_services, accept: %{json: true}} do + 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-unit/person-information-validate-ssn/" + match "/person-information-validate-ssn/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://privacy-unit/person-information-validate-ssn/") end - get "/uri-info/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://uri-info/" + get "/uri-info/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://uri-info/") end - post "/construct-organization-relationships/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://construct-organization-relationships/create-relationships/" + post "/construct-organization-relationships/*path", %{ + layer: :api_services, + accept: %{json: true} + } do + forward(conn, path, "http://construct-organization-relationships/create-relationships/") end - post "/kbo-data-sync/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://kbo-data-sync/sync-kbo-data/" + post "/kbo-data-sync/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://kbo-data-sync/sync-kbo-data/") end - get "/ldes/*path", %{ layer: :api_services } do - forward conn, path, "http://ldes-backend/" + get "/ldes/*path", %{layer: :api_services} do + forward(conn, path, "http://ldes-backend/") end ################################################################# # ERROR REPORT ################################################################# - match "/error-reports/*path", %{ layer: :api_services, accept: %{ json: true } } do - forward conn, path, "http://error-report-service/error-reports/" + match "/error-reports/*path", %{layer: :api_services, accept: %{json: true}} do + forward(conn, path, "http://error-report-service/error-reports/") end ################################################################# # FILES ################################################################# - get "/files/:id/download", %{ accept: [:any], } do - Proxy.forward conn, [], "http://file/files/" <> id <> "/download" + get "/files/:id/download", %{accept: [:any]} do + Proxy.forward(conn, [], "http://file/files/" <> id <> "/download") end - get "/files/*path" , %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://resource/files/" + get "/files/*path", %{layer: :api_services, accept: %{json: true}} do + Proxy.forward(conn, path, "http://resource/files/") end ################################################################# # DCAT ################################################################# - get "/datasets/*path", %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://resource/datasets/" + get "/datasets/*path", %{layer: :api_services, accept: %{json: true}} do + Proxy.forward(conn, path, "http://resource/datasets/") end - get "/distributions/*path", %{ layer: :api_services, accept: %{ json: true } } do - Proxy.forward conn, path, "http://resource/distributions/" + get "/distributions/*path", %{layer: :api_services, accept: %{json: true}} do + Proxy.forward(conn, path, "http://resource/distributions/") end ################################################################# @@ -398,44 +421,42 @@ defmodule Dispatcher do ################################################################# get "/download-exports/*path" do - Proxy.forward conn, path, "http://download-exports/" + Proxy.forward(conn, path, "http://download-exports/") end ############################################################### # frontend layer ############################################################### - match "/assets/*path", %{ layer: :api } do - Proxy.forward conn, path, "http://frontend/assets/" + match "/assets/*path", %{layer: :api} do + Proxy.forward(conn, path, "http://frontend/assets/") end - match "/@appuniversum/*path", %{ layer: :api } do - Proxy.forward conn, path, "http://frontend/@appuniversum/" + match "/@appuniversum/*path", %{layer: :api} do + Proxy.forward(conn, path, "http://frontend/@appuniversum/") end - match "/*path", %{ accept: [:html], layer: :api } do - Proxy.forward conn, [], "http://frontend/index.html" + match "/*path", %{accept: [:html], layer: :api} do + Proxy.forward(conn, [], "http://frontend/index.html") end - match "/*_path", %{ layer: :frontend } do - Proxy.forward conn, [], "http://frontend/index.html" + match "/*_path", %{layer: :frontend} do + Proxy.forward(conn, [], "http://frontend/index.html") end ############################################################### # sparql endpoint ############################################################### - post "/sparql/*path", %{ layer: :api_services, accept: %{ sparql_json: true } } do - forward conn, path, "http://db:8890/sparql/" + post "/sparql/*path", %{layer: :api_services, accept: %{sparql_json: true}} do + forward(conn, path, "http://db:8890/sparql/") end ############################################################### # errors ############################################################### - match "/*_path", %{ accept: [:any], layer: :not_found} do - send_resp( conn, 404, "{\"error\": {\"code\": 404}") + match "/*_path", %{accept: [:any], layer: :not_found} do + send_resp(conn, 404, "{\"error\": {\"code\": 404}") end - - end diff --git a/config/migrations-triggering-indexing/2024/20241212174128-archive-agb-stekene.sparql b/config/migrations-triggering-indexing/2024/20241212174128-archive-agb-stekene.sparql new file mode 100644 index 0000000..53798d4 --- /dev/null +++ b/config/migrations-triggering-indexing/2024/20241212174128-archive-agb-stekene.sparql @@ -0,0 +1,15 @@ +DELETE { + GRAPH ?g { + ?orgStatus . + } +} +INSERT { + GRAPH ?g { + . + } +} +WHERE { + GRAPH ?g { + ?orgStatus . + } +} diff --git a/config/migrations-triggering-indexing/2025/20250109200145-archive-agb-stekene.sparql b/config/migrations-triggering-indexing/2025/20250109200145-archive-agb-stekene.sparql new file mode 100644 index 0000000..dbceb14 --- /dev/null +++ b/config/migrations-triggering-indexing/2025/20250109200145-archive-agb-stekene.sparql @@ -0,0 +1,196 @@ +DELETE { + GRAPH { + ?bestuursorganen ?bestuursorganenP ?bestuursorganenO . + } +} +WHERE { + VALUES ?bestuursorganen { + + + + + } + + GRAPH { + ?bestuursorganen ?bestuursorganenP ?bestuursorganenO . + } +} + +; + +DELETE { + GRAPH { + ?bestuursorganenInTijd ?bestuursorganenInTijdP ?bestuursorganenInTijdO . + } +} +WHERE { + VALUES ?bestuursorganenInTijd { + + + + + } + + GRAPH { + ?bestuursorganenInTijd ?bestuursorganenInTijdP ?bestuursorganenInTijdO . + } +} + +; + +DELETE { + GRAPH { + ?identifier ?identifierP ?identifierO . + } +} +WHERE { + VALUES ?identifier { + + + + } + + GRAPH { + ?identifier ?identifierP ?identifierO . + } +} + +; + +DELETE { + GRAPH { + ?structuredIdentifier ?structuredIdentifierP ?structuredIdentifierO . + } +} +WHERE { + VALUES ?structuredIdentifier { + + + + } + + GRAPH { + ?structuredIdentifier ?structuredIdentifierP ?structuredIdentifierO . + } +} + +; + +DELETE { + GRAPH { + ?site ?siteP ?siteO . + } +} +WHERE { + VALUES ?site { + + } + + GRAPH { + ?site ?siteP ?siteO . + } +} + +; + +DELETE { + GRAPH { + ?address ?addressP ?addressO . + } +} +WHERE { + VALUES ?address { + + } + + GRAPH { + ?address ?addressP ?addressO . + } +} + +; + +DELETE { + GRAPH { + ?contactPoint ?contactPointP ?contactPointO . + } +} +WHERE { + VALUES ?contactPoint { + + + } + + GRAPH { + ?contactPoint ?contactPointP ?contactPointO . + } +} + +; + +DELETE { + GRAPH { + ?parentOrganization ?organization . + } +} +WHERE { + BIND( AS ?organization) + BIND( AS ?parentOrganization) + + GRAPH { + ?parentOrganization ?organization . + } +} + +; + +DELETE { + GRAPH { + ?parentOrganization ?organization . + } +} +WHERE { + BIND( AS ?organization) + BIND( AS ?parentOrganization) + + GRAPH { + ?parentOrganization ?organization . + } +} + +; + +DELETE { + GRAPH { + ?membership ?p ?o. + } +} +WHERE { + BIND( AS ?organization) + + VALUES ?membershipP { + + + } + + GRAPH { + ?membership a ; + ?membershipP ?organization ; + ?p ?o . + } +} + +; + +DELETE { + GRAPH { + ?organization ?organizationP ?organizationO . + } +} +WHERE { + BIND( AS ?organization) + + GRAPH { + ?organization ?organizationP ?organizationO . + } +} diff --git a/config/migrations-triggering-indexing/local/.gitkeep b/config/migrations-triggering-indexing/local/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/migrations-triggering-indexing/local/README.md b/config/migrations-triggering-indexing/local/README.md new file mode 100644 index 0000000..6bf75c7 --- /dev/null +++ b/config/migrations-triggering-indexing/local/README.md @@ -0,0 +1,3 @@ +# Motivation + +This folder is designed to contain migration files specific to a specific deployed instance of the app. These files will be ignored by git. The typical use case for this folder includes migrations containing sensitive data or those related to a re-sync of consumers. Migrations that should be applied to all instances of the app should be stored outside of this folder, but within the 'migrations-triggering-indexing' folder. diff --git a/config/migrations/20240619123310-remove-kbo-organizations-from-participation-relation.sparql b/config/migrations/2024/20240619123310-remove-kbo-organizations-from-participation-relation.sparql similarity index 100% rename from config/migrations/20240619123310-remove-kbo-organizations-from-participation-relation.sparql rename to config/migrations/2024/20240619123310-remove-kbo-organizations-from-participation-relation.sparql diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.graph b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.graph new file mode 100644 index 0000000..d5c0765 --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public \ No newline at end of file diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.ttl b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.ttl new file mode 100644 index 0000000..194ee7a --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112500-codelist-lidmaatschap-rollen.ttl @@ -0,0 +1,31 @@ +@prefix org: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix schema: . +@prefix skos: . +@prefix mu: . + + a skos:ConceptScheme; + mu:uuid "4755a6afc9044ff289d872092e202472"; + skos:prefLabel "lidmaatschap rollen". + + a org:Role; + mu:uuid "93c48754610c45e6bd9a894d2720a53d"; + skos:topConceptOf ; + skos:prefLabel "lid". + + a org:Role; + mu:uuid "73d5e1cf250d42fab15926771f07505a"; + skos:prefLabel "stichtend lid"; + skos:broader . + + a org:Role; + mu:uuid "2152eb830b1143bfb97a7dd9596d6c63"; + skos:prefLabel "participant"; + skos:broader . + + a org:Role; + mu:uuid "4ec7d5c39bdc4e84b4174379b9e22ad8"; + skos:prefLabel "gerelateerd"; + skos:broader . diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112600-founding-members.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112600-founding-members.sparql new file mode 100644 index 0000000..d06fdb9 --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112600-founding-members.sparql @@ -0,0 +1,35 @@ +PREFIX skos: +PREFIX org: +PREFIX mu: +PREFIX ext: + +DELETE { + GRAPH ?g { + ?foundingOrg ext:isFounderOfOrganization ?foundedOrg . + } +} +INSERT { + GRAPH ?g { + ?foundingOrg org:memberOf ?foundedOrg . + + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?foundedOrg ; + org:member ?foundingOrg ; + org:role . # stichtend lid + } +} +WHERE { + VALUES ?g { + + + + } + + GRAPH ?g { + ?foundingOrg ext:isFounderOfOrganization ?foundedOrg . + } + + BIND(SHA1(CONCAT(STR(?foundingOrg), STR(?foundedOrg), "founded by")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} \ No newline at end of file diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112700-participants.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112700-participants.sparql new file mode 100644 index 0000000..cc74428 --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112700-participants.sparql @@ -0,0 +1,32 @@ +PREFIX skos: +PREFIX org: +PREFIX mu: + +DELETE { + GRAPH ?g { + ?memberOrganization org:memberOf ?organization . + } +} +INSERT { + GRAPH ?g { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?organization ; + org:member ?memberOrganization ; + org:role . # participant + } +} +WHERE { + VALUES ?g { + + + + } + + GRAPH ?g { + ?memberOrganization org:memberOf ?organization . + } + + BIND(SHA1(CONCAT(STR(?memberOrganization), STR(?organization), "member of")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql new file mode 100644 index 0000000..b46114f --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240704112800-related-members.sparql @@ -0,0 +1,26 @@ +PREFIX skos: +PREFIX org: +PREFIX mu: + +INSERT { + GRAPH ?g { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?organization ; + org:member ?subOrganization ; + org:role . # gerelateerd + } +} WHERE { + VALUES ?g { + + + + } + + GRAPH ?g { + ?organization org:hasSubOrganization ?subOrganization. + } + + BIND(SHA1(CONCAT(STR(?organization), STR(?subOrganization), "sub organization")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} diff --git a/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql new file mode 100644 index 0000000..6ae7e22 --- /dev/null +++ b/config/migrations/2024/20240704112300-related-organizations-as-memberships/20240716151700-associated-with.sparql @@ -0,0 +1,27 @@ +PREFIX skos: +PREFIX org: +PREFIX mu: +PREFIX ext: + +INSERT { + GRAPH ?g { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?linkedOrg ; + org:member ?org ; + org:role . # gerelateerd + } +} WHERE { + VALUES ?g { + + + + } + + GRAPH ?g { + ?org org:linkedTo ?linkedOrg . + } + + BIND(SHA1(CONCAT(STR(?org), STR(?linkedOrg), "associated with")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} diff --git a/config/migrations/20240717145138-st-martinus-herzele-combine-merger-change-events.sparql b/config/migrations/2024/20240717145138-st-martinus-herzele-combine-merger-change-events.sparql similarity index 100% rename from config/migrations/20240717145138-st-martinus-herzele-combine-merger-change-events.sparql rename to config/migrations/2024/20240717145138-st-martinus-herzele-combine-merger-change-events.sparql diff --git a/config/migrations/2024/20240905164200-remove-https-BestuurseenheidClassificatieCode.sparql b/config/migrations/2024/20240905164200-remove-https-BestuurseenheidClassificatieCode.sparql new file mode 100644 index 0000000..ef3fab8 --- /dev/null +++ b/config/migrations/2024/20240905164200-remove-https-BestuurseenheidClassificatieCode.sparql @@ -0,0 +1,13 @@ +PREFIX skos: + +DELETE DATA { + GRAPH { + + skos:inScheme ; + skos:topConceptOf . + + skos:inScheme ; + skos:topConceptOf . + } +} + diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl new file mode 100644 index 0000000..1864144 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20240930124819-membership-cleanup--insert-worship-linked-to.ttl @@ -0,0 +1,39 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Insert triples of the form: +# +# +# matching memberships for which no such triple exists. + +# Worship Service: +# Central Worship Service: + + a cleanup:Job ; + mu:uuid "f0f7a304-34e9-4986-bf27-8434bb6f8111" ; + dcterms:title "Insert missing `org:linkedTo` triples for Representative Bodies and [Central] Worship Services." ; + cleanup:randomQuery """ + PREFIX org: + + INSERT { + GRAPH { + ?member org:linkedTo ?organization . + } + } WHERE { + GRAPH { + ?membership a org:Membership ; + org:organization ?organization ; + org:member ?member ; + org:role . + ?member org:classification . + ?organization org:classification ?orgClass . + FILTER ( ?orgClass IN ( + , + + )) + + FILTER NOT EXISTS { ?member org:linkedTo ?organization . } + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl new file mode 100644 index 0000000..abc781d --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001071404-membership-cleanup--insert-worship-has-sub-organization.ttl @@ -0,0 +1,35 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Insert triples of the form: +# +# matching memberships for which no such triple exists. + +# Central Worship Service: +# Worship Service: + + a cleanup:Job ; + mu:uuid "1352f2c5-0207-435b-9737-26d29769cde6" ; + dcterms:title "Insert missing `org:hasSubOrganization` triples for Central Worship Services and Worship Services." ; + cleanup:randomQuery """ + PREFIX org: + + INSERT { + GRAPH { + ?organization org:hasSubOrganization ?member . + } + } WHERE { + GRAPH { + ?membership a org:Membership ; + org:organization ?organization ; + org:member ?member ; + org:role . + + ?organization org:classification . + ?member org:classification . + + FILTER NOT EXISTS { ?organization org:hasSubOrganization ?member . } + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl new file mode 100644 index 0000000..1e86454 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241001145338-membership-cleanup--insert-province-has-sub-organization.ttl @@ -0,0 +1,52 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Insert triples of the form +# +# matching memberships for which no such triple exists. + +# Province: +# +# Municipality: +# OCMW: +# AGB: +# APB: +# PEVA municipality: +# PEVA province: + + a cleanup:Job ; + mu:uuid "434b8b52-b695-4358-a927-ddaceb22e7e3" ; + dcterms:title "Insert missing `org:hasSubOrganization` triples for Provinces." ; + cleanup:randomQuery """ + PREFIX org: + + INSERT { + GRAPH { + ?organization org:hasSubOrganization ?member . + } + } WHERE { + GRAPH { + ?membership a org:Membership ; + org:organization ?organization ; + org:member ?member ; + org:role . + + FILTER NOT EXISTS { ?organization org:hasSubOrganization ?member . } + } + + ?organization org:classification . + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + , + , + , + , + + ) + ) + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl new file mode 100644 index 0000000..96d1563 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092839-membership-cleanup--insert-municipality-has-sub-organization.ttl @@ -0,0 +1,57 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Insert triples of the form +# +# matching memberships for which no such triple exists. + +# Municipality: +# +# AGB: +# Projectvereniging: +# Dientsverlenende vereniging +# Opdrachthoudende vereniging: +# Opdrachthoudende vereniging met private deelname: +# HVZ: +# PZ: +# PEVA municipality: + + a cleanup:Job ; + mu:uuid "3b7f8739-aa56-4a6c-af56-eb9d80022379" ; + dcterms:title "Insert missing `org:hasSubOrganization` triples for Municipalities." ; + cleanup:randomQuery """ + PREFIX org: + + INSERT { + GRAPH { + ?organization org:hasSubOrganization ?member . + } + } WHERE { + GRAPH { + ?membership a org:Membership ; + org:organization ?organization ; + org:member ?member ; + org:role . + + FILTER NOT EXISTS { ?organization org:hasSubOrganization ?member . } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + , + , + , + , + , + , + + ) + ) + } + GRAPH { + ?organization org:classification . + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl new file mode 100644 index 0000000..8d2ebf9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002092901-membership-cleanup--insert-municipality-linked-to.ttl @@ -0,0 +1,45 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Insert triples of the form: +# +# matching memberships for which no such triple exists. + +# Municipality: +# +# OCMW: +# APB: + + a cleanup:Job ; + mu:uuid "a99bcd5c-9781-425d-8a34-fb11a6e3e262" ; + dcterms:title "Insert missing `org:linkedTo` triples for Municipalities." ; + cleanup:randomQuery """ + PREFIX org: + + INSERT { + GRAPH { + ?organization org:linkedTo ?member . + } + } WHERE { + GRAPH { + ?membership a org:Membership ; + org:organization ?organization ; + org:member ?member ; + org:role . + + FILTER NOT EXISTS { ?organization org:linkedTo ?member . } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + + ) + ) + } + GRAPH { + ?organization org:classification . + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl new file mode 100644 index 0000000..dcf7604 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002151049-membership-cleanup--delete-worship-linked-to.ttl @@ -0,0 +1,42 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Delete triples of the form: +# +# +# for which no matching membership exists. + +# Worship Service: +# Central Worship Service: + + a cleanup:Job ; + mu:uuid "679eec55-0f69-4d45-84c1-9f73df966983" ; + dcterms:title "Delete leftover `org:linkedTo` triples for Representative Bodies and [Central] Worship Services." ; + cleanup:randomQuery """ + PREFIX org: + + DELETE { + GRAPH { + ?s org:linkedTo ?o . + } + } WHERE { + GRAPH { + ?s org:linkedTo ?o . + FILTER NOT EXISTS { + ?membership a org:Membership ; + org:organization ?o ; + org:member ?s ; + org:role . + } + + ?s org:classification . + + ?o org:classification ?oClass . + FILTER ( ?oClass IN ( + , + + )) + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl new file mode 100644 index 0000000..e19e2f9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241002162120-membership-cleanup--delete-worship-has-sub-organization.ttl @@ -0,0 +1,36 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Delete triples of the form +# +# for which no matching membership exists. + +# Central Worship Service +# Worship Service + + a cleanup:Job ; + mu:uuid "50cee254-37e4-410e-936a-d974047bdd4b" ; + dcterms:title "Delete leftover `org:hasSubOrganization` triples for Central Worship Services and Worship Services." ; + cleanup:randomQuery """ + PREFIX org: + + DELETE { + GRAPH { + ?cws org:hasSubOrganization ?ws . + } + } WHERE { + GRAPH { + ?cws org:hasSubOrganization ?ws . + FILTER NOT EXISTS { + ?membership a org:Membership ; + org:organization ?cws ; + org:member ?ws ; + org:role . + } + + ?cws org:classification . + ?ws org:classification . + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl new file mode 100644 index 0000000..7607e02 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003170226-membership-cleanup--delete-municipality-linked-to.ttl @@ -0,0 +1,47 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Delete triples of the form: +# +# for which no matching membership exists. + +# Municipality: +# +# OCMW: +# APB: + + a cleanup:Job ; + mu:uuid "14cfd05c-7047-43a1-97e4-42d3dd6b048d" ; + dcterms:title "Delete leftover `org:linkedTo` triples for Municipalities." ; + cleanup:randomQuery """ + PREFIX org: + + DELETE { + GRAPH { + ?municipality org:linkedTo ?member . + } + } WHERE { + GRAPH { + ?municipality org:linkedTo ?member . + FILTER NOT EXISTS { + ?membership a org:Membership ; + org:organization ?municipality ; + org:member ?member ; + org:role . + } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + + + ) + ) + } + GRAPH { + ?municipality org:classification . + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl new file mode 100644 index 0000000..a9b203f --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003171920-membership-cleanup--delete-municipality-has-sub-organization.ttl @@ -0,0 +1,58 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Delete triples of the form +# +# for which no matching membership exists. + +# Municipality: +# +# AGB: +# Projectvereniging: +# Dientsverlenende vereniging +# Opdrachthoudende vereniging: +# Opdrachthoudende vereniging met private deelname: +# HVZ: +# PZ: +# PEVA municipality: + + a cleanup:Job ; + mu:uuid "141a5f1c-39d5-431a-99e2-9085252654a3" ; + dcterms:title "Delete leftover `org:hasSubOrganization` triples for Municipalities." ; + cleanup:randomQuery """ + PREFIX org: + + DELETE { + GRAPH { + ?municipality org:hasSubOrganization ?member . + } + } WHERE { + GRAPH { + ?municipality org:hasSubOrganization ?member . + FILTER NOT EXISTS { + ?membership a org:Membership ; + org:organization ?municipality ; + org:member ?member ; + org:role . + } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + , + , + , + , + , + , + + ) + ) + } + GRAPH { + ?municipality org:classification . + } + } + """ . diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.graph b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.graph new file mode 100644 index 0000000..092c3a9 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.graph @@ -0,0 +1 @@ +http://mu.semte.ch/graphs/public diff --git a/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl new file mode 100644 index 0000000..86a5898 --- /dev/null +++ b/config/migrations/2024/20240930124819-membership-cleanup-jobs/20241003173836-membership-cleanup--delete-province-has-sub-organization.ttl @@ -0,0 +1,54 @@ +@prefix cleanup: . +@prefix mu: . +@prefix dcterms: . + +# Delete triples of the form +# +# for which no matching membership exists. + +# Province: +# +# Municipality: +# OCMW: +# AGB: +# APB: +# PEVA municipality: +# PEVA province: + + a cleanup:Job ; + mu:uuid "7b2f66c8-1433-47f4-b730-62316f288631" ; + dcterms:title "Delete leftover `org:hasSubOrganization` triples for Provinces." ; + cleanup:randomQuery """ + PREFIX org: + + DELETE { + GRAPH { + ?province org:hasSubOrganization ?member . + } + } WHERE { + GRAPH { + ?province org:hasSubOrganization ?member . + FILTER NOT EXISTS { + ?membership a org:Membership ; + org:organization ?province ; + org:member ?member ; + org:role . + } + } + + ?member org:classification ?memberClass . + FILTER ( ?memberClass + IN ( + , + , + , + , + , + + ) + ) + GRAPH { + ?province org:classification . + } + } + """ . diff --git a/config/migrations/2024/20241007091759-insert-memberships-merged-municipalities.sparql b/config/migrations/2024/20241007091759-insert-memberships-merged-municipalities.sparql new file mode 100644 index 0000000..9a10298 --- /dev/null +++ b/config/migrations/2024/20241007091759-insert-memberships-merged-municipalities.sparql @@ -0,0 +1,37 @@ +PREFIX org: +PREFIX mu: + +# Add the "has a relation with" membership between provinces and municipalities +# for the new municipalities that were added for the 2025 mergers. + +INSERT { + GRAPH { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?province ; + org:member ?municipality ; + org:role . # has a relation with + } +} WHERE { + GRAPH { + ?province org:hasSubOrganization ?municipality . + FILTER (?province IN + ( + , # Oost-Vlaanderen + , # Vlaams-Brabant + , # Limburg + , # Antwerpen + # West-Vlaanderen + ) + ) + } + BIND (SHA256(CONCAT(STR(?province), " has a relation with ", STR(?municipality))) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) + + VALUES ?municipality { + # Beveren-Kruibeke-Zwijndrecht + # Merelbeke-Melle + # Nazareth-De Pinte + # Pajottegem + } +} diff --git a/config/migrations/2024/20241007094811-insert-membership-new-district-borsbeek.sparql b/config/migrations/2024/20241007094811-insert-membership-new-district-borsbeek.sparql new file mode 100644 index 0000000..29ebfb0 --- /dev/null +++ b/config/migrations/2024/20241007094811-insert-membership-new-district-borsbeek.sparql @@ -0,0 +1,22 @@ +PREFIX org: +PREFIX mu: + +INSERT { + GRAPH { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?antwerp ; + org:member ?borsbeek ; + org:role . # has a relation with + } +} WHERE { + GRAPH { + ?antwerp org:hasSubOrganization ?borsbeek . + + FILTER (?antwerp = ) + FILTER (?borsbeek = ) + } + + BIND (SHA256(CONCAT(STR(?antwerp), " has a relation with ", STR(?borsbeek))) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} diff --git a/config/migrations/2024/20241007100727-insert-memberships-merged-ocmw.sparql b/config/migrations/2024/20241007100727-insert-memberships-merged-ocmw.sparql new file mode 100644 index 0000000..951fecf --- /dev/null +++ b/config/migrations/2024/20241007100727-insert-memberships-merged-ocmw.sparql @@ -0,0 +1,105 @@ +PREFIX org: +PREFIX mu: + +# Add the "has a relation with" membership between provinces and the new OCMWs +# added for the 2025 mergers. +INSERT { + GRAPH { + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?province ; + org:member ?ocmw ; + org:role . # has a relation with + } +} WHERE { + GRAPH { + ?province org:hasSubOrganization ?ocmw . + FILTER (?province IN + ( + , # Oost-Vlaanderen + , # Vlaams-Brabant + , # Limburg + , # Antwerpen + # West-Vlaanderen + ) + ) + } + BIND (SHA256(CONCAT(STR(?province), " has a relation with ", STR(?ocmw))) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) + + VALUES ?ocmw { + # Beveren-Kruibeke-Zwijndrecht + # Merelbeke-Melle + # Nazareth-De Pinte + # Pajottegem + } +} +; +# Relate OCMWs with their municipalities +## Beveren-Kruibeke-Zwijndrecht +### Municipality: +### OCMW: +INSERT { + GRAPH { + org:linkedTo . + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ; + org:member ; + org:role . # has a relation with + } +} WHERE { + BIND (SHA256(CONCAT(STR(), "has a relation with", STR())) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} +; +## Merelbeke-Melle +### Municipality: +### OCMW: +INSERT { + GRAPH { + org:linkedTo . + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ; + org:member ; + org:role . # has a relation with + } +} WHERE { + BIND (SHA256(CONCAT(STR(), "has a relation with", STR())) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} +; +## Nazareth-De Pinte +### Municipality: +### OCMW: +INSERT { + GRAPH { + org:linkedTo . + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ; + org:member ; + org:role . # has a relation with + } +} WHERE { + BIND (SHA256(CONCAT(STR(), "has a relation with", STR())) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} +; +## Pajottegem +### Municipality: +### OCMW: +INSERT { + GRAPH { + org:linkedTo . + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ; + org:member ; + org:role . # has a relation with + } +} WHERE { + BIND (SHA256(CONCAT(STR(), "has a relation with", STR())) AS ?uuid) + BIND (IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} diff --git a/config/migrations/2024/20241015150507-drop-graph-clb-consumer.sparql b/config/migrations/2024/20241015150507-drop-graph-clb-consumer.sparql new file mode 100644 index 0000000..4119853 --- /dev/null +++ b/config/migrations/2024/20241015150507-drop-graph-clb-consumer.sparql @@ -0,0 +1,4 @@ +# Note: the create statement is added because otherwise virtuoso throws an error +# on the drop because the graph was not explicitly made +CREATE SILENT GRAPH +DROP GRAPH diff --git a/config/migrations/2024/20241023075148-delete-change-event-dodoens.sparql b/config/migrations/2024/20241023075148-delete-change-event-dodoens.sparql new file mode 100644 index 0000000..a2ebf8d --- /dev/null +++ b/config/migrations/2024/20241023075148-delete-change-event-dodoens.sparql @@ -0,0 +1,13 @@ +PREFIX mu: +PREFIX code: + +DELETE WHERE { + GRAPH { + ?changeEvent a ; + mu:uuid "66C494CB6ABCA6E6BF2DBB94" ; + code:veranderingsgebeurtenisResultaat ?changeEventResult ; + ?eventP ?eventO . + + ?changeEventResult ?resultP ?resultO . + } +} diff --git a/config/migrations/2024/20241212201809-remove-empty-uris-received-by-kalliope.sparql b/config/migrations/2024/20241212201809-remove-empty-uris-received-by-kalliope.sparql new file mode 100644 index 0000000..7bf7762 --- /dev/null +++ b/config/migrations/2024/20241212201809-remove-empty-uris-received-by-kalliope.sparql @@ -0,0 +1,23 @@ +DELETE { + GRAPH ?g { + ?org ?orgP ?orgO . + } +} +WHERE { + VALUES ?org { + + + + + + + + + + + } + + GRAPH ?g { + ?org ?orgP ?orgO . + } +} diff --git a/config/migrations/2025/20250124100000-delete-duplicate-classifications.sparql b/config/migrations/2025/20250124100000-delete-duplicate-classifications.sparql new file mode 100644 index 0000000..5d0bf50 --- /dev/null +++ b/config/migrations/2025/20250124100000-delete-duplicate-classifications.sparql @@ -0,0 +1,17 @@ +PREFIX besluit: +PREFIX org: +PREFIX skos: + +DELETE { + GRAPH { + ?adminUnit org:classification ?c + } +} + +WHERE { + GRAPH { + ?adminUnit org:classification ?c + } + ?c skos:prefLabel ?l . + FILTER (?l IN ("Gemeente", "Provincie")) +} \ No newline at end of file diff --git a/config/migrations/2025/20250129125705-remove-bcsd-bestuursorganen-faciliteitsgemeenten.sparql b/config/migrations/2025/20250129125705-remove-bcsd-bestuursorganen-faciliteitsgemeenten.sparql new file mode 100644 index 0000000..444aac2 --- /dev/null +++ b/config/migrations/2025/20250129125705-remove-bcsd-bestuursorganen-faciliteitsgemeenten.sparql @@ -0,0 +1,39 @@ +PREFIX besluit: +PREFIX mandaat: +PREFIX org: +PREFIX generiek: + +DELETE { + GRAPH { + ?boi ?p ?o. + } +} +WHERE { + GRAPH { + VALUES ?faciliteitEenheid { + # OCMW + # Sint-Genesius-Rode + # Linkebeek + # Drogenbos + # Wemmel + # Kraainem + # Wezembeek-Oppem + # Voeren + } + + VALUES ?classification { + # BCSD + # BCSD Voorzitter + } + + ?bestuursorgaan besluit:bestuurt ?faciliteitEenheid . + ?bestuursorgaan org:classification ?classification . + + ?boi generiek:isTijdspecialisatieVan ?bestuursorgaan . + ?boi mandaat:bindingStart ?startDate . + + ?boi ?p ?o. + + FILTER(?startDate >= "2019-01-01T00:00:00"^^xsd:dateTime) + } +} diff --git a/config/reasoner/dl2op/main-info/inverse_relations.n3 b/config/reasoner/dl2op/main-info/inverse_relations.n3 deleted file mode 100644 index bfeda31..0000000 --- a/config/reasoner/dl2op/main-info/inverse_relations.n3 +++ /dev/null @@ -1,33 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Inverse properties -{ - ?s org:holds ?o. -} => { - ?o org:heldBy ?s. -}. - -{ - ?s org:heldBy ?o. -} => { - ?o org:holds ?s. -}. diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 deleted file mode 100644 index 326b028..0000000 --- a/config/reasoner/dl2op/main-info/mapping.n3 +++ /dev/null @@ -1,244 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: -PREFIX dc_terms: -PREFIX ch: -PREFIX person: -PREFIX lblodlg: -PREFIX ere: - -# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!) -# Hence the mapping is in two steps. -# The first step maps the DL persoon:gebruikteVoornaam to the OP counterpart -# and drops the DL persoon:gebruikteVoornaam statements with e:becomes -# A second reasoning will map DL foaf:name to OP persoon:gebruikteVoornaam -# Doing both at once would lead all DL foaf:names to incorrectly become foaf:givennames -# in OP - -# First name -# persoon:gebruikteVoornaam => foaf:givenName -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock DL -# persoon_loket:gebruikteVoornaam "Didier". - -{ - { - ?s persoon_loket:gebruikteVoornaam ?o - } e:becomes { - ?s foaf:givenName ?o - } -} => { - ?s foaf:givenName ?o -}. - - -# First name -# persoon:gebruikteVoornaam => foaf:givenName (done in pre-processing) -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock LLB -# foaf:name "Didier". -{ - { - ?s foaf:name ?o - } e:becomes { - ?s persoon:gebruikteVoornaam ?o - } -} => { - ?s persoon:gebruikteVoornaam ?o -}. - - -# Test -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:bindingEinde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:bindingEinde ?eindeDate - } e:becomes { - ?s mandaat:bindingEinde ?eindeDateTime - }. -} => { - ?s mandaat:bindingEinde ?eindeDateTime -}. - -{ - ?s mandaat:bindingStart ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:bindingStart ?startDate - } e:becomes { - ?s mandaat:bindingStart ?startDateTime - }. -} => { - ?s mandaat:bindingStart ?startDateTime -}. -{ - ?s ch:startdatum ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s ch:startdatum ?startDate - } e:becomes { - ?s ch:startdatum ?startDateTime - }. -} => { - ?s ch:startdatum ?startDateTime -}. - -{ - ?s mandaat:start ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:start ?startDate - } e:becomes { - ?s mandaat:start ?startDateTime - }. -} => { - ?s mandaat:start ?startDateTime -}. - -{ - ?s mandaat:einde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:einde ?eindeDate - } e:becomes { - ?s mandaat:einde ?eindeDateTime - }. -} => { - ?s mandaat:einde ?eindeDateTime -}. - -{ - ?s ch:eindedatum ?endDate. - # use backward arrow rule defined below - ?endDate :dateTimeFromDate ?endDateTime. - { - ?s ch:eindedatum ?endDate - } e:becomes { - ?s ch:eindedatum ?endDateTime - }. -} => { - ?s ch:eindedatum ?endDateTime -}. - -{ - ?s ere:geplandeEinddatumAanstelling ?endDate. - # use backward arrow rule defined below - ?endDate :dateTimeFromDate ?endDateTime. - { - ?s ere:geplandeEinddatumAanstelling ?endDate - } e:becomes { - ?s ere:geplandeEinddatumAanstelling ?endDateTime - }. -} => { - ?s ere:geplandeEinddatumAanstelling ?endDateTime -}. - -# Backward arrow rule is like a function call. -# Removes the timezone indicator "Z" from incoming datetimes -# To make sure all datetimes have the same convention we now save them as -# datetime without the timezone indicator -# We use "T02:00:00" as time indicator to work around a virtuoso bug that -# results in datetimes being converted to a date when using "T00:00:00" -{ - ?date :dateTimeFromDate ?dateTime -} -<= -{ - ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. - (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . -}. - - -# ex:orgA besluit:classificatie . -{ - { - ?s besluit:classificatie ?o - } e:becomes { - ?s org:classification ?o - } -} => { - ?s org:classification ?o -}. - -# fix typo V -> v -# "1" . -{ - { - ?s adres:AdresVoorstelling.huisnummer ?o - } e:becomes { - ?s adres:Adresvoorstelling.huisnummer ?o - } -} => { - ?s adres:Adresvoorstelling.huisnummer ?o -}. - - -# Tijdspecialisatie -{ - { - ?s mandaat:isTijdspecialisatieVan ?o. - } e:becomes { - ?s generiek:isTijdspecialisatieVan ?o. - } -} => { - ?s generiek:isTijdspecialisatieVan ?o. -}. - -# In OP functionaris inherits from agents-in-position, which inherits from Agent -{ - ?s a lblodlg:Functionaris . -} => { - ?s a ch:AgentInPositie , - dc_terms:Agent . -} . - -# In OP mandataris inherits from agents-in-position, which inherits from Agent -{ - ?s a mandaat:Mandataris . -} => { - ?s a ch:AgentInPositie , - dc_terms:Agent . -} . - -# In OP minister inherits from agents-in-position, which inherits from Agent -{ - ?s a ere:RolBedienaar . -} => { - ?s a ch:AgentInPositie , - dc_terms:Agent . -} . - -# In OP Person inherits from Agent -{ - ?s a person:Person . -} => { - ?s a dc_terms:Agent . -} . diff --git a/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 b/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 deleted file mode 100644 index 8afa661..0000000 --- a/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 +++ /dev/null @@ -1,524 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Map from http persoon to https persoon namespace. - -## classes: -{ - { - ?s a persoon_loket:Afstamming - } e:becomes { - ?s a persoon:Afstamming - } -} => { - ?s a persoon:Afstamming -}. - -{ - { - ?s a persoon_loket:BurgerlijkeStaat - } e:becomes { - ?s a persoon:BurgerlijkeStaat - } -} => { - ?s a persoon:BurgerlijkeStaat -}. - -{ - { - ?s a persoon_loket:Domicilie - } e:becomes { - ?s a persoon:Domicilie - } -} => { - ?s a persoon:Domicilie -}. - -{ - { - ?s a persoon_loket:Geboorte - } e:becomes { - ?s a persoon:Geboorte - } -} => { - ?s a persoon:Geboorte -}. - -{ - { - ?s a persoon_loket:GeenInwoner - } e:becomes { - ?s a persoon:GeenInwoner - } -} => { - ?s a persoon:GeenInwoner -}. - -{ - { - ?s a persoon_loket:GeregistreerdPersoon - } e:becomes { - ?s a persoon:GeregistreerdPersoon - } -} => { - ?s a persoon:GeregistreerdPersoon -}. - -{ - { - ?s a persoon_loket:Gezin - } e:becomes { - ?s a persoon:Gezin - } -} => { - ?s a persoon:Gezin -}. - -{ - { - ?s a persoon_loket:Gezinsrelatie - } e:becomes { - ?s a persoon:Gezinsrelatie - } -} => { - ?s a persoon:Gezinsrelatie -}. - -{ - { - ?s a persoon_loket:Huwelijk - } e:becomes { - ?s a persoon:Huwelijk - } -} => { - ?s a persoon:Huwelijk -}. - -{ - { - ?s a persoon_loket:Inwoner - } e:becomes { - ?s a persoon:Inwoner - } -} => { - ?s a persoon:Inwoner -}. - -{ - { - ?s a persoon_loket:Inwonerschap - } e:becomes { - ?s a persoon:Inwonerschap - } -} => { - ?s a persoon:Inwonerschap -}. - -{ - { - ?s a persoon_loket:Nationaliteit - } e:becomes { - ?s a persoon:Nationaliteit - } -} => { - ?s a persoon:Nationaliteit -}. - -{ - { - ?s a persoon_loket:Overlijden - } e:becomes { - ?s a persoon:Overlijden - } -} => { - ?s a persoon:Overlijden -}. - -{ - { - ?s a persoon_loket:PermanentInwoner - } e:becomes { - ?s a persoon:PermanentInwoner - } -} => { - ?s a persoon:PermanentInwoner -}. - -{ - { - ?s a persoon_loket:Persoonsgebeurtenis - } e:becomes { - ?s a persoon:Persoonsgebeurtenis - } -} => { - ?s a persoon:Persoonsgebeurtenis -}. - -{ - { - ?s a persoon_loket:Persoonsrelatie - } e:becomes { - ?s a persoon:Persoonsrelatie - } -} => { - ?s a persoon:Persoonsrelatie -}. - -{ - { - ?s a persoon_loket:Samenwonen - } e:becomes { - ?s a persoon:Samenwonen - } -} => { - ?s a persoon:Samenwonen -}. - -{ - { - ?s a persoon_loket:Staatsburger - } e:becomes { - ?s a persoon:Staatsburger - } -} => { - ?s a persoon:Staatsburger -}. - -{ - { - ?s a persoon_loket:Staatsburgerschap - } e:becomes { - ?s a persoon:Staatsburgerschap - } -} => { - ?s a persoon:Staatsburgerschap -}. - -{ - { - ?s a persoon_loket:TijdelijkInwoner - } e:becomes { - ?s a persoon:TijdelijkInwoner - } -} => { - ?s a persoon:TijdelijkInwoner -}. - -{ - { - ?s a persoon_loket:Verblijfplaats - } e:becomes { - ?s a persoon:Verblijfplaats - } -} => { - ?s a persoon:Verblijfplaats -}. - -{ - { - ?s a persoon_loket:Voogdij - } e:becomes { - ?s a persoon:Voogdij - } -} => { - ?s a persoon:Voogdij -}. - -{ - { - ?s a persoon_loket:Vreemdeling - } e:becomes { - ?s a persoon:Vreemdeling - } -} => { - ?s a persoon:Vreemdeling -}. - -## properties -{ - { - ?s persoon_loket:afstammingsType ?o - } e:becomes { - ?s persoon:afstammingsType ?o - } -} => { - ?s persoon:afstammingsType ?o -}. - -{ - { - ?s persoon_loket:alternatieveNaam ?o - } e:becomes { - ?s persoon:alternatieveNaam ?o - } -} => { - ?s persoon:alternatieveNaam ?o -}. - -{ - { - ?s persoon_loket:datum ?o - } e:becomes { - ?s persoon:datum ?o - } -} => { - ?s persoon:datum ?o -}. - -{ - { - ?s persoon_loket:datumVanAfstamming ?o - } e:becomes { - ?s persoon:datumVanAfstamming ?o - } -} => { - ?s persoon:datumVanAfstamming ?o -}. - -{ - { - ?s persoon_loket:geslacht ?o - } e:becomes { - ?s persoon:geslacht ?o - } -} => { - ?s persoon:geslacht ?o -}. - -{ - { - ?s persoon_loket:gezinsadres ?o - } e:becomes { - ?s persoon:gezinsadres ?o - } -} => { - ?s persoon:gezinsadres ?o -}. - -{ - { - ?s persoon_loket:gezinsrelatietype ?o - } e:becomes { - ?s persoon:gezinsrelatietype ?o - } -} => { - ?s persoon:gezinsrelatietype ?o -}. - -{ - { - ?s persoon_loket:heeftBurgerlijkeStaat ?o - } e:becomes { - ?s persoon:heeftBurgerlijkeStaat ?o - } -} => { - ?s persoon:heeftBurgerlijkeStaat ?o -}. - -{ - { - ?s persoon_loket:heeftGeboorte ?o - } e:becomes { - ?s persoon:heeftGeboorte ?o - } -} => { - ?s persoon:heeftGeboorte ?o -}. - -{ - { - ?s persoon_loket:heeftInwonerschap ?o - } e:becomes { - ?s persoon:heeftInwonerschap ?o - } -} => { - ?s persoon:heeftInwonerschap ?o -}. - -{ - { - ?s persoon_loket:heeftNationaliteit ?o - } e:becomes { - ?s persoon:heeftNationaliteit ?o - } -} => { - ?s persoon:heeftNationaliteit ?o -}. - -{ - { - ?s persoon_loket:heeftOverlijden ?o - } e:becomes { - ?s persoon:heeftOverlijden ?o - } -} => { - ?s persoon:heeftOverlijden ?o -}. - -{ - { - ?s persoon_loket:heeftPersoonsrelatie ?o - } e:becomes { - ?s persoon:heeftPersoonsrelatie ?o - } -} => { - ?s persoon:heeftPersoonsrelatie ?o -}. - -{ - { - ?s persoon_loket:heeftStaatsburgerschap ?o - } e:becomes { - ?s persoon:heeftStaatsburgerschap ?o - } -} => { - ?s persoon:heeftStaatsburgerschap ?o -}. - -{ - { - ?s persoon_loket:heeftVerblijfplaats ?o - } e:becomes { - ?s persoon:heeftVerblijfplaats ?o - } -} => { - ?s persoon:heeftVerblijfplaats ?o -}. - -{ - { - ?s persoon_loket:Inwonerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Inwonerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Inwonerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:isHoofdVan ?o - } e:becomes { - ?s persoon:isHoofdVan ?o - } -} => { - ?s persoon:isHoofdVan ?o -}. - -{ - { - ?s persoon_loket:isLidVan ?o - } e:becomes { - ?s persoon:isLidVan ?o - } -} => { - ?s persoon:isLidVan ?o -}. - -{ - { - ?s persoon_loket:isRelatieMet ?o - } e:becomes { - ?s persoon:isRelatieMet ?o - } -} => { - ?s persoon:isRelatieMet ?o -}. - -{ - { - ?s persoon_loket:land ?o - } e:becomes { - ?s persoon:land ?o - } -} => { - ?s persoon:land ?o -}. - -{ - { - ?s persoon_loket:nationaliteit ?o - } e:becomes { - ?s persoon:nationaliteit ?o - } -} => { - ?s persoon:nationaliteit ?o -}. - -{ - { - ?s persoon_loket:plaats ?o - } e:becomes { - ?s persoon:plaats ?o - } -} => { - ?s persoon:plaats ?o -}. - -{ - { - ?s persoon_loket:registratie ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. - -{ - { - ?s persoon_loket:Staatsburgerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:type ?o - } e:becomes { - ?s persoon:type ?o - } -} => { - ?s persoon:type ?o -}. - -{ - { - ?s persoon_loket:verblijfsadres ?o - } e:becomes { - ?s persoon:verblijfsadres ?o - } -} => { - ?s persoon:verblijfsadres ?o -}. - -{ - { - ?s persoon_loket:volledigeNaam ?o - } e:becomes { - ?s persoon:volledigeNaam ?o - } -} => { - ?s persoon:volledigeNaam ?o -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main-info/phone_number.n3 b/config/reasoner/dl2op/main-info/phone_number.n3 deleted file mode 100644 index da5ce99..0000000 --- a/config/reasoner/dl2op/main-info/phone_number.n3 +++ /dev/null @@ -1,32 +0,0 @@ -PREFIX string: -PREFIX e: -PREFIX schema: -PREFIX : <#> -{ - ?s schema:telephone ?number. - - # Remove all non digits - ( ?number ("""[^+\\d]""") ("") ) string:replaceAll ?scrape_result. - - # Replace leading 00 with + - ( ?scrape_result """^00""" "+") string:replace ?replaced_zero_zero. - - ( ?replaced_zero_zero """^0""" "+32") string:replace ?default_be. - - ( ?default_be """\\+320""" "+32" ) string:replace ?replace_320. - - ( ?replace_320 """^320""" "+32" ) string:replace ?final_result. - - ?final_result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". - - ( "tel:" ?final_result ) string:concatenation ?parsed_result . - - { - ?s schema:telephone ?number. - } e:becomes { - ?s schema:telephone ?parsed_result . - }. - -} => { - ?s schema:telephone ?parsed_result . -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main-info/query.n3q b/config/reasoner/dl2op/main-info/query.n3q deleted file mode 100644 index 2d55202..0000000 --- a/config/reasoner/dl2op/main-info/query.n3q +++ /dev/null @@ -1,544 +0,0 @@ -# Generated by producer-config-to-query.ipynb - -## CLASSES -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -# { -# ?s a -# } => { -# ?s a -# }. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -# { -# ?s a -# } => { -# ?s a -# }. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -{ - ?s a - } => { - ?s a -}. - -## PROPERTIES -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -# { -# ?s ?o -# } => { -# ?s ?o -# }. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - -{ - ?s ?o -} => { - ?s ?o -}. - diff --git a/config/reasoner/dl2op/main-info/retract_empty_strings.n3 b/config/reasoner/dl2op/main-info/retract_empty_strings.n3 deleted file mode 100644 index f8204a7..0000000 --- a/config/reasoner/dl2op/main-info/retract_empty_strings.n3 +++ /dev/null @@ -1,27 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Retract empty strings -{ - { - ?s ?p "" - } e:becomes {}. -} => {}. diff --git a/config/reasoner/dl2op/main-info/rrn.n3 b/config/reasoner/dl2op/main-info/rrn.n3 deleted file mode 100644 index b45c688..0000000 --- a/config/reasoner/dl2op/main-info/rrn.n3 +++ /dev/null @@ -1,62 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - - -# Rijksregisternummer -# Extend identifiers to match OP's model -# skos:notation "00010100105". -{ - ?identifier skos:notation ?notation. - ?notation string:notEqualIgnoringCase "Rijksregisternummer". - ?identifier log:uri ?identifierString. - (?identifierString "STRUCTURED_IDENTIFIER") string:concatenation ?hashInput. - ?hashInput crypto:md5 ?uuid. - ("http://data.lblod.info/id/gestructureerdeIdentificatoren/" ?uuid) string:concatenation ?structuredIdString. - ?structuredIdentifier log:uri ?structuredIdString. - - { - ?identifier skos:notation ?notation. - } e:becomes { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - }. - -} => { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - - ?structuredIdentifier a generiek:GestructureerdeIdentificator ; - mu:uuid ?uuid ; - generiek:lokaleIdentificator ?notation -}. - -# identifier property in the export is only used for RRN. -{ - { - ?s adms:identifier ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. diff --git a/config/reasoner/dl2op/main/inverse_relations.n3 b/config/reasoner/dl2op/main/inverse_relations.n3 deleted file mode 100644 index ea25c90..0000000 --- a/config/reasoner/dl2op/main/inverse_relations.n3 +++ /dev/null @@ -1,32 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - -# Inverse properties -{ - ?s org:holds ?o. -} => { - ?o org:heldBy ?s. -}. - -{ - ?s org:heldBy ?o. -} => { - ?o org:holds ?s. -}. diff --git a/config/reasoner/dl2op/main/mapping.n3 b/config/reasoner/dl2op/main/mapping.n3 deleted file mode 100644 index a0fa3ba..0000000 --- a/config/reasoner/dl2op/main/mapping.n3 +++ /dev/null @@ -1,229 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: -PREFIX dc_terms: -PREFIX ch: -PREFIX person: -PREFIX lblodlg: - -# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!) -# Hence the mapping is in two steps. -# The first step maps the DL persoon:gebruikteVoornaam to the OP counterpart -# and drops the DL persoon:gebruikteVoornaam statements with e:becomes -# A second reasoning will map DL foaf:name to OP persoon:gebruikteVoornaam -# Doing both at once would lead all DL foaf:names to incorrectly become foaf:givennames -# in OP - -# First name -# persoon:gebruikteVoornaam => foaf:givenName -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock DL -# persoon_loket:gebruikteVoornaam "Didier". - -{ - { - ?s persoon_loket:gebruikteVoornaam ?o - } e:becomes { - ?s foaf:givenName ?o - } -} => { - ?s foaf:givenName ?o -}. - - -# First name -# persoon:gebruikteVoornaam => foaf:givenName (done in pre-processing) -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock LLB -# foaf:name "Didier". -{ - { - ?s foaf:name ?o - } e:becomes { - ?s persoon:gebruikteVoornaam ?o - } -} => { - ?s persoon:gebruikteVoornaam ?o -}. - -# Test -# ex:s "2019-02-01T10:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:bindingEinde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:bindingEinde ?eindeDate - } e:becomes { - ?s mandaat:bindingEinde ?eindeDateTime - }. -} => { - ?s mandaat:bindingEinde ?eindeDateTime -}. - -{ - ?s mandaat:start ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:start ?startDate - } e:becomes { - ?s mandaat:start ?startDateTime - }. -} => { - ?s mandaat:start ?startDateTime -}. - -{ - ?s mandaat:einde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:einde ?eindeDate - } e:becomes { - ?s mandaat:einde ?eindeDateTime - }. -} => { - ?s mandaat:einde ?eindeDateTime -}. - -{ - ?s mandaat:bindingStart ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:bindingStart ?startDate - } e:becomes { - ?s mandaat:bindingStart ?startDateTime - }. -} => { - ?s mandaat:bindingStart ?startDateTime -}. - -{ - ?s ch:startdatum ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s ch:startdatum ?startDate - } e:becomes { - ?s ch:startdatum ?startDateTime - }. -} => { - ?s ch:startdatum ?startDateTime -}. - -{ - ?s ch:eindedatum ?endDate. - # use backward arrow rule defined below - ?endDate :dateTimeFromDate ?endDateTime. - { - ?s ch:eindedatum ?endDate - } e:becomes { - ?s ch:eindedatum ?endDateTime - }. -} => { - ?s ch:eindedatum ?endDateTime -}. - - -# Backward arrow rule is like a function call. -# Removes the timezone indicator "Z" from incoming datetimes -# To make sure all datetimes have the same convention we now save them as -# datetime without the timezone indicator -# We use "T02:00:00" as time indicator to work around a virtuoso bug that -# results in datetimes being converted to a date when using "T00:00:00" -{ - ?date :dateTimeFromDate ?dateTime -} -<= -{ - ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. - (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . -}. - -# ex:orgA besluit:classificatie . -{ - { - ?s besluit:classificatie ?o - } e:becomes { - ?s org:classification ?o - } -} => { - ?s org:classification ?o -}. - -# fix typo V -> v -# "1" . -{ - { - ?s adres:AdresVoorstelling.huisnummer ?o - } e:becomes { - ?s adres:Adresvoorstelling.huisnummer ?o - } -} => { - ?s adres:Adresvoorstelling.huisnummer ?o -}. - - -# Tijdspecialisatie -{ - { - ?s mandaat:isTijdspecialisatieVan ?o. - } e:becomes { - ?s generiek:isTijdspecialisatieVan ?o. - } -} => { - ?s generiek:isTijdspecialisatieVan ?o. -} . - -# In OP functionaris inherits from agents-in-position, which inherits from Agent -{ - ?s a lblodlg:Functionaris . -} => { - ?s a ch:AgentInPositie , - dc_terms:Agent . -} . - -# In OP mandataris inherits from agents-in-position, which inherits from Agent -{ - ?s a mandaat:Mandataris . -} => { - ?s a ch:AgentInPositie , - dc_terms:Agent . -} . - -# In OP AgentInPositie inherits from Agent -{ - ?s a ch:AgentInPositie . -} => { - ?s a dc_terms:Agent . -} . - -# In OP Person inherits from Agent -{ - ?s a person:Person . -} => { - ?s a dc_terms:Agent . -} . diff --git a/config/reasoner/dl2op/main/persoon_http_to_https.n3 b/config/reasoner/dl2op/main/persoon_http_to_https.n3 deleted file mode 100644 index e2f942a..0000000 --- a/config/reasoner/dl2op/main/persoon_http_to_https.n3 +++ /dev/null @@ -1,523 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - -# Map from http persoon to https persoon namespace. - -## classes: -{ - { - ?s a persoon_loket:Afstamming - } e:becomes { - ?s a persoon:Afstamming - } -} => { - ?s a persoon:Afstamming -}. - -{ - { - ?s a persoon_loket:BurgerlijkeStaat - } e:becomes { - ?s a persoon:BurgerlijkeStaat - } -} => { - ?s a persoon:BurgerlijkeStaat -}. - -{ - { - ?s a persoon_loket:Domicilie - } e:becomes { - ?s a persoon:Domicilie - } -} => { - ?s a persoon:Domicilie -}. - -{ - { - ?s a persoon_loket:Geboorte - } e:becomes { - ?s a persoon:Geboorte - } -} => { - ?s a persoon:Geboorte -}. - -{ - { - ?s a persoon_loket:GeenInwoner - } e:becomes { - ?s a persoon:GeenInwoner - } -} => { - ?s a persoon:GeenInwoner -}. - -{ - { - ?s a persoon_loket:GeregistreerdPersoon - } e:becomes { - ?s a persoon:GeregistreerdPersoon - } -} => { - ?s a persoon:GeregistreerdPersoon -}. - -{ - { - ?s a persoon_loket:Gezin - } e:becomes { - ?s a persoon:Gezin - } -} => { - ?s a persoon:Gezin -}. - -{ - { - ?s a persoon_loket:Gezinsrelatie - } e:becomes { - ?s a persoon:Gezinsrelatie - } -} => { - ?s a persoon:Gezinsrelatie -}. - -{ - { - ?s a persoon_loket:Huwelijk - } e:becomes { - ?s a persoon:Huwelijk - } -} => { - ?s a persoon:Huwelijk -}. - -{ - { - ?s a persoon_loket:Inwoner - } e:becomes { - ?s a persoon:Inwoner - } -} => { - ?s a persoon:Inwoner -}. - -{ - { - ?s a persoon_loket:Inwonerschap - } e:becomes { - ?s a persoon:Inwonerschap - } -} => { - ?s a persoon:Inwonerschap -}. - -{ - { - ?s a persoon_loket:Nationaliteit - } e:becomes { - ?s a persoon:Nationaliteit - } -} => { - ?s a persoon:Nationaliteit -}. - -{ - { - ?s a persoon_loket:Overlijden - } e:becomes { - ?s a persoon:Overlijden - } -} => { - ?s a persoon:Overlijden -}. - -{ - { - ?s a persoon_loket:PermanentInwoner - } e:becomes { - ?s a persoon:PermanentInwoner - } -} => { - ?s a persoon:PermanentInwoner -}. - -{ - { - ?s a persoon_loket:Persoonsgebeurtenis - } e:becomes { - ?s a persoon:Persoonsgebeurtenis - } -} => { - ?s a persoon:Persoonsgebeurtenis -}. - -{ - { - ?s a persoon_loket:Persoonsrelatie - } e:becomes { - ?s a persoon:Persoonsrelatie - } -} => { - ?s a persoon:Persoonsrelatie -}. - -{ - { - ?s a persoon_loket:Samenwonen - } e:becomes { - ?s a persoon:Samenwonen - } -} => { - ?s a persoon:Samenwonen -}. - -{ - { - ?s a persoon_loket:Staatsburger - } e:becomes { - ?s a persoon:Staatsburger - } -} => { - ?s a persoon:Staatsburger -}. - -{ - { - ?s a persoon_loket:Staatsburgerschap - } e:becomes { - ?s a persoon:Staatsburgerschap - } -} => { - ?s a persoon:Staatsburgerschap -}. - -{ - { - ?s a persoon_loket:TijdelijkInwoner - } e:becomes { - ?s a persoon:TijdelijkInwoner - } -} => { - ?s a persoon:TijdelijkInwoner -}. - -{ - { - ?s a persoon_loket:Verblijfplaats - } e:becomes { - ?s a persoon:Verblijfplaats - } -} => { - ?s a persoon:Verblijfplaats -}. - -{ - { - ?s a persoon_loket:Voogdij - } e:becomes { - ?s a persoon:Voogdij - } -} => { - ?s a persoon:Voogdij -}. - -{ - { - ?s a persoon_loket:Vreemdeling - } e:becomes { - ?s a persoon:Vreemdeling - } -} => { - ?s a persoon:Vreemdeling -}. - -## properties -{ - { - ?s persoon_loket:afstammingsType ?o - } e:becomes { - ?s persoon:afstammingsType ?o - } -} => { - ?s persoon:afstammingsType ?o -}. - -{ - { - ?s persoon_loket:alternatieveNaam ?o - } e:becomes { - ?s persoon:alternatieveNaam ?o - } -} => { - ?s persoon:alternatieveNaam ?o -}. - -{ - { - ?s persoon_loket:datum ?o - } e:becomes { - ?s persoon:datum ?o - } -} => { - ?s persoon:datum ?o -}. - -{ - { - ?s persoon_loket:datumVanAfstamming ?o - } e:becomes { - ?s persoon:datumVanAfstamming ?o - } -} => { - ?s persoon:datumVanAfstamming ?o -}. - -{ - { - ?s persoon_loket:geslacht ?o - } e:becomes { - ?s persoon:geslacht ?o - } -} => { - ?s persoon:geslacht ?o -}. - -{ - { - ?s persoon_loket:gezinsadres ?o - } e:becomes { - ?s persoon:gezinsadres ?o - } -} => { - ?s persoon:gezinsadres ?o -}. - -{ - { - ?s persoon_loket:gezinsrelatietype ?o - } e:becomes { - ?s persoon:gezinsrelatietype ?o - } -} => { - ?s persoon:gezinsrelatietype ?o -}. - -{ - { - ?s persoon_loket:heeftBurgerlijkeStaat ?o - } e:becomes { - ?s persoon:heeftBurgerlijkeStaat ?o - } -} => { - ?s persoon:heeftBurgerlijkeStaat ?o -}. - -{ - { - ?s persoon_loket:heeftGeboorte ?o - } e:becomes { - ?s persoon:heeftGeboorte ?o - } -} => { - ?s persoon:heeftGeboorte ?o -}. - -{ - { - ?s persoon_loket:heeftInwonerschap ?o - } e:becomes { - ?s persoon:heeftInwonerschap ?o - } -} => { - ?s persoon:heeftInwonerschap ?o -}. - -{ - { - ?s persoon_loket:heeftNationaliteit ?o - } e:becomes { - ?s persoon:heeftNationaliteit ?o - } -} => { - ?s persoon:heeftNationaliteit ?o -}. - -{ - { - ?s persoon_loket:heeftOverlijden ?o - } e:becomes { - ?s persoon:heeftOverlijden ?o - } -} => { - ?s persoon:heeftOverlijden ?o -}. - -{ - { - ?s persoon_loket:heeftPersoonsrelatie ?o - } e:becomes { - ?s persoon:heeftPersoonsrelatie ?o - } -} => { - ?s persoon:heeftPersoonsrelatie ?o -}. - -{ - { - ?s persoon_loket:heeftStaatsburgerschap ?o - } e:becomes { - ?s persoon:heeftStaatsburgerschap ?o - } -} => { - ?s persoon:heeftStaatsburgerschap ?o -}. - -{ - { - ?s persoon_loket:heeftVerblijfplaats ?o - } e:becomes { - ?s persoon:heeftVerblijfplaats ?o - } -} => { - ?s persoon:heeftVerblijfplaats ?o -}. - -{ - { - ?s persoon_loket:Inwonerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Inwonerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Inwonerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:isHoofdVan ?o - } e:becomes { - ?s persoon:isHoofdVan ?o - } -} => { - ?s persoon:isHoofdVan ?o -}. - -{ - { - ?s persoon_loket:isLidVan ?o - } e:becomes { - ?s persoon:isLidVan ?o - } -} => { - ?s persoon:isLidVan ?o -}. - -{ - { - ?s persoon_loket:isRelatieMet ?o - } e:becomes { - ?s persoon:isRelatieMet ?o - } -} => { - ?s persoon:isRelatieMet ?o -}. - -{ - { - ?s persoon_loket:land ?o - } e:becomes { - ?s persoon:land ?o - } -} => { - ?s persoon:land ?o -}. - -{ - { - ?s persoon_loket:nationaliteit ?o - } e:becomes { - ?s persoon:nationaliteit ?o - } -} => { - ?s persoon:nationaliteit ?o -}. - -{ - { - ?s persoon_loket:plaats ?o - } e:becomes { - ?s persoon:plaats ?o - } -} => { - ?s persoon:plaats ?o -}. - -{ - { - ?s persoon_loket:registratie ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. - -{ - { - ?s persoon_loket:Staatsburgerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:type ?o - } e:becomes { - ?s persoon:type ?o - } -} => { - ?s persoon:type ?o -}. - -{ - { - ?s persoon_loket:verblijfsadres ?o - } e:becomes { - ?s persoon:verblijfsadres ?o - } -} => { - ?s persoon:verblijfsadres ?o -}. - -{ - { - ?s persoon_loket:volledigeNaam ?o - } e:becomes { - ?s persoon:volledigeNaam ?o - } -} => { - ?s persoon:volledigeNaam ?o -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main/phone_number.n3 b/config/reasoner/dl2op/main/phone_number.n3 deleted file mode 100644 index da5ce99..0000000 --- a/config/reasoner/dl2op/main/phone_number.n3 +++ /dev/null @@ -1,32 +0,0 @@ -PREFIX string: -PREFIX e: -PREFIX schema: -PREFIX : <#> -{ - ?s schema:telephone ?number. - - # Remove all non digits - ( ?number ("""[^+\\d]""") ("") ) string:replaceAll ?scrape_result. - - # Replace leading 00 with + - ( ?scrape_result """^00""" "+") string:replace ?replaced_zero_zero. - - ( ?replaced_zero_zero """^0""" "+32") string:replace ?default_be. - - ( ?default_be """\\+320""" "+32" ) string:replace ?replace_320. - - ( ?replace_320 """^320""" "+32" ) string:replace ?final_result. - - ?final_result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". - - ( "tel:" ?final_result ) string:concatenation ?parsed_result . - - { - ?s schema:telephone ?number. - } e:becomes { - ?s schema:telephone ?parsed_result . - }. - -} => { - ?s schema:telephone ?parsed_result . -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main/query.n3q b/config/reasoner/dl2op/main/query.n3q deleted file mode 100644 index 55d3d9d..0000000 --- a/config/reasoner/dl2op/main/query.n3q +++ /dev/null @@ -1,284 +0,0 @@ -# Filtering classes to ingest - -@prefix log: . - -{ - ?s a ; - ?p ?o . - } => { - ?s a ; - ?p ?o . -}. - -{ - ?s a ; - ?p ?o . - } => { - ?s a ; - ?p ?o . -}. - -{ - ?s a ; - ?p ?o . - } => { - ?s a ; - ?p ?o . -}. - -# For functionarissen, the contact point is on the bestuursfunctie and not on the agent in position - -{ - ?s a ; - ?o . - } => { - ?s a ; - ?o . -}. - -# Functionarissen should only be linked to an IGS, AGB, APB, gemeente, district, -# provincie, OCMW, or OCMW association (FOR NOW) - -## Province -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## Municipality -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## OCMW -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## district -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## AGB -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## APB -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## projectvereniging (IGS) -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. -## dienstverlenend vereniging (IGS) -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## opdrachthoudende vereniging (IGS) -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## opdrachthoudende vereniging met private deelname (IGS) -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## OCMW associations -# Note: Loket uses only the general classification code for OCMW associations, -# while OP uses its 5 more specific subtypes -{ - ?s a ; - ?bestuursfunctie ; - ?p ?o . - - ?orgaanInTime ?bestuursfunctie ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -# Mandatarissen should only be linked to a gemeente, district, provincie or OCMW -# (FOR NOW) - -## province -{ - ?s a ; - ?mandate ; - ?p ?o . - - ?orgaanInTime ?mandate ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## municipality -{ - ?s a ; - ?mandate ; - ?p ?o . - - ?orgaanInTime ?mandate ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## OCMW -{ - ?s a ; - ?mandate ; - ?p ?o . - - ?orgaanInTime ?mandate ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -## district -{ - ?s a ; - ?mandate ; - ?p ?o . - - ?orgaanInTime ?mandate ; - ?orgaan . - ?orgaan ?bestuur . - ?bestuur . - } => { - ?s a ; - ?p ?o . -}. - -{ - ?s a ; - ?p ?o . - } => { - ?s a ; - ?p ?o . -}. -{ - ?s a ; - ?p ?o . - } => { - ?s a ; - ?p ?o . -}. diff --git a/config/reasoner/dl2op/main/retract_empty_strings.n3 b/config/reasoner/dl2op/main/retract_empty_strings.n3 deleted file mode 100644 index dfe2ddd..0000000 --- a/config/reasoner/dl2op/main/retract_empty_strings.n3 +++ /dev/null @@ -1,26 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - -# Retract empty strings -{ - { - ?s ?p "" - } e:becomes {}. -} => {}. diff --git a/config/reasoner/dl2op/main/rrn.n3 b/config/reasoner/dl2op/main/rrn.n3 deleted file mode 100644 index a87e31d..0000000 --- a/config/reasoner/dl2op/main/rrn.n3 +++ /dev/null @@ -1,60 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - -# Rijksregisternummer -# Extend identifiers to match OP's model -# skos:notation "00010100105". -{ - ?identifier skos:notation ?notation. - ?notation string:notEqualIgnoringCase "Rijksregisternummer". - ?identifier log:uri ?identifierString. - (?identifierString "STRUCTURED_IDENTIFIER") string:concatenation ?hashInput. - ?hashInput crypto:md5 ?uuid. - ("http://data.lblod.info/id/gestructureerdeIdentificatoren/" ?uuid) string:concatenation ?structuredIdString. - ?structuredIdentifier log:uri ?structuredIdString. - - { - ?identifier skos:notation ?notation. - } e:becomes { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - }. - -} => { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - - ?structuredIdentifier a generiek:GestructureerdeIdentificator ; - mu:uuid ?uuid ; - generiek:lokaleIdentificator ?notation -}. - -# identifier property in the export is only used for RRN. -{ - { - ?s adms:identifier ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. diff --git a/config/reasoner/dl2op/private-info/inverse_relations.n3 b/config/reasoner/dl2op/private-info/inverse_relations.n3 deleted file mode 100644 index bfeda31..0000000 --- a/config/reasoner/dl2op/private-info/inverse_relations.n3 +++ /dev/null @@ -1,33 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Inverse properties -{ - ?s org:holds ?o. -} => { - ?o org:heldBy ?s. -}. - -{ - ?s org:heldBy ?o. -} => { - ?o org:holds ?s. -}. diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 deleted file mode 100644 index b174238..0000000 --- a/config/reasoner/dl2op/private-info/mapping.n3 +++ /dev/null @@ -1,196 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: -PREFIX ch: - - -# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!) -# Hence the mapping is in two steps. -# The first step maps the DL persoon:gebruikteVoornaam to the OP counterpart -# and drops the DL persoon:gebruikteVoornaam statements with e:becomes -# A second reasoning will map DL foaf:name to OP persoon:gebruikteVoornaam -# Doing both at once would lead all DL foaf:names to incorrectly become foaf:givennames -# in OP - -# First name -# persoon:gebruikteVoornaam => foaf:givenName -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock DL -# persoon_loket:gebruikteVoornaam "Didier". - -{ - { - ?s persoon_loket:gebruikteVoornaam ?o - } e:becomes { - ?s foaf:givenName ?o - } -} => { - ?s foaf:givenName ?o -}. - - -# First name -# persoon:gebruikteVoornaam => foaf:givenName (done in pre-processing) -# Alternatieve voornaam -# foaf:name => persoon:gebruikteVoornaam - -# Test Mock LLB -# foaf:name "Didier". -{ - { - ?s foaf:name ?o - } e:becomes { - ?s persoon:gebruikteVoornaam ?o - } -} => { - ?s persoon:gebruikteVoornaam ?o -}. - -# Test -# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. -{ - ?s mandaat:bindingStart ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:bindingStart ?startDate - } e:becomes { - ?s mandaat:bindingStart ?startDateTime - }. -} => { - ?s mandaat:bindingStart ?startDateTime -}. - -{ - ?s mandaat:bindingEinde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:bindingEinde ?eindeDate - } e:becomes { - ?s mandaat:bindingEinde ?eindeDateTime - }. -} => { - ?s mandaat:bindingEinde ?eindeDateTime -}. - -{ - ?s mandaat:start ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s mandaat:start ?startDate - } e:becomes { - ?s mandaat:start ?startDateTime - }. -} => { - ?s mandaat:start ?startDateTime -}. - -{ - ?s mandaat:einde ?eindeDate. - # use backward arrow rule defined below - ?eindeDate :dateTimeFromDate ?eindeDateTime. - { - ?s mandaat:einde ?eindeDate - } e:becomes { - ?s mandaat:einde ?eindeDateTime - }. -} => { - ?s mandaat:einde ?eindeDateTime -}. - -{ - ?s ch:startdatum ?startDate. - # use backward arrow rule defined below - ?startDate :dateTimeFromDate ?startDateTime. - { - ?s ch:startdatum ?startDate - } e:becomes { - ?s ch:startdatum ?startDateTime - }. -} => { - ?s ch:startdatum ?startDateTime -}. - -{ - ?s ch:eindedatum ?endDate. - # use backward arrow rule defined below - ?endDate :dateTimeFromDate ?endDateTime. - { - ?s ch:eindedatum ?endDate - } e:becomes { - ?s ch:eindedatum ?endDateTime - }. -} => { - ?s ch:eindedatum ?endDateTime -}. - -# Backward arrow rule is like a function call. -# Removes the timezone indicator "Z" from incoming datetimes -# To make sure all datetimes have the same convention we now save them as -# datetime without the timezone indicator -# We use "T02:00:00" as time indicator to work around a virtuoso bug that -# results in datetimes being converted to a date when using "T00:00:00" -{ - ?date :dateTimeFromDate ?dateTime -} -<= -{ - ( ?date 1 10 ) string:substring ?dateSolo . - (?dateSolo "T02:00:00") string:concatenation ?datePlusTime. - (?datePlusTime xsd:dateTime) log:dtlit ?dateTime . -}. - -# ex:orgA besluit:classificatie . -{ - { - ?s besluit:classificatie ?o - } e:becomes { - ?s org:classification ?o - } -} => { - ?s org:classification ?o -}. - -# fix typo V -> v -# "1" . -{ - { - ?s adres:AdresVoorstelling.huisnummer ?o - } e:becomes { - ?s adres:Adresvoorstelling.huisnummer ?o - } -} => { - ?s adres:Adresvoorstelling.huisnummer ?o -}. - - -# Tijdspecialisatie -{ - { - ?s mandaat:isTijdspecialisatieVan ?o. - } e:becomes { - ?s generiek:isTijdspecialisatieVan ?o. - } -} => { - ?s generiek:isTijdspecialisatieVan ?o. -}. diff --git a/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 b/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 deleted file mode 100644 index 8afa661..0000000 --- a/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 +++ /dev/null @@ -1,524 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Map from http persoon to https persoon namespace. - -## classes: -{ - { - ?s a persoon_loket:Afstamming - } e:becomes { - ?s a persoon:Afstamming - } -} => { - ?s a persoon:Afstamming -}. - -{ - { - ?s a persoon_loket:BurgerlijkeStaat - } e:becomes { - ?s a persoon:BurgerlijkeStaat - } -} => { - ?s a persoon:BurgerlijkeStaat -}. - -{ - { - ?s a persoon_loket:Domicilie - } e:becomes { - ?s a persoon:Domicilie - } -} => { - ?s a persoon:Domicilie -}. - -{ - { - ?s a persoon_loket:Geboorte - } e:becomes { - ?s a persoon:Geboorte - } -} => { - ?s a persoon:Geboorte -}. - -{ - { - ?s a persoon_loket:GeenInwoner - } e:becomes { - ?s a persoon:GeenInwoner - } -} => { - ?s a persoon:GeenInwoner -}. - -{ - { - ?s a persoon_loket:GeregistreerdPersoon - } e:becomes { - ?s a persoon:GeregistreerdPersoon - } -} => { - ?s a persoon:GeregistreerdPersoon -}. - -{ - { - ?s a persoon_loket:Gezin - } e:becomes { - ?s a persoon:Gezin - } -} => { - ?s a persoon:Gezin -}. - -{ - { - ?s a persoon_loket:Gezinsrelatie - } e:becomes { - ?s a persoon:Gezinsrelatie - } -} => { - ?s a persoon:Gezinsrelatie -}. - -{ - { - ?s a persoon_loket:Huwelijk - } e:becomes { - ?s a persoon:Huwelijk - } -} => { - ?s a persoon:Huwelijk -}. - -{ - { - ?s a persoon_loket:Inwoner - } e:becomes { - ?s a persoon:Inwoner - } -} => { - ?s a persoon:Inwoner -}. - -{ - { - ?s a persoon_loket:Inwonerschap - } e:becomes { - ?s a persoon:Inwonerschap - } -} => { - ?s a persoon:Inwonerschap -}. - -{ - { - ?s a persoon_loket:Nationaliteit - } e:becomes { - ?s a persoon:Nationaliteit - } -} => { - ?s a persoon:Nationaliteit -}. - -{ - { - ?s a persoon_loket:Overlijden - } e:becomes { - ?s a persoon:Overlijden - } -} => { - ?s a persoon:Overlijden -}. - -{ - { - ?s a persoon_loket:PermanentInwoner - } e:becomes { - ?s a persoon:PermanentInwoner - } -} => { - ?s a persoon:PermanentInwoner -}. - -{ - { - ?s a persoon_loket:Persoonsgebeurtenis - } e:becomes { - ?s a persoon:Persoonsgebeurtenis - } -} => { - ?s a persoon:Persoonsgebeurtenis -}. - -{ - { - ?s a persoon_loket:Persoonsrelatie - } e:becomes { - ?s a persoon:Persoonsrelatie - } -} => { - ?s a persoon:Persoonsrelatie -}. - -{ - { - ?s a persoon_loket:Samenwonen - } e:becomes { - ?s a persoon:Samenwonen - } -} => { - ?s a persoon:Samenwonen -}. - -{ - { - ?s a persoon_loket:Staatsburger - } e:becomes { - ?s a persoon:Staatsburger - } -} => { - ?s a persoon:Staatsburger -}. - -{ - { - ?s a persoon_loket:Staatsburgerschap - } e:becomes { - ?s a persoon:Staatsburgerschap - } -} => { - ?s a persoon:Staatsburgerschap -}. - -{ - { - ?s a persoon_loket:TijdelijkInwoner - } e:becomes { - ?s a persoon:TijdelijkInwoner - } -} => { - ?s a persoon:TijdelijkInwoner -}. - -{ - { - ?s a persoon_loket:Verblijfplaats - } e:becomes { - ?s a persoon:Verblijfplaats - } -} => { - ?s a persoon:Verblijfplaats -}. - -{ - { - ?s a persoon_loket:Voogdij - } e:becomes { - ?s a persoon:Voogdij - } -} => { - ?s a persoon:Voogdij -}. - -{ - { - ?s a persoon_loket:Vreemdeling - } e:becomes { - ?s a persoon:Vreemdeling - } -} => { - ?s a persoon:Vreemdeling -}. - -## properties -{ - { - ?s persoon_loket:afstammingsType ?o - } e:becomes { - ?s persoon:afstammingsType ?o - } -} => { - ?s persoon:afstammingsType ?o -}. - -{ - { - ?s persoon_loket:alternatieveNaam ?o - } e:becomes { - ?s persoon:alternatieveNaam ?o - } -} => { - ?s persoon:alternatieveNaam ?o -}. - -{ - { - ?s persoon_loket:datum ?o - } e:becomes { - ?s persoon:datum ?o - } -} => { - ?s persoon:datum ?o -}. - -{ - { - ?s persoon_loket:datumVanAfstamming ?o - } e:becomes { - ?s persoon:datumVanAfstamming ?o - } -} => { - ?s persoon:datumVanAfstamming ?o -}. - -{ - { - ?s persoon_loket:geslacht ?o - } e:becomes { - ?s persoon:geslacht ?o - } -} => { - ?s persoon:geslacht ?o -}. - -{ - { - ?s persoon_loket:gezinsadres ?o - } e:becomes { - ?s persoon:gezinsadres ?o - } -} => { - ?s persoon:gezinsadres ?o -}. - -{ - { - ?s persoon_loket:gezinsrelatietype ?o - } e:becomes { - ?s persoon:gezinsrelatietype ?o - } -} => { - ?s persoon:gezinsrelatietype ?o -}. - -{ - { - ?s persoon_loket:heeftBurgerlijkeStaat ?o - } e:becomes { - ?s persoon:heeftBurgerlijkeStaat ?o - } -} => { - ?s persoon:heeftBurgerlijkeStaat ?o -}. - -{ - { - ?s persoon_loket:heeftGeboorte ?o - } e:becomes { - ?s persoon:heeftGeboorte ?o - } -} => { - ?s persoon:heeftGeboorte ?o -}. - -{ - { - ?s persoon_loket:heeftInwonerschap ?o - } e:becomes { - ?s persoon:heeftInwonerschap ?o - } -} => { - ?s persoon:heeftInwonerschap ?o -}. - -{ - { - ?s persoon_loket:heeftNationaliteit ?o - } e:becomes { - ?s persoon:heeftNationaliteit ?o - } -} => { - ?s persoon:heeftNationaliteit ?o -}. - -{ - { - ?s persoon_loket:heeftOverlijden ?o - } e:becomes { - ?s persoon:heeftOverlijden ?o - } -} => { - ?s persoon:heeftOverlijden ?o -}. - -{ - { - ?s persoon_loket:heeftPersoonsrelatie ?o - } e:becomes { - ?s persoon:heeftPersoonsrelatie ?o - } -} => { - ?s persoon:heeftPersoonsrelatie ?o -}. - -{ - { - ?s persoon_loket:heeftStaatsburgerschap ?o - } e:becomes { - ?s persoon:heeftStaatsburgerschap ?o - } -} => { - ?s persoon:heeftStaatsburgerschap ?o -}. - -{ - { - ?s persoon_loket:heeftVerblijfplaats ?o - } e:becomes { - ?s persoon:heeftVerblijfplaats ?o - } -} => { - ?s persoon:heeftVerblijfplaats ?o -}. - -{ - { - ?s persoon_loket:Inwonerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Inwonerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Inwonerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:isHoofdVan ?o - } e:becomes { - ?s persoon:isHoofdVan ?o - } -} => { - ?s persoon:isHoofdVan ?o -}. - -{ - { - ?s persoon_loket:isLidVan ?o - } e:becomes { - ?s persoon:isLidVan ?o - } -} => { - ?s persoon:isLidVan ?o -}. - -{ - { - ?s persoon_loket:isRelatieMet ?o - } e:becomes { - ?s persoon:isRelatieMet ?o - } -} => { - ?s persoon:isRelatieMet ?o -}. - -{ - { - ?s persoon_loket:land ?o - } e:becomes { - ?s persoon:land ?o - } -} => { - ?s persoon:land ?o -}. - -{ - { - ?s persoon_loket:nationaliteit ?o - } e:becomes { - ?s persoon:nationaliteit ?o - } -} => { - ?s persoon:nationaliteit ?o -}. - -{ - { - ?s persoon_loket:plaats ?o - } e:becomes { - ?s persoon:plaats ?o - } -} => { - ?s persoon:plaats ?o -}. - -{ - { - ?s persoon_loket:registratie ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. - -{ - { - ?s persoon_loket:Staatsburgerschap.binnenJurisdictie ?o - } e:becomes { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o - } -} => { - ?s persoon:Staatsburgerschap.binnenJurisdictie ?o -}. - -{ - { - ?s persoon_loket:type ?o - } e:becomes { - ?s persoon:type ?o - } -} => { - ?s persoon:type ?o -}. - -{ - { - ?s persoon_loket:verblijfsadres ?o - } e:becomes { - ?s persoon:verblijfsadres ?o - } -} => { - ?s persoon:verblijfsadres ?o -}. - -{ - { - ?s persoon_loket:volledigeNaam ?o - } e:becomes { - ?s persoon:volledigeNaam ?o - } -} => { - ?s persoon:volledigeNaam ?o -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/private-info/query.n3q b/config/reasoner/dl2op/private-info/query.n3q deleted file mode 100644 index bddbb11..0000000 --- a/config/reasoner/dl2op/private-info/query.n3q +++ /dev/null @@ -1,90 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - - -# Rijksregisternummer -# Extend identifiers to match OP's model -# skos:notation "00010100105". -{ - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - - ?structuredIdentifier a generiek:GestructureerdeIdentificator ; - mu:uuid ?uuid ; - generiek:lokaleIdentificator ?notation -} => { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - - ?structuredIdentifier a generiek:GestructureerdeIdentificator ; - mu:uuid ?uuid ; - generiek:lokaleIdentificator ?notation -}. - -# identifier property in the export is only used for RRN. -{ - ?s persoon:registratie ?o -} => { - ?s persoon:registratie ?o -}. - -{ - ?s a - } => { - ?s a -}. - -# Nationality -{ - ?s persoon:heeftNationaliteit ?o -} => { - ?s persoon:heeftNationaliteit ?o -}. - - -# Birth and related attributes -{ - ?s a persoon:Geboorte; - ?p ?o. -} => { - ?s a persoon:Geboorte; - ?p ?o. -}. - -{ - ?s persoon:heeftGeboorte ?o -} => { - ?s persoon:heeftGeboorte ?o -}. - -{ - ?s persoon:datum ?o -} => { - ?s persoon:datum ?o -}. - -# Gender -{ - ?s persoon:geslacht ?o -} => { - ?s persoon:geslacht ?o -}. \ No newline at end of file diff --git a/config/reasoner/dl2op/private-info/retract_empty_strings.n3 b/config/reasoner/dl2op/private-info/retract_empty_strings.n3 deleted file mode 100644 index f8204a7..0000000 --- a/config/reasoner/dl2op/private-info/retract_empty_strings.n3 +++ /dev/null @@ -1,27 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - -# Retract empty strings -{ - { - ?s ?p "" - } e:becomes {}. -} => {}. diff --git a/config/reasoner/dl2op/private-info/rrn.n3 b/config/reasoner/dl2op/private-info/rrn.n3 deleted file mode 100644 index b45c688..0000000 --- a/config/reasoner/dl2op/private-info/rrn.n3 +++ /dev/null @@ -1,62 +0,0 @@ -PREFIX : <#> -PREFIX adms: -PREFIX adres: -PREFIX besluit: -PREFIX crypto: -PREFIX e: -PREFIX ex: -PREFIX foaf: -PREFIX func: -PREFIX generiek: -PREFIX log: -PREFIX mandaat: -PREFIX mu: -PREFIX org: -PREFIX persoon: -PREFIX persoon_loket: -PREFIX skos: -PREFIX string: -PREFIX xsd: - - - -# Rijksregisternummer -# Extend identifiers to match OP's model -# skos:notation "00010100105". -{ - ?identifier skos:notation ?notation. - ?notation string:notEqualIgnoringCase "Rijksregisternummer". - ?identifier log:uri ?identifierString. - (?identifierString "STRUCTURED_IDENTIFIER") string:concatenation ?hashInput. - ?hashInput crypto:md5 ?uuid. - ("http://data.lblod.info/id/gestructureerdeIdentificatoren/" ?uuid) string:concatenation ?structuredIdString. - ?structuredIdentifier log:uri ?structuredIdString. - - { - ?identifier skos:notation ?notation. - } e:becomes { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - }. - -} => { - ?identifier - generiek:gestructureerdeIdentificator ?structuredIdentifier ; - skos:notation "Rijksregisternummer" . - - ?structuredIdentifier a generiek:GestructureerdeIdentificator ; - mu:uuid ?uuid ; - generiek:lokaleIdentificator ?notation -}. - -# identifier property in the export is only used for RRN. -{ - { - ?s adms:identifier ?o - } e:becomes { - ?s persoon:registratie ?o - } -} => { - ?s persoon:registratie ?o -}. diff --git a/config/resources/domain.json b/config/resources/domain.json index 75d6754..6fbe141 100644 --- a/config/resources/domain.json +++ b/config/resources/domain.json @@ -29,7 +29,8 @@ "code": "http://lblod.data.gift/vocabularies/organisatie/", "ext": "http://mu.semte.ch/vocabularies/ext/", "geo": "http://www.opengis.net/ont/geosparql#", - "nacebel": "http://data.gift/vocabularies/nace-bel/" + "nacebel": "http://data.gift/vocabularies/nace-bel/", + "time": "http://www.w3.org/2006/time#" }, "resources": { "agents": { @@ -439,36 +440,15 @@ "target": "posts", "cardinality": "many" }, - "associated-organizations": { - "predicate": "org:linkedTo", - "target": "organizations", - "cardinality": "many" - }, - "sub-organizations": { - "predicate": "org:hasSubOrganization", - "target": "organizations", - "cardinality": "many" - }, - "is-associated-with": { - "predicate": "org:linkedTo", - "target": "organizations", - "cardinality": "one", + "memberships-of-organizations": { + "predicate": "org:member", + "target": "memberships", + "cardinality": "many", "inverse": true }, - "is-sub-organization-of": { - "predicate": "org:hasSubOrganization", - "target": "organizations", - "cardinality": "one", - "inverse": true - }, - "founded-organizations": { - "predicate": "ext:isFounderOfOrganization", - "target": "organizations", - "cardinality": "many" - }, - "was-founded-by-organizations": { - "predicate": "ext:isFounderOfOrganization", - "target": "organizations", + "memberships": { + "predicate": "org:organization", + "target": "memberships", "cardinality": "many", "inverse": true }, @@ -482,17 +462,6 @@ "target": "nace-bel-codes", "cardinality": "many" }, - "participates-in": { - "predicate": "org:memberOf", - "target": "organizations", - "cardinality": "many" - }, - "has-participants": { - "predicate": "org:memberOf", - "target": "organizations", - "cardinality": "many", - "inverse": true - }, "kbo-organization": { "predicate": "owl:sameAs", "target": "kbo-organizations", @@ -862,6 +831,68 @@ }, "new-resource-base": "http://data.lblod.info/id/vestigingen/" }, + "memberships": { + "class": "org:Membership", + "relationships": { + "member": { + "predicate": "org:member", + "target": "organizations", + "cardinality": "one" + }, + "organization": { + "predicate": "org:organization", + "target": "organizations", + "cardinality": "one" + }, + "role": { + "predicate": "org:role", + "target": "membership-roles", + "cardinality": "one" + }, + "during": { + "predicate": "euro:memberDuring", + "target": "period-of-time", + "cardinality": "one" + } + }, + "new-resource-base": "http://data.lblod.info/id/lidmaatschap/" + }, + "membership-roles": { + "class": "org:Role", + "attributes": { + "label": { + "predicate": "skos:prefLabel", + "type": "string" + } + }, + "relationships": { + "top-concept-of": { + "predicate": "skos:topConceptOf", + "target": "concepts", + "cardinality": "one" + }, + "has-broader-role": { + "predicate": "skos:broader", + "target": "membership-roles", + "cardinality": "one" + } + }, + "new-resource-base": "http://data.lblod.info/id/rollen/" + }, + "period-of-time": { + "class": "time:ProperInterval", + "attributes": { + "start-date": { + "predicate": "time:hasBeginning", + "type": "datetime" + }, + "end-date": { + "predicate": "time:hasEnd", + "type": "datetime" + } + }, + "new-resource-base": "http://data.lblod.info/id/periode/" + }, "concepts": { "class": "skos:Concept", "attributes": { diff --git a/config/search/config.json b/config/search/config.json index 3a5d67e..95a016e 100644 --- a/config/search/config.json +++ b/config/search/config.json @@ -92,22 +92,18 @@ "http://data.lblod.info/vocabularies/erediensten/EredienstMandataris" ], "properties": { - "given_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/givenName" - ], "person_id": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "http://mu.semte.ch/vocabularies/core/uuid" ], - "person_uuid": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], "family_name": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "http://xmlns.com/foaf/0.1/familyName" ], + "given_name": [ + "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", + "http://xmlns.com/foaf/0.1/givenName" + ], "first_name_used": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" @@ -135,24 +131,6 @@ "http://data.vlaanderen.be/ns/besluit#bestuurt", "http://www.w3.org/2004/02/skos/core#prefLabel" ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], "position_id": [ "http://www.w3.org/ns/org#holds", "http://www.w3.org/ns/org#role", @@ -166,6 +144,14 @@ }, "mappings": { "properties": { + "person_id": { + "type": "text", + "fields": { + "field": { + "type": "keyword" + } + } + }, "family_name": { "type": "text", "fields": { @@ -175,14 +161,6 @@ } } }, - "id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, "given_name": { "type": "text", "fields": { @@ -192,6 +170,18 @@ } } }, + "first_name_used": { + "type": "text", + "fields": { + "field": { + "type": "keyword", + "normalizer": "custom_sort_normalizer" + } + } + }, + "end_date": { + "type": "date" + }, "organization_id": { "type": "text" }, @@ -204,15 +194,6 @@ } } }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "organization_name": { "type": "text", "fields": { @@ -222,15 +203,6 @@ } } }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "position_id": { "type": "text" }, @@ -242,9 +214,6 @@ "normalizer": "custom_sort_normalizer" } } - }, - "end_date": { - "type": "date" } } } @@ -254,22 +223,18 @@ "on_path": "functionaries", "rdf_type": "http://data.lblod.info/vocabularies/leidinggevenden/Functionaris", "properties": { - "given_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/givenName" - ], "person_id": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "http://mu.semte.ch/vocabularies/core/uuid" ], - "person_uuid": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], "family_name": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "http://xmlns.com/foaf/0.1/familyName" ], + "given_name": [ + "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", + "http://xmlns.com/foaf/0.1/givenName" + ], "first_name_used": [ "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" @@ -297,24 +262,6 @@ "http://data.vlaanderen.be/ns/besluit#bestuurt", "http://www.w3.org/2004/02/skos/core#prefLabel" ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], "position_id": [ "http://www.w3.org/ns/org#holds", "http://www.w3.org/ns/org#role", @@ -328,6 +275,14 @@ }, "mappings": { "properties": { + "person_id": { + "type": "text", + "fields": { + "field": { + "type": "keyword" + } + } + }, "family_name": { "type": "text", "fields": { @@ -337,14 +292,6 @@ } } }, - "id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, "given_name": { "type": "text", "fields": { @@ -354,6 +301,18 @@ } } }, + "first_name_used": { + "type": "text", + "fields": { + "field": { + "type": "keyword", + "normalizer": "custom_sort_normalizer" + } + } + }, + "end_date": { + "type": "date" + }, "organization_id": { "type": "text" }, @@ -366,15 +325,6 @@ } } }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "organization_name": { "type": "text", "fields": { @@ -384,15 +334,6 @@ } } }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "position_id": { "type": "text" }, @@ -404,9 +345,6 @@ "normalizer": "custom_sort_normalizer" } } - }, - "end_date": { - "type": "date" } } } @@ -419,22 +357,18 @@ "http://data.lblod.info/vocabularies/contacthub/AgentInPositie" ], "properties": { - "given_name": [ - "http://www.w3.org/ns/org#heldBy", - "http://xmlns.com/foaf/0.1/givenName" - ], "person_id": [ "http://www.w3.org/ns/org#heldBy", "http://mu.semte.ch/vocabularies/core/uuid" ], - "person_uuid": [ - "http://www.w3.org/ns/org#heldBy", - "http://mu.semte.ch/vocabularies/core/uuid" - ], "family_name": [ "http://www.w3.org/ns/org#heldBy", "http://xmlns.com/foaf/0.1/familyName" ], + "given_name": [ + "http://www.w3.org/ns/org#heldBy", + "http://xmlns.com/foaf/0.1/givenName" + ], "first_name_used": [ "http://www.w3.org/ns/org#heldBy", "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" @@ -456,20 +390,6 @@ "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", "http://www.w3.org/2004/02/skos/core#prefLabel" ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], "position_id": [ "http://www.w3.org/ns/org#holds", "http://data.lblod.info/vocabularies/erediensten/functie", @@ -483,6 +403,14 @@ }, "mappings": { "properties": { + "person_id": { + "type": "text", + "fields": { + "field": { + "type": "keyword" + } + } + }, "family_name": { "type": "text", "fields": { @@ -492,14 +420,6 @@ } } }, - "person_id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, "given_name": { "type": "text", "fields": { @@ -509,6 +429,18 @@ } } }, + "first_name_used": { + "type": "text", + "fields": { + "field": { + "type": "keyword", + "normalizer": "custom_sort_normalizer" + } + } + }, + "end_date": { + "type": "date" + }, "organization_id": { "type": "text" }, @@ -521,15 +453,6 @@ } } }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "organization_name": { "type": "text", "fields": { @@ -539,15 +462,6 @@ } } }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "position_id": { "type": "text" }, @@ -559,9 +473,6 @@ "normalizer": "custom_sort_normalizer" } } - }, - "end_date": { - "type": "date" } } } @@ -571,14 +482,6 @@ "composite_types": ["minister", "functionary", "mandatory"], "on_path": "people", "properties": [ - { - "name": "given_name", - "mappings": { - "minister": "given_name", - "functionary": "given_name", - "mandatory": "given_name" - } - }, { "name": "person_id", "mappings": { @@ -595,6 +498,14 @@ "mandatory": "family_name" } }, + { + "name": "given_name", + "mappings": { + "minister": "given_name", + "functionary": "given_name", + "mandatory": "given_name" + } + }, { "name": "first_name_used", "mappings": { @@ -635,22 +546,6 @@ "mandatory": "organization_name" } }, - { - "name": "organization_municipality", - "mappings": { - "minister": "organization_municipality", - "functionary": "organization_municipality", - "mandatory": "organization_municipality" - } - }, - { - "name": "organization_province", - "mappings": { - "minister": "organization_province", - "functionary": "organization_province", - "mandatory": "organization_province" - } - }, { "name": "position_id", "mappings": { @@ -670,6 +565,14 @@ ], "mappings": { "properties": { + "person_id": { + "type": "text", + "fields": { + "field": { + "type": "keyword" + } + } + }, "family_name": { "type": "text", "fields": { @@ -679,14 +582,6 @@ } } }, - "id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, "given_name": { "type": "text", "fields": { @@ -696,6 +591,18 @@ } } }, + "first_name_used": { + "type": "text", + "fields": { + "field": { + "type": "keyword", + "normalizer": "custom_sort_normalizer" + } + } + }, + "end_date": { + "type": "date" + }, "organization_id": { "type": "text" }, @@ -708,15 +615,6 @@ } } }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "organization_name": { "type": "text", "fields": { @@ -726,15 +624,6 @@ } } }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, "position_id": { "type": "text" }, @@ -746,9 +635,6 @@ "normalizer": "custom_sort_normalizer" } } - }, - "end_date": { - "type": "date" } } } @@ -810,12 +696,6 @@ }, "mappings": { "properties": { - "classification_id": { - "type": "text" - }, - "recognized_worship_type_id": { - "type": "text" - }, "name": { "type": "text", "fields": { @@ -843,6 +723,9 @@ } } }, + "classification_id": { + "type": "text" + }, "classification_name": { "type": "text", "fields": { @@ -861,6 +744,12 @@ } } }, + "status_id": { + "type": "text" + }, + "recognized_worship_type_id": { + "type": "text" + }, "recognized_worship_type_name": { "type": "text", "fields": { diff --git a/config/search/dev/config.json b/config/search/dev/config.json deleted file mode 100644 index ab1902c..0000000 --- a/config/search/dev/config.json +++ /dev/null @@ -1,877 +0,0 @@ -{ - "automatic_index_updates": true, - "persist_indexes": true, - "number_of_threads": 8, - "eager_indexing_groups": [ - [ - { - "variables": [], - "name": "acmidm-worship-editeerder" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } - ], - [ - { - "variables": [], - "name": "acmidm-editeerder" - }, - { - "variables": [], - "name": "clean" - }, - { - "variables": [], - "name": "public" - } - ] - ], - "default_settings": { - "analysis": { - "normalizer": { - "custom_sort_normalizer": { - "type": "custom", - "char_filter": [], - "filter": ["lowercase", "trim", "asciifolding"] - }, - "identifier_normalizer": { - "type": "custom", - "char_filter": ["identifier_alphanumeric_filter"], - "filter": ["lowercase", "trim", "asciifolding"] - } - }, - "char_filter": { - "identifier_alphanumeric_filter": { - "type": "pattern_replace", - "pattern": "[^a-zA-Z0-9]", - "replacement": "" - } - } - } - }, - "types": [ - { - "type": "mandatory", - "on_path": "mandatories", - "rdf_type": [ - "http://data.vlaanderen.be/ns/mandaat#Mandataris", - "http://data.lblod.info/vocabularies/erediensten/EredienstMandataris" - ], - "properties": { - "given_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/givenName" - ], - "person_id": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "person_uuid": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "family_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/familyName" - ], - "first_name_used": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" - ], - "end_date": "http://data.vlaanderen.be/ns/mandaat#einde", - "organization_id": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "organization_classification": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#classification", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_name": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://www.w3.org/ns/org#hasPost", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], - "position_id": [ - "http://www.w3.org/ns/org#holds", - "http://www.w3.org/ns/org#role", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "position_name": [ - "http://www.w3.org/ns/org#holds", - "http://www.w3.org/ns/org#role", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ] - }, - "mappings": { - "properties": { - "family_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "person_id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, - "given_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_id": { - "type": "text" - }, - "organization_classification": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "position_id": { - "type": "text" - }, - "position_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "end_date": { - "type": "date" - } - } - } - }, - { - "type": "functionary", - "on_path": "functionaries", - "rdf_type": "http://data.lblod.info/vocabularies/leidinggevenden/Functionaris", - "properties": { - "given_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/givenName" - ], - "person_id": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "person_uuid": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "family_name": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "http://xmlns.com/foaf/0.1/familyName" - ], - "first_name_used": [ - "http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan", - "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" - ], - "end_date": "http://data.vlaanderen.be/ns/mandaat#einde", - "organization_id": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "organization_classification": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#classification", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_name": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie", - "https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan", - "http://data.vlaanderen.be/ns/besluit#bestuurt", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], - "position_id": [ - "http://www.w3.org/ns/org#holds", - "http://www.w3.org/ns/org#role", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "position_name": [ - "http://www.w3.org/ns/org#holds", - "http://www.w3.org/ns/org#role", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ] - }, - "mappings": { - "properties": { - "family_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "person_id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, - "given_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_id": { - "type": "text" - }, - "organization_classification": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "position_id": { - "type": "text" - }, - "position_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "end_date": { - "type": "date" - } - } - } - }, - { - "type": "minister", - "on_path": "ministers", - "rdf_type": [ - "http://data.lblod.info/vocabularies/erediensten/RolBedienaar", - "http://data.lblod.info/vocabularies/contacthub/AgentInPositie" - ], - "properties": { - "given_name": [ - "http://www.w3.org/ns/org#heldBy", - "http://xmlns.com/foaf/0.1/givenName" - ], - "person_id": [ - "http://www.w3.org/ns/org#heldBy", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "person_uuid": [ - "http://www.w3.org/ns/org#heldBy", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "family_name": [ - "http://www.w3.org/ns/org#heldBy", - "http://xmlns.com/foaf/0.1/familyName" - ], - "first_name_used": [ - "http://www.w3.org/ns/org#heldBy", - "https://data.vlaanderen.be/ns/persoon#gebruikteVoornaam" - ], - "end_date": "http://data.lblod.info/vocabularies/contacthub/eindedatum", - "organization_id": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "organization_classification": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/ns/org#classification", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_name": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "organization_municipality": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "organization_province": [ - "http://www.w3.org/ns/org#holds", - "^http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor", - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], - "position_id": [ - "http://www.w3.org/ns/org#holds", - "http://data.lblod.info/vocabularies/erediensten/functie", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "position_name": [ - "http://www.w3.org/ns/org#holds", - "http://data.lblod.info/vocabularies/erediensten/functie", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ] - }, - "mappings": { - "properties": { - "family_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "person_id": { - "type": "text", - "fields": { - "field": { - "type": "keyword" - } - } - }, - "given_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_id": { - "type": "text" - }, - "organization_classification": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "position_id": { - "type": "text" - }, - "position_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "end_date": { - "type": "date" - } - } - } - }, - { - "type": "person", - "composite_types": ["minister", "functionary", "mandatory"], - "on_path": "people", - "properties": [ - { - "name": "given_name", - "mappings": { - "minister": "given_name", - "functionary": "given_name", - "mandatory": "given_name" - } - }, - { - "name": "person_id", - "mappings": { - "minister": "person_id", - "functionary": "person_id", - "mandatory": "person_id" - } - }, - { - "name": "family_name", - "mappings": { - "minister": "family_name", - "functionary": "family_name", - "mandatory": "family_name" - } - }, - { - "name": "first_name_used", - "mappings": { - "minister": "first_name_used", - "functionary": "first_name_used", - "mandatory": "first_name_used" - } - }, - { - "name": "end_date", - "mappings": { - "minister": "end_date", - "functionary": "end_date", - "mandatory": "end_date" - } - }, - { - "name": "organization_id", - "mappings": { - "minister": "organization_id", - "functionary": "organization_id", - "mandatory": "organization_id" - } - }, - { - "name": "organization_classification", - "mappings": { - "minister": "organization_classification", - "functionary": "organization_classification", - "mandatory": "organization_classification" - } - }, - { - "name": "organization_name", - "mappings": { - "minister": "organization_name", - "functionary": "organization_name", - "mandatory": "organization_name" - } - }, - { - "name": "organization_municipality", - "mappings": { - "minister": "organization_municipality", - "functionary": "organization_municipality", - "mandatory": "organization_municipality" - } - }, - { - "name": "organization_province", - "mappings": { - "minister": "organization_province", - "functionary": "organization_province", - "mandatory": "organization_province" - } - }, - { - "name": "position_id", - "mappings": { - "minister": "position_id", - "functionary": "position_id", - "mandatory": "position_id" - } - }, - { - "name": "position_name", - "mappings": { - "minister": "position_name", - "functionary": "position_name", - "mandatory": "position_name" - } - } - ], - "mappings": { - "properties": { - "family_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "person_id": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "given_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_id": { - "type": "text" - }, - "organization_classification": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "organization_municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "position_id": { - "type": "text" - }, - "position_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "end_date": { - "type": "date" - } - } - } - }, - { - "type": "organization", - "on_path": "organizations", - "rdf_type": [ - "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", - "http://data.lblod.info/vocabularies/erediensten/EredienstBestuurseenheid", - "http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst", - "http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst", - "http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan", - "http://www.w3.org/ns/regorg#RegisteredOrganization" - ], - "properties": { - "name": "http://www.w3.org/2004/02/skos/core#prefLabel", - "legal_name": "http://www.w3.org/ns/regorg#legalName", - "alternative_name": "http://www.w3.org/2004/02/skos/core#altLabel", - "classification_id": [ - "http://www.w3.org/ns/org#classification", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "classification_name": [ - "http://www.w3.org/ns/org#classification", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "status": [ - "http://www.w3.org/ns/regorg#orgStatus", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "status_id": [ - "http://www.w3.org/ns/regorg#orgStatus", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "recognized_worship_type_id": [ - "http://data.lblod.info/vocabularies/erediensten/typeEredienst", - "http://mu.semte.ch/vocabularies/core/uuid" - ], - "recognized_worship_type_name": [ - "http://data.lblod.info/vocabularies/erediensten/typeEredienst", - "http://www.w3.org/2004/02/skos/core#prefLabel" - ], - "province": [ - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "http://www.w3.org/ns/locn#adminUnitL2" - ], - "municipality": [ - "http://www.w3.org/ns/org#hasPrimarySite", - "https://data.vlaanderen.be/ns/organisatie#bestaatUit", - "https://data.vlaanderen.be/ns/adres#gemeentenaam" - ], - "identifier": [ - "http://www.w3.org/ns/adms#identifier", - "https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator", - "https://data.vlaanderen.be/ns/generiek#lokaleIdentificator" - ] - }, - "mappings": { - "properties": { - "classification_id": { - "type": "text" - }, - "recognized_worship_type_id": { - "type": "text" - }, - "name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "legal_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "alternative_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "classification_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "status": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "recognized_worship_type_name": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "province": { - "type": "text", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "municipality": { - "type": "keyword", - "fields": { - "field": { - "type": "keyword", - "normalizer": "custom_sort_normalizer" - } - } - }, - "identifier": { - "type": "text", - "fields": { - "index": { - "type": "keyword", - "normalizer": "identifier_normalizer" - } - } - } - } - } - } - ] -} diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index deeebea..f9d2111 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -23,6 +23,8 @@ services: restart: "no" cache: restart: "no" + db-cleanup: + restart: "no" kalliope-api: environment: SECURITY_CONFIG_PATH: "/config/security-dev.json" @@ -56,8 +58,6 @@ services: restart: "no" search: restart: "no" - volumes: - - ./config/search/dev:/config elasticsearch: restart: "no" file: diff --git a/docker-compose.yml b/docker-compose.yml index 7847126..3b5415f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ x-logging: &default-logging services: identifier: - image: semtech/mu-identifier:1.10.1 + image: semtech/mu-identifier:1.10.3 environment: DEFAULT_MU_AUTH_ALLOWED_GROUPS_HEADER: '[{"variables":[],"name":"public"}]' SESSION_COOKIE_SECURE: "on" @@ -51,8 +51,17 @@ services: - "logging=true" restart: always logging: *default-logging + db-cleanup: + image: lblod/db-cleanup-service:0.5.1 + environment: + MU_SPARQL_ENDPOINT: "http://db:8890/sparql" + CRON_PATTERN: "23 */6 * * *" + labels: + - "logging=true" + restart: always + logging: *default-logging migrations: - image: semtech/mu-migrations-service:0.7.0 + image: semtech/mu-migrations-service:0.9.0 links: - triplestore:database volumes: @@ -62,7 +71,7 @@ services: restart: always logging: *default-logging migrations-triggering-indexing: - image: semtech/mu-migrations-service:0.8.0 + image: semtech/mu-migrations-service:0.9.0 links: - db:database volumes: @@ -183,6 +192,7 @@ services: volumes: - ./config/frontend/add-x-frame-options-header.conf:/config/add-x-frame-options.conf environment: + EMBER_ENABLE_EDIT_CONTACT_DATA_FEATURE: "true" EMBER_OAUTH_API_REDIRECT_URL: "https://organisaties.abb.lblod.info/authorization/callback" EMBER_OAUTH_API_KEY: "677af572-2e2f-4e61-ad38-036723bb314c" EMBER_OAUTH_API_BASE_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/auth" @@ -201,7 +211,7 @@ services: restart: always logging: *default-logging file: - image: semtech/mu-file-service:3.2.0 + image: semtech/mu-file-service:3.4.0 volumes: - ./data/files:/share links: @@ -256,24 +266,13 @@ services: restart: always logging: *default-logging construct-organization-relationships: - image: lblod/construct-organization-relationships-service:1.0.1 - environment: - START_DATE_WORSHIP_GOVERNING_BODY: "2023-04-01T00:00:00" - END_DATE_WORSHIP_GOVERNING_BODY: "2026-03-31T00:00:00" + image: lblod/construct-organization-relationships-service:1.0.3 links: - db:database labels: - "logging=true" restart: always logging: *default-logging - reasoner: - image: eyereasoner/reasoning-service:1.0.4 - volumes: - - ./config/reasoner:/config - labels: - - "logging=true" - restart: always - logging: *default-logging report-generation: image: lblod/loket-report-generation-service:0.7.0 environment: @@ -439,6 +438,8 @@ services: image: lblod/delta-consumer:0.1.1 environment: DCR_SYNC_BASE_URL: "https://loket.lblod.info/" + DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" + DCR_SECRET_KEY: "" DCR_SERVICE_NAME: "worship-services-main-info-consumer" DCR_SYNC_DATASET_SUBJECT: "http://data.lblod.info/datasets/delta-producer/dumps/WorshipServicesSensitiveCacheGraphDump" DCR_INITIAL_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/wsSensitive/main" @@ -472,6 +473,8 @@ services: image: lblod/delta-consumer:0.1.1 environment: DCR_SYNC_BASE_URL: "https://loket.lblod.info/" + DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" + DCR_SECRET_KEY: "" DCR_SERVICE_NAME: "worship-services-private-info-consumer" DCR_SYNC_DATASET_SUBJECT: "http://data.lblod.info/datasets/delta-producer/dumps/WorshipServicesSensitiveCacheGraphDump" DCR_INITIAL_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/wsSensitive/private" @@ -501,37 +504,6 @@ services: - triplestore:virtuoso logging: *default-logging -################################################################################ - # CLB CONSUMERS - ################################################################################ - clb-contact-data-consumer: - image: lblod/delta-consumer:0.0.18 - environment: - DCR_SYNC_BASE_URL: "https://dev.contactgegevens-loket.lblod.info/" - DCR_SERVICE_NAME: "clb-contact-data-consumer" - DCR_SYNC_DATASET_SUBJECT: "http://data.lblod.info/datasets/delta-producer/dumps/ContactGegevensCacheGraphDump" - DCR_INITIAL_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/contactData" - DCR_DELTA_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/contactDataDeltaFileSyncing" - DCR_JOB_CREATOR_URI: "http://data.lblod.info/services/id/clb-contact-data-consumer" - DCR_DISABLE_INITIAL_SYNC: "false" - BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES: "true" - DCR_SYNC_FILES_PATH: "/sync/contact-data/files" - BATCH_SIZE: 1000 - DCR_KEEP_DELTA_FILES: "true" - DCR_ENABLE_DELTA_CONTEXT: "true" - DCR_LANDING_ZONE_DATABASE: "triplestore" - DCR_LANDING_ZONE_GRAPH: "http://mu.semte.ch/graphs/landing-zone/clb-contact-data" - volumes: - - ./config/clb-consumer/contact-data:/config/triples-dispatching/custom-dispatching - - ./data/files/consumer-files/clb-contact-data:/consumer-files/ - restart: always - labels: - - "logging=true" - links: - - db:database - - triplestore:virtuoso - logging: *default-logging - ################################################################################ # DELTA CONSUMERS: END ################################################################################ @@ -570,7 +542,7 @@ services: # MU SEARCH ################################################################################ search: - image: semtech/mu-search:0.10.0-beta.5 + image: semtech/mu-search:0.10.0 links: - db:database restart: always diff --git a/scripts/reset-elastic.sh b/scripts/reset-elastic.sh index 7adbe5c..4f158b7 100755 --- a/scripts/reset-elastic.sh +++ b/scripts/reset-elastic.sh @@ -1,11 +1,19 @@ #!/bin/bash +version=$(docker compose version) + +if [ $? -eq 0 ]; then + DRC_COMMAND="docker compose" +else + DRC_COMMAND="docker-compose" +fi + echo "warning this will run queries on the triplestore and delete containers, you have 3 seconds to press ctrl+c" sleep 3 -docker-compose rm -fs elasticsearch search +eval "$DRC_COMMAND rm -fs elasticsearch search" sudo rm -rf data/elasticsearch/ -docker-compose exec -T triplestore isql-v < { ?s ?p ?o. } }; exec('checkpoint'); exit; -EOF -docker-compose up -d --remove-orphan +EOF" +eval "$DRC_COMMAND up -d --remove-orphans"