diff --git a/config/delta/rules.js b/config/delta/rules.js index b6b75ea..a5d3e12 100644 --- a/config/delta/rules.js +++ b/config/delta/rules.js @@ -162,6 +162,61 @@ export default [ optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"] } }, + // organizations-sync-with-sharepoint/delta : jobs come from the jobs graph, data from the two main graphs + { + match: { + graph: { + type: 'uri', + value: 'http://mu.semte.ch/graphs/jobs' + } + }, + callback: { + url: 'http://organizations-sync-with-sharepoint/delta', + method: 'POST' + }, + options: { + resourceFormat: 'v0.0.1', + gracePeriod: 1000, + ignoreFromSelf: true, + optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + } + }, + { + match: { + graph: { + type: 'uri', + value: 'http://mu.semte.ch/graphs/shared' + } + }, + callback: { + url: 'http://organizations-sync-with-sharepoint/delta', + method: 'POST' + }, + options: { + resourceFormat: 'v0.0.1', + gracePeriod: 1000, + ignoreFromSelf: true, + optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + } + }, + { + match: { + graph: { + type: 'uri', + value: 'http://mu.semte.ch/graphs/administrative-unit' + } + }, + callback: { + url: 'http://organizations-sync-with-sharepoint/delta', + method: 'POST' + }, + options: { + resourceFormat: 'v0.0.1', + gracePeriod: 1000, + ignoreFromSelf: true, + optOutMuScopeIds: [ "http://redpencil.data.gift/id/concept/muScope/deltas/initialSync" ] + } + } /* Commenting ldes rules until ready to go to qa/prod. In the meantime, we override the configuration on dev. { diff --git a/config/jobs-controller/config.json b/config/jobs-controller/config.json index 5817d84..e22a768 100644 --- a/config/jobs-controller/config.json +++ b/config/jobs-controller/config.json @@ -126,5 +126,23 @@ "nextIndex": "0" } ] + }, + "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/initialSyncing/organizations": { + "tasksConfiguration": [ + { + "currentOperation": null, + "nextOperation": "http://redpencil.data.gift/id/jobs/concept/TaskOperation/sp-sync/initialSyncing", + "nextIndex": "0" + } + ] + }, + "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/healingOperation/organizations": { + "tasksConfiguration": [ + { + "currentOperation": null, + "nextOperation": "http://redpencil.data.gift/id/jobs/concept/TaskOperation/sp-sync/healing", + "nextIndex": "0" + } + ] } } diff --git a/config/sharepoint/sync/organizations/config.json b/config/sharepoint/sync/organizations/config.json new file mode 100644 index 0000000..265d0cb --- /dev/null +++ b/config/sharepoint/sync/organizations/config.json @@ -0,0 +1,108 @@ +{ + "sourceGraphs": [ + "http://mu.semte.ch/graphs/administrative-unit", + "http://mu.semte.ch/graphs/shared", + "http://mu.semte.ch/graphs/public" + ], + "objects": [ + { + "type": "http://data.vlaanderen.be/ns/besluit#Bestuurseenheid", + "mappings": [ + { + "op": ["http://www.w3.org/2004/02/skos/core#prefLabel"], + "sl": "Title" + }, + { + "op": ["http://www.w3.org/ns/org#classification", "http://www.w3.org/2004/02/skos/core#prefLabel"], + "sl": "OP_Type" + }, + { + "op": ["http://www.w3.org/ns/regorg#orgStatus", "http://www.w3.org/2004/02/skos/core#prefLabel"], + "sl": "OP_Status" + }, + { + "op": ["http://mu.semte.ch/vocabularies/core/uuid"], + "sl": "OP_Uuid" + }, + { + "op": ["http://mu.semte.ch/vocabularies/core/uuid", "^http://mu.semte.ch/vocabularies/core/uuid"], + "sl": "OP_Uri", + "isMatchingField": "true" + }, + { + "op": ["http://data.vlaanderen.be/ns/besluit#werkingsgebied", "http://www.w3.org/2004/02/skos/core#exactMatch", "http://www.w3.org/2004/02/skos/core#notation"], + "sl": "OP_NIScode" + } + ], + "pathToMatchingUri": "?s a . BIND (?s as ?matchingUri)" + }, + { + "type": "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator", + "mappings": [ + { + "op": ["https://data.vlaanderen.be/ns/generiek#lokaleIdentificator"], + "sl": "OP_KBO" + } + ], + "pathToMatchingUri": "?matchingUri a ;\n\t ?kboIdentifier .\n ?kboIdentifier ?kboLabel ;\n\t ?s . FILTER (?kboLabel IN (\"KBO nummer\"@nl, \"KBO nummer\"))" + }, + { + "type": "http://www.w3.org/ns/locn#Address", + "mappings": [ + { + "op": ["http://www.w3.org/ns/locn#thoroughfare"], + "sl": "OP_Straat" + }, + { + "op": ["https://data.vlaanderen.be/ns/adres#Adresvoorstelling.huisnummer"], + "sl": "OP_Huisnummer" + }, + { + "op": ["https://data.vlaanderen.be/ns/adres#Adresvoorstelling.busnummer"], + "sl": "OP_Busnummer" + }, + { + "op": ["http://www.w3.org/ns/locn#postCode"], + "sl": "OP_Postcode" + }, + { + "op": ["https://data.vlaanderen.be/ns/adres#gemeentenaam"], + "sl": "OP_Gemeente" + }, + { + "op": ["http://www.w3.org/ns/locn#adminUnitL2"], + "sl": "OP_Provincie" + } + ], + "pathToMatchingUri": "?matchingUri a ;\n\t / ?s ." + }, + { + "type": "http://schema.org/ContactPoint", + "mappings": [ + { + "op": ["http://schema.org/telephone"], + "sl": "OP_Primair_Telefoonnummer" + }, + { + "op": ["http://xmlns.com/foaf/0.1/page"], + "sl": "OP_Website" + }, + { + "op": ["http://schema.org/email"], + "sl": "OP_Email" + } + ], + "pathToMatchingUri": "?matchingUri a ;\n\t / ?s . ?s \"Primary\"" + }, + { + "type": "http://schema.org/ContactPoint", + "mappings": [ + { + "op": ["http://schema.org/telephone"], + "sl": "OP_Secundair_Telefoonnummer" + } + ], + "pathToMatchingUri": "?matchingUri a ;\n\t / ?s . ?s \"Secondary\"" + } + ] +} diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 9f092e4..f4ed919 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -65,6 +65,10 @@ services: restart: "no" delta-producer-dump-file-publisher: restart: "no" + organizations-sync-with-sharepoint-jobs-initiator: + restart: "no" + organizations-sync-with-sharepoint: + restart: "no" construct-administrative-unit-relationships: restart: "no" delta-producer-bg-jobs-initiator-worship-posts: diff --git a/docker-compose.yml b/docker-compose.yml index 5943890..8ac55b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -222,6 +222,37 @@ services: - "logging=true" restart: always logging: *default-logging + organizations-sync-with-sharepoint-jobs-initiator: + image: lblod/delta-producer-background-jobs-initiator:0.4.3 + environment: + JOBS_GRAPH: "http://mu.semte.ch/graphs/jobs" + INITIAL_PUBLICATION_GRAPH_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/initialSyncing/organizations" + HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/healingOperation/organizations" + INITIAL_PUBLICATION_GRAPH_SYNC_TASK_OPERATION: "http://redpencil.data.gift/id/jobs/concept/TaskOperation/sp-sync/initialSyncing" + HEALING_TASK_OPERATION: "http://redpencil.data.gift/id/jobs/concept/TaskOperation/sp-sync/healing" + CRON_PATTERN_HEALING_JOB: "0 0 4 * * *" # everyday at 4 AM + START_INITIAL_SYNC: "false" # prefer to disable it now. We want to have feeling with how the DB acts. + ENABLE_DUMP_FILE_CREATION: "false" + links: + - db:database + labels: + - "logging=true" + restart: always + logging: *default-logging + organizations-sync-with-sharepoint: + image: lblod/op-sync-with-sharepoint-service:0.1.0 + environment: + INITIAL_SYNC_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/initialSyncing/organizations" + HEALING_JOB_OPERATION: "http://redpencil.data.gift/id/jobs/concept/JobOperation/sp-sync/healingOperation/organizations" + USE_VIRTUOSO_FOR_EXPENSIVE_SELECTS: "true" + links: + - db:database + volumes: + - ./config/sharepoint/sync/organizations/:/config/ + labels: + - "logging=true" + restart: always + logging: *default-logging construct-administrative-unit-relationships: image: lblod/construct-administrative-unit-relationships-service:0.1.5 environment: