Sync with Sharepoint list Organisaties (#304)

* Set up deltas for sync with sharepoint

* add service

* add dev environment variables

* Extract config to the stack

* Adjust the config and mappings

* Filter out worship services

* Add contacten sp list service

* Add configuration for contact list

* Add config files for contacten sync

* Wire sharepoint sync on main graph instead of producer

* Add env variables

* Add op sync initiator

* Minor updates

* Improve config, add job controller rules and more

* Adjust rules

* Remove unused producer changes

* Don't restart initiator on dev setup

* Sync OP status to a dedicated column

* Add ABB_ID and split bus and house numbers

* Remove config file we will not use

* Add NIS and secondary phone number, rename columns

* Remove isInitialMatchingMapping, not used anymore

* Match on URI instead of UUID

* Adapt field names to new lists

* Specify matching field in config

* Set version of op-sync-with-sharepoint

---------

Co-authored-by: Nordine Bittich <nordine@bittich.be>
This commit is contained in:
Claire Lovisa
2023-11-28 16:49:58 +01:00
committed by GitHub
parent 1324cd4e58
commit 2fd9ce3774
5 changed files with 216 additions and 0 deletions

View File

@@ -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.
{

View File

@@ -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"
}
]
}
}

View File

@@ -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 <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> . 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 <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;\n\t <http://www.w3.org/ns/adms#identifier> ?kboIdentifier .\n ?kboIdentifier <http://www.w3.org/2004/02/skos/core#notation> ?kboLabel ;\n\t <https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> ?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 <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;\n\t <http://www.w3.org/ns/org#hasPrimarySite>/<https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?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 <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;\n\t <http://www.w3.org/ns/org#hasPrimarySite>/<http://www.w3.org/ns/org#siteAddress> ?s . ?s <http://schema.org/contactType> \"Primary\""
},
{
"type": "http://schema.org/ContactPoint",
"mappings": [
{
"op": ["http://schema.org/telephone"],
"sl": "OP_Secundair_Telefoonnummer"
}
],
"pathToMatchingUri": "?matchingUri a <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;\n\t <http://www.w3.org/ns/org#hasPrimarySite>/<http://www.w3.org/ns/org#siteAddress> ?s . ?s <http://schema.org/contactType> \"Secondary\""
}
]
}

View File

@@ -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:

View File

@@ -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: