Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ea9d90751 | ||
|
|
d8114bec4e | ||
|
|
a352683c6f | ||
|
|
d601d7f34e | ||
|
|
aab976bcc1 | ||
|
|
404a282a7d | ||
|
|
f79724132a | ||
|
|
0b8530db34 | ||
|
|
17d48100d7 | ||
|
|
c6baf82dff | ||
|
|
cde5b49654 | ||
|
|
7316df1ab2 | ||
|
|
300e088b6c | ||
|
|
43e7cb0dac | ||
|
|
e844c9f824 | ||
|
|
eb8790f40b | ||
|
|
e10c825f75 | ||
|
|
0553cd7d66 | ||
|
|
55cb772e92 | ||
|
|
83f247b051 | ||
|
|
950521f187 | ||
|
|
61b88fe602 | ||
|
|
dae66c97d3 | ||
|
|
647e17900a | ||
|
|
72b4eaa68a | ||
|
|
bbb0f7a373 | ||
|
|
bf41ad4ad2 | ||
|
|
d3899762a9 | ||
|
|
47c4dea630 | ||
|
|
140626a936 | ||
|
|
026ef435e1 | ||
|
|
20d4613400 | ||
|
|
b358278067 | ||
|
|
f7a637f0f4 | ||
|
|
eb99585a1d | ||
|
|
841ac47db6 | ||
|
|
3b812946e4 | ||
|
|
9972451d0e | ||
|
|
0faa8100c8 | ||
|
|
7834352617 | ||
|
|
261ba383b6 | ||
|
|
62769f855c | ||
|
|
5eca8a2e1d | ||
|
|
0e8885f4dd | ||
|
|
3bc47a7fb0 | ||
|
|
1698112a9d | ||
|
|
a001f6b9e4 | ||
|
|
dba1ada5e2 | ||
|
|
a6571eefa5 | ||
|
|
347844e341 | ||
|
|
aaf87ee32f | ||
|
|
631ba827ee | ||
|
|
19e3423202 | ||
|
|
8750fddb2d | ||
|
|
8a7eb8ede0 | ||
|
|
4ff40cb4e4 | ||
|
|
d53bd27369 | ||
|
|
90fa373254 | ||
|
|
d290187467 | ||
|
|
dd08a03faa | ||
|
|
79bae4fd3c | ||
|
|
6bf50bbbb7 | ||
|
|
038b72646c | ||
|
|
c570ab994e | ||
|
|
c9ba00fc23 | ||
|
|
c993a681d9 | ||
|
|
fc676dd30f | ||
|
|
54700d9832 | ||
|
|
ce0e267627 | ||
|
|
d0835a1b30 | ||
|
|
44e2de4f0b | ||
|
|
824201ced6 | ||
|
|
80ad432a5c | ||
|
|
9122c18f1e | ||
|
|
8143aac736 | ||
|
|
dde2e42696 | ||
|
|
0f1654e64c | ||
|
|
9ed42aa4f6 | ||
|
|
885db51540 | ||
|
|
477c37320d | ||
|
|
dfec837bba | ||
|
|
806a870744 |
160
CHANGELOG.md
Normal file
160
CHANGELOG.md
Normal file
@@ -0,0 +1,160 @@
|
||||
# Changelog
|
||||
|
||||
## 1.29.0 (2025-02-07)
|
||||
### Backend
|
||||
#### Consumer
|
||||
- Upgraded `mandatarissen-consumer` [OP-3510]
|
||||
- Upgraded `leidinggevenden-consumer` [OP-3533], [OP-3511]
|
||||
- Upgraded `worship-services-sensitive-consumer` [OP-3337]
|
||||
|
||||
### Deploy notes
|
||||
```
|
||||
drc down;
|
||||
```
|
||||
Update `docker-compose.override.yml` to remove the config of the consumers and replace it by:
|
||||
```
|
||||
mandatarissen-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_REMAPPING_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
leidinggevenden-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_REMAPPING_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
worship-services-main-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_REMAPPING_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
worship-services-private-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_REMAPPING_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
```
|
||||
Then:
|
||||
```
|
||||
drc up -d triplestore migrations
|
||||
drc up -d db mandatarissen-consumer leidinggevenden-consumer worship-services-main-info-consumer worship-services-private-info-consumer
|
||||
# Wait until success of the previous step
|
||||
```
|
||||
Then, update `docker-compose.override.yml` to:
|
||||
```
|
||||
mandatarissen-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
leidinggevenden-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # choose the correct endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
worship-services-main-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
worship-services-private-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lblod.info" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lblod.info/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "database"
|
||||
DCR_REMAPPING_DATABASE: "database"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
```
|
||||
drc up -d
|
||||
sh scripts/reset-elastic.sh
|
||||
```
|
||||
|
||||
## 1.28.5 (2025-01-23)
|
||||
### Frontend
|
||||
- Bump to [v1.28.3](https://github.com/lblod/frontend-organization-portal/releases/tag/v1.28.3)
|
||||
### Backend
|
||||
- Datafix: correct merger change events for worship organisations (OP-3534)
|
||||
- Avoid municipality filter to include partial matches (OP-3509)
|
||||
### Deploy notes
|
||||
- `drc restart migrations-triggering-indexing; drc logs -ft --tail=200 migrations-triggering-indexing`
|
||||
- `drc pull frontend; drc up -d frontend`
|
||||
- Perform a full re-index by executing `./scripts/reset-elastic.sh`
|
||||
|
||||
## 1.28.4 (2025-01-16)
|
||||
### Backend
|
||||
#### Data
|
||||
- Performance fix on 1.28.3 [DL-6377]
|
||||
### Deploy commands
|
||||
```
|
||||
drc restart migrations
|
||||
drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs # or wait for the healing to kick in
|
||||
```
|
||||
## 1.28.3 (2025-01-16)
|
||||
### Backend
|
||||
#### Data
|
||||
- Datafix. Fusiegemeentes had different bestuursfuncties attached to OCMW and Gemeente. [DL-6377]
|
||||
However, business-rule-wise, these bestuursfuncties are shared.
|
||||
### Deploy commands
|
||||
```
|
||||
drc restart migrations
|
||||
drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs # or wait for the healing to kick in
|
||||
```
|
||||
## 1.28.2 (2025-01-13)
|
||||
### Backend
|
||||
- Added "Opdrachthoudende vereniging met private deelname" in delta public (DL-6368)
|
||||
### Deploy commands
|
||||
```
|
||||
drc restart migrations
|
||||
drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs # or wait for the healing to kick in
|
||||
```
|
||||
## 1.28.1 (2025-01-11)
|
||||
### Backend
|
||||
- Import 2025 NIS codes and update werkingsgebieden (OP-3342)
|
||||
- Add merger change events for merged police zones (OP-3454)
|
||||
- Delete local involvements for worship services (OP-3501, OP-3512)
|
||||
- Move link between new municipalities and province to shared graph (OP-3513, OP-3514)
|
||||
|
||||
### Deploy notes
|
||||
- Restart both migration services
|
||||
#### Docker commands
|
||||
- `drc restart migrations; drc logs -ft --tail=200 migrations`
|
||||
- `drc restart migrations-triggering-indexing; drc logs -ft --tail=200 migrations-triggering-indexing`
|
||||
|
||||
## 1.28.0 (2025-01-02)
|
||||
### Backend
|
||||
- Bump frontend to `v1.28.0`
|
||||
- Add end date for governing bodies for municipalities and OCMWs and update status (OP-3348)
|
||||
- Update municipality and province name in organisation's addresses (OP-3410)
|
||||
- Add merger change events for merged municipalities and OCMWs (OP-3412)
|
||||
- Updates names for merged municipalities and OCMWs (OP-3456)
|
||||
|
||||
### Deploy notes
|
||||
- Restart both migration services
|
||||
- Bump frontend
|
||||
#### Docker commands
|
||||
- `drc restart migrations; drc logs -ft --tail=200 migrations`
|
||||
- `drc restart migrations-triggering-indexing; drc logs -ft --tail=200 migrations-triggering-indexing`
|
||||
- `drc pull frontend; drc up -d frontend`
|
||||
139
README.md
139
README.md
@@ -11,6 +11,145 @@ Backend for the organization portal application, based on the mu.semte.ch micros
|
||||
|
||||
You can shut down using `docker-compose stop` and remove everything using `docker-compose rm`.
|
||||
|
||||
#### Setup consumers
|
||||
|
||||
The application depends on external data. You'll have to perform extra steps if you want this data to be available.
|
||||
These are multiple data sets, we'll try to be exhaustive on how to ingest these. Even though the procedures are similar.
|
||||
|
||||
#### Setup mandatarissen sync
|
||||
Note: this is assuming you have never ran this before.
|
||||
```
|
||||
drc down;
|
||||
```
|
||||
Update `docker-compose.override.yml` to:
|
||||
```
|
||||
mandatarissen-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore"
|
||||
DCR_REMAPPING_DATABASE: "triplestore"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Then:
|
||||
```
|
||||
drc up -d migrations
|
||||
drc up -d db mandatarissen-consumer
|
||||
# Wait until success of the previous step
|
||||
```
|
||||
Then, update `docker-compose.override.yml` to:
|
||||
```
|
||||
mandatarissen-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Finally, put the stack back up and reindex elasticsearch
|
||||
```
|
||||
drc up -d
|
||||
sh scripts/reset-elastic.sh
|
||||
```
|
||||
|
||||
#### Setup leidinggevenden sync (http://data.lblod.info/vocabularies/leidinggevenden/Functionaris)
|
||||
|
||||
Note: this is assuming you have never ran this before.
|
||||
```
|
||||
drc down;
|
||||
```
|
||||
Update `docker-compose.override.yml` to:
|
||||
```
|
||||
leidinggevenden-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_REMAPPING_DATABASE: "triplestore" # for the initial sync, we go directly to virtuoso
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Then:
|
||||
```
|
||||
drc up -d migrations
|
||||
drc up -d db leidinggevenden-consumer
|
||||
# Wait until success of the previous step
|
||||
```
|
||||
Then, update `docker-compose.override.yml` to:
|
||||
```
|
||||
leidinggevenden-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # choose the correct endpoint
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Finally, put the stack back up and reindex elasticsearch
|
||||
```
|
||||
drc up -d
|
||||
sh scripts/reset-elastic.sh
|
||||
```
|
||||
|
||||
#### Setup worship mandatees sync
|
||||
|
||||
Note: this is assuming you have never ran this before.
|
||||
```
|
||||
drc down;
|
||||
```
|
||||
Update `docker-compose.override.yml` to:
|
||||
```
|
||||
worship-services-main-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lokaalbestuur.vlaanderen.be/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore"
|
||||
DCR_REMAPPING_DATABASE: "triplestore"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
worship-services-private-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lokaalbestuur.vlaanderen.be/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "triplestore"
|
||||
DCR_REMAPPING_DATABASE: "triplestore"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Then:
|
||||
```
|
||||
drc up -d migrations
|
||||
drc up -d db worship-services-main-info-consumer worship-services-private-info-consumer
|
||||
# Wait until success of the previous step
|
||||
```
|
||||
Then, update `docker-compose.override.yml` to:
|
||||
```
|
||||
worship-services-main-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lokaalbestuur.vlaanderen.be/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
worship-services-private-info-consumer:
|
||||
environment:
|
||||
DCR_SYNC_BASE_URL: "https://loket.lokaalbestuur.vlaanderen.be" # or another endpoint
|
||||
DCR_SYNC_LOGIN_ENDPOINT: "https://loket.lokaalbestuur.vlaanderen.be/sync/worship-services-sensitive/login" # or another endpoint
|
||||
DCR_SECRET_KEY: "key-of-the-producer"
|
||||
DCR_LANDING_ZONE_DATABASE: "db"
|
||||
DCR_REMAPPING_DATABASE: "db"
|
||||
DCR_DISABLE_DELTA_INGEST: "false"
|
||||
DCR_DISABLE_INITIAL_SYNC: "false"
|
||||
```
|
||||
Finally, put the stack back up and reindex elasticsearch
|
||||
```
|
||||
drc up -d
|
||||
sh scripts/reset-elastic.sh
|
||||
```
|
||||
|
||||
### Setting up the delta-producers related services
|
||||
To make sure the app can share data, producers need to be set up. There is an intial sync, that is potentially very expensive, and must be started manually
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100;
|
||||
const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync';
|
||||
const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false;
|
||||
const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://triplestore:8890/sparql';
|
||||
const MAX_DB_RETRY_ATTEMPTS = parseInt(process.env.MAX_DB_RETRY_ATTEMPTS || 5);
|
||||
const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_ATTEMPTS || 5);
|
||||
const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000);
|
||||
const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000);
|
||||
const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000);
|
||||
|
||||
// Graphs
|
||||
const TARGET_GRAPH = process.env.TARGET_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`;
|
||||
const LANDING_ZONE_GRAPH = process.env.DCR_LANDING_ZONE_GRAPH || `http://mu.semte.ch/graphs/landing-zone/leidinggevenden`;
|
||||
|
||||
// ENDPOINTS
|
||||
const LANDING_ZONE_DATABASE = process.env.DCR_LANDING_ZONE_DATABASE || 'db';
|
||||
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,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT
|
||||
};
|
||||
@@ -1,72 +0,0 @@
|
||||
|
||||
const PREFIXES = `
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>`
|
||||
|
||||
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: [
|
||||
// Case Leidnggevenden
|
||||
// They can be triggered when being inserted or when their link to a bestuursfunctie is added
|
||||
{
|
||||
trigger: { // subjectType or predicateValue
|
||||
subjectType: "lblodlg:Functionaris"
|
||||
},
|
||||
queryTemplate: (subject) => `
|
||||
${PREFIXES}
|
||||
CONSTRUCT {
|
||||
?functionaris org:holds ?bestuursfunctie ;
|
||||
?p ?o .
|
||||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/leidinggevenden> {
|
||||
VALUES ?functionaris { ${subject} }
|
||||
?functionaris org:holds ?bestuursfunctie ;
|
||||
?p ?o .
|
||||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
}
|
||||
}`
|
||||
},
|
||||
{
|
||||
trigger: {
|
||||
predicateValue: "org:holds"
|
||||
},
|
||||
queryTemplate: (subject) => `
|
||||
${PREFIXES}
|
||||
CONSTRUCT {
|
||||
?functionaris org:holds ?bestuursfunctie ;
|
||||
?p ?o .
|
||||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/leidinggevenden> {
|
||||
VALUES ?functionaris { ${subject} }
|
||||
?functionaris org:holds ?bestuursfunctie ;
|
||||
?p ?o .
|
||||
?orgaanInTime lblodlg:heeftBestuursfunctie ?bestuursfunctie ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
}
|
||||
}`
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
contextConfig,
|
||||
PREFIXES
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
const {
|
||||
transformStatements,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph,
|
||||
} = require('./util');
|
||||
|
||||
/**
|
||||
* Dispatch the fetched information to a target graph.
|
||||
* Note: <share://file/data> 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, fetch } = lib;
|
||||
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[i]
|
||||
}));
|
||||
|
||||
console.log(`Received ${zippedChangeSets.length} change sets`)
|
||||
|
||||
for (let { original, withContext } of zippedChangeSets) {
|
||||
let originalDeletes, originalInserts, insertsWithContext, deletesWithContext;
|
||||
try {
|
||||
originalInserts = original.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
originalDeletes = original.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set: ${e}`);
|
||||
console.log(`Original change set: ${JSON.stringify(original)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Extra context needed for mapping from DL to OP model and filtering based on type.
|
||||
try {
|
||||
insertsWithContext = withContext.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
deletesWithContext = withContext.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set with context: ${e}`);
|
||||
console.log(`Change set with context: ${JSON.stringify(withContext)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (originalDeletes.length) {
|
||||
// Map deletes from DL to OP model
|
||||
const transformedDeletes = await transformStatements(fetch, deletesWithContext);
|
||||
|
||||
if (!transformedDeletes.length) {
|
||||
console.log(`Warn: Delete statements mapped to empty result.`);
|
||||
console.log(`Input: ${deletesWithContext}`);
|
||||
console.log(`Output: ${transformedDeletes}`);
|
||||
} else {
|
||||
await deleteFromTargetGraph(lib, transformedDeletes);
|
||||
}
|
||||
}
|
||||
|
||||
if (originalInserts.length) {
|
||||
// Map inserts from DL to OP model
|
||||
const transformedInserts = await transformStatements(fetch, insertsWithContext);
|
||||
|
||||
if (!transformedInserts.length) {
|
||||
console.log(`Warn: Insert statements mapped to empty result.`);
|
||||
console.log(`Input: ${insertsWithContext}`);
|
||||
console.log(`Output: ${transformedInserts}`);
|
||||
} else {
|
||||
await insertIntoTargetGraph(lib, transformedInserts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
const { batchedDbUpdate, transformLandingZoneGraph } = 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,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT
|
||||
} = 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @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 - withouth 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 },
|
||||
LANDING_ZONE_DATABASE_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function onFinishInitialIngest(lib) {
|
||||
const { muAuthSudo, fetch } = lib;
|
||||
|
||||
console.log(`!! On-finish triggered !!`);
|
||||
|
||||
const transformedInsertTriples = await transformLandingZoneGraph(fetch, endpoint);
|
||||
|
||||
console.log(`Transformed ${transformedInsertTriples.length} triples`);
|
||||
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
transformedInsertTriples,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch,
|
||||
onFinishInitialIngest
|
||||
};
|
||||
@@ -1,168 +0,0 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
BATCH_SIZE,
|
||||
} = require('./config');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits an array into two parts, a part that passes and a part that fails a predicate function.
|
||||
* Credits: https://github.com/benjay10
|
||||
* @public
|
||||
* @function partition
|
||||
* @param {Array} arr - Array to be partitioned
|
||||
* @param {Function} fn - Function that accepts single argument: an element of the array, and should return a truthy or falsy value.
|
||||
* @returns {Object} Object that contains keys passes and fails, each representing an array with elemets that pass or fail the predicate respectively
|
||||
*/
|
||||
function partition(arr, fn) {
|
||||
let passes = [], fails = [];
|
||||
arr.forEach((item) => (fn(item) ? passes : fails).push(item));
|
||||
return { passes, fails };
|
||||
}
|
||||
|
||||
/**
|
||||
* Send triples to reasoning service for conversion
|
||||
*
|
||||
*/
|
||||
async function transformTriples(fetch, triples, mapping) {
|
||||
return await operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
async function mainConversion(fetch, triples, mapping) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
let requestOptions = {
|
||||
method: 'POST',
|
||||
body: formdata,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}`, requestOptions)
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
async function transformStatements(fetch, triples, mapping = 'main') {
|
||||
console.log(`Received ${JSON.stringify(triples)} to transform`);
|
||||
const transformedTriples = await transformTriples(fetch, triples.join('\n'), mapping);
|
||||
statements = transformedTriples ? transformedTriples.replace(/\n{2,}/g, '').split('\n') : [];
|
||||
console.log(`CONVERSION: FROM ${triples.length} triples to ${statements.length}`);
|
||||
return statements;
|
||||
}
|
||||
|
||||
async function deleteFromTargetGraph(lib, statements) {
|
||||
console.log(`Deleting ${statements.length} statements from target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
async function insertIntoTargetGraph(lib, statements) {
|
||||
console.log(`Inserting ${statements.length} statements into target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'INSERT');
|
||||
}
|
||||
|
||||
async function transformLandingZoneGraph(fetch, endpoint, mapping = 'main') {
|
||||
console.log(`Transforming landing zone graph: ${LANDING_ZONE_GRAPH}`);
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}?data=${encodeURIComponent(`${endpoint}?default-graph-uri=&query=CONSTRUCT+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D+WHERE+%7B%0D%0A+GRAPH+<${LANDING_ZONE_GRAPH}>+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D%0D%0A%7D&should-sponge=&format=text%2Fplain&timeout=0&run=+Run+Query`)}`);
|
||||
const text = await response.text();
|
||||
const statements = text.replace(/\n{2,}/g, '').split('\n');
|
||||
|
||||
return statements;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
batchedDbUpdate,
|
||||
partition,
|
||||
transformStatements,
|
||||
transformLandingZoneGraph,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
PREFIX schema: <http://schema.org/>
|
||||
|
||||
CONSTRUCT {
|
||||
?s schema:telephone ?cleanedPhoneNumber .
|
||||
} WHERE {
|
||||
?s schema:telephone ?phoneNumber .
|
||||
|
||||
# Remove all non digits
|
||||
BIND(REPLACE(?phoneNumber, """[^+\\d]""", "") AS ?scrapeResult)
|
||||
|
||||
# Replace leading 00 with +
|
||||
BIND(REPLACE(?scrapeResult, """^00""", "+") AS ?replacedZeroZero)
|
||||
|
||||
BIND(REPLACE(?replacedZeroZero, """^0""", "+32") AS ?defaultBe)
|
||||
|
||||
BIND(REPLACE(?defaultBe, """\\+320""", "+32") AS ?extendedDefaultBe)
|
||||
|
||||
BIND(REPLACE(?extendedDefaultBe, """^320""", "+32") AS ?finalResult)
|
||||
|
||||
BIND(IF(REGEX(?finalResult, """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$"""), CONCAT("tel:", ?finalResult), ?phoneNumber) AS ?cleanedPhoneNumber)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s mandaat:einde ?endDateTime .
|
||||
} WHERE {
|
||||
?s mandaat:einde ?endDate .
|
||||
|
||||
BIND(SUBSTR(STR(?endDate), 1, 10) as ?endDateWithoutTimezone)
|
||||
BIND(STRDT(CONCAT(?endDateWithoutTimezone, 'T02:00:00'), xsd:dateTime) as ?endDateTime)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s mandaat:start ?startDateTime .
|
||||
} WHERE {
|
||||
?s mandaat:start ?startDate .
|
||||
|
||||
BIND(SUBSTR(STR(?startDate), 1, 10) as ?startDateWithoutTimezone)
|
||||
BIND(STRDT(CONCAT(?startDateWithoutTimezone, 'T02:00:00'), xsd:dateTime) as ?startDateTime)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a dc_terms:Agent .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
|
||||
VALUES ?type {
|
||||
lblodlg:Functionaris
|
||||
person:Person
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a ch:AgentInPositie .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
|
||||
VALUES ?type {
|
||||
lblodlg:Functionaris
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
CONSTRUCT {
|
||||
?o org:heldBy ?s.
|
||||
}
|
||||
WHERE {
|
||||
?s org:holds ?o.
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://www.w3.org/ns/locn#Address>;
|
||||
?p ?o.
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
CONSTRUCT {
|
||||
?s <http://schema.org/contactPoint> ?contactpoint.
|
||||
}
|
||||
WHERE {
|
||||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Bestuursfunctie>.
|
||||
?s <http://schema.org/contactPoint> ?contactpoint.
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://schema.org/ContactPoint>;
|
||||
?p ?o.
|
||||
FILTER (?p NOT IN (<http://schema.org/telephone>))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p NOT IN (mandaat:start, mandaat:einde))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://www.w3.org/ns/person#Person>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p IN (
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,
|
||||
<http://xmlns.com/foaf/0.1/familyName>,
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>
|
||||
))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# First name: persoon:gebruikteVoornaam => foaf:givenName
|
||||
# Alternatieve voornaam: foaf:name => persoon:gebruikteVoornaam
|
||||
|
||||
# We do both in one query with an OPTIONAL because they need to happen simultaneously
|
||||
# not to end up in a loop
|
||||
|
||||
# Part 1
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:gebruikteVoornaam ?name .
|
||||
} WHERE {
|
||||
?s a person:Person;
|
||||
foaf:name ?name .
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# First name: persoon:gebruikteVoornaam => foaf:givenName
|
||||
# Alternatieve voornaam: foaf:name => persoon:gebruikteVoornaam
|
||||
|
||||
# We do both in one query with an OPTIONAL because they need to happen simultaneously
|
||||
# not to end up in a loop
|
||||
|
||||
# Part 2
|
||||
|
||||
CONSTRUCT {
|
||||
?s foaf:givenName ?gebruikteVoornaam .
|
||||
} WHERE {
|
||||
?s a person:Person ;
|
||||
persoon_loket:gebruikteVoornaam ?gebruikteVoornaam .
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100;
|
||||
const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync';
|
||||
const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false;
|
||||
const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://triplestore:8890/sparql';
|
||||
const MAX_DB_RETRY_ATTEMPTS = parseInt(process.env.MAX_DB_RETRY_ATTEMPTS || 5);
|
||||
const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_ATTEMPTS || 5);
|
||||
const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000);
|
||||
const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000);
|
||||
const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000);
|
||||
|
||||
// Graphs
|
||||
const TARGET_GRAPH = process.env.TARGET_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`;
|
||||
const LANDING_ZONE_GRAPH = process.env.DCR_LANDING_ZONE_GRAPH || `http://mu.semte.ch/graphs/landing-zone/leidinggevenden`;
|
||||
|
||||
// ENDPOINTS
|
||||
const LANDING_ZONE_DATABASE = process.env.DCR_LANDING_ZONE_DATABASE || 'db';
|
||||
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,
|
||||
TARGET_GRAPH
|
||||
};
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
|
||||
const PREFIXES = `
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>`
|
||||
|
||||
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: [
|
||||
// Case Mandatarissen
|
||||
// They can be triggered when being inserted or when their link to a mandate is added
|
||||
{
|
||||
trigger: { // subjectType or predicateValue
|
||||
subjectType: "mandaat:Mandataris"
|
||||
},
|
||||
queryTemplate: (subject) => `
|
||||
${PREFIXES}
|
||||
CONSTRUCT {
|
||||
?mandataris org:holds ?mandate ;
|
||||
?p ?o .
|
||||
?orgaanInTime org:hasPost ?mandate ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> {
|
||||
VALUES ?mandataris { ${subject} }
|
||||
?mandataris org:holds ?mandate ;
|
||||
?p ?o .
|
||||
?orgaanInTime org:hasPost ?mandate ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
}
|
||||
}`
|
||||
},
|
||||
{
|
||||
trigger: {
|
||||
predicateValue: "org:holds"
|
||||
},
|
||||
queryTemplate: (subject) => `
|
||||
${PREFIXES}
|
||||
CONSTRUCT {
|
||||
?mandataris org:holds ?mandate ;
|
||||
?p ?o .
|
||||
?orgaanInTime org:hasPost ?mandate ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> {
|
||||
VALUES ?mandataris { ${subject} }
|
||||
?mandataris org:holds ?mandate ;
|
||||
?p ?o .
|
||||
?orgaanInTime org:hasPost ?mandate ;
|
||||
mandaat:isTijdspecialisatieVan ?orgaan .
|
||||
?orgaan besluit:bestuurt ?eenheid .
|
||||
?eenheid besluit:classificatie ?classification .
|
||||
}
|
||||
}`
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
contextConfig,
|
||||
PREFIXES
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
const {
|
||||
transformStatements,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph,
|
||||
} = require('./util');
|
||||
|
||||
/**
|
||||
* Dispatch the fetched information to a target graph.
|
||||
* Note: <share://file/data> 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, fetch } = lib;
|
||||
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[i]
|
||||
}));
|
||||
|
||||
console.log(`Received ${zippedChangeSets.length} change sets`)
|
||||
|
||||
for (let { original, withContext } of zippedChangeSets) {
|
||||
let originalDeletes, originalInserts, insertsWithContext, deletesWithContext;
|
||||
try {
|
||||
originalInserts = original.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
originalDeletes = original.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set: ${e}`);
|
||||
console.log(`Original change set: ${JSON.stringify(original)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Extra context needed for mapping from DL to OP model and filtering based on type.
|
||||
try {
|
||||
insertsWithContext = withContext.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
deletesWithContext = withContext.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set with context: ${e}`);
|
||||
console.log(`Change set with context: ${JSON.stringify(withContext)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (originalDeletes.length) {
|
||||
// Map deletes from DL to OP model
|
||||
const transformedDeletes = await transformStatements(fetch, deletesWithContext);
|
||||
|
||||
if (!transformedDeletes.length) {
|
||||
console.log(`Warn: Delete statements mapped to empty result.`);
|
||||
console.log(`Input: ${deletesWithContext}`);
|
||||
console.log(`Output: ${transformedDeletes}`);
|
||||
} else {
|
||||
await deleteFromTargetGraph(lib, transformedDeletes);
|
||||
}
|
||||
}
|
||||
|
||||
if (originalInserts.length) {
|
||||
// Map inserts from DL to OP model
|
||||
const transformedInserts = await transformStatements(fetch, insertsWithContext);
|
||||
|
||||
if (!transformedInserts.length) {
|
||||
console.log(`Warn: Insert statements mapped to empty result.`);
|
||||
console.log(`Input: ${insertsWithContext}`);
|
||||
console.log(`Output: ${transformedInserts}`);
|
||||
} else {
|
||||
await insertIntoTargetGraph(lib, transformedInserts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,85 +0,0 @@
|
||||
const { batchedDbUpdate, transformLandingZoneGraph } = 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,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT
|
||||
} = 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @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 - withouth 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 },
|
||||
LANDING_ZONE_DATABASE_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function onFinishInitialIngest(lib) {
|
||||
const { muAuthSudo, fetch } = lib;
|
||||
|
||||
console.log(`!! On-finish triggered !!`);
|
||||
|
||||
const transformedInsertTriples = await transformLandingZoneGraph(fetch, endpoint);
|
||||
|
||||
console.log(`Transformed ${transformedInsertTriples.length} triples`);
|
||||
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
transformedInsertTriples,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch,
|
||||
onFinishInitialIngest
|
||||
};
|
||||
@@ -1,168 +0,0 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
BATCH_SIZE
|
||||
} = require('./config');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits an array into two parts, a part that passes and a part that fails a predicate function.
|
||||
* Credits: https://github.com/benjay10
|
||||
* @public
|
||||
* @function partition
|
||||
* @param {Array} arr - Array to be partitioned
|
||||
* @param {Function} fn - Function that accepts single argument: an element of the array, and should return a truthy or falsy value.
|
||||
* @returns {Object} Object that contains keys passes and fails, each representing an array with elemets that pass or fail the predicate respectively
|
||||
*/
|
||||
function partition(arr, fn) {
|
||||
let passes = [], fails = [];
|
||||
arr.forEach((item) => (fn(item) ? passes : fails).push(item));
|
||||
return { passes, fails };
|
||||
}
|
||||
|
||||
/**
|
||||
* Send triples to reasoning service for conversion
|
||||
*
|
||||
*/
|
||||
async function transformTriples(fetch, triples, mapping) {
|
||||
return await operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
async function mainConversion(fetch, triples, mapping) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
let requestOptions = {
|
||||
method: 'POST',
|
||||
body: formdata,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}`, requestOptions)
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
async function transformStatements(fetch, triples, mapping = 'main') {
|
||||
console.log(`Received ${JSON.stringify(triples)} to transform`);
|
||||
const transformedTriples = await transformTriples(fetch, triples.join('\n'), mapping);
|
||||
statements = transformedTriples ? transformedTriples.replace(/\n{2,}/g, '').split('\n') : [];
|
||||
console.log(`CONVERSION: FROM ${triples.length} triples to ${statements.length}`);
|
||||
return statements;
|
||||
}
|
||||
|
||||
async function deleteFromTargetGraph(lib, statements) {
|
||||
console.log(`Deleting ${statements.length} statements from target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
async function insertIntoTargetGraph(lib, statements) {
|
||||
console.log(`Inserting ${statements.length} statements into target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'INSERT');
|
||||
}
|
||||
|
||||
async function transformLandingZoneGraph(fetch, endpoint, mapping = 'main') {
|
||||
console.log(`Transforming landing zone graph: ${LANDING_ZONE_GRAPH}`);
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}?data=${encodeURIComponent(`${endpoint}?default-graph-uri=&query=CONSTRUCT+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D+WHERE+%7B%0D%0A+GRAPH+<${LANDING_ZONE_GRAPH}>+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D%0D%0A%7D&should-sponge=&format=text%2Fplain&timeout=0&run=+Run+Query`)}`);
|
||||
const text = await response.text();
|
||||
const statements = text.replace(/\n{2,}/g, '').split('\n');
|
||||
|
||||
return statements;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
batchedDbUpdate,
|
||||
partition,
|
||||
transformStatements,
|
||||
transformLandingZoneGraph,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s mandaat:einde ?endDateTime .
|
||||
} WHERE {
|
||||
?s mandaat:einde ?endDate .
|
||||
|
||||
BIND(SUBSTR(STR(?endDate), 1, 10) as ?endDateWithoutTimezone)
|
||||
BIND(STRDT(CONCAT(?endDateWithoutTimezone, 'T02:00:00'), xsd:dateTime) as ?endDateTime)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s mandaat:start ?startDateTime .
|
||||
} WHERE {
|
||||
?s mandaat:start ?startDate .
|
||||
|
||||
BIND(SUBSTR(STR(?startDate), 1, 10) as ?startDateWithoutTimezone)
|
||||
BIND(STRDT(CONCAT(?startDateWithoutTimezone, 'T02:00:00'), xsd:dateTime) as ?startDateTime)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a dc_terms:Agent .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
|
||||
VALUES ?type {
|
||||
mandaat:Mandataris
|
||||
person:Person
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a ch:AgentInPositie .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
VALUES ?type {
|
||||
mandaat:Mandataris
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
CONSTRUCT {
|
||||
?o org:heldBy ?s.
|
||||
}
|
||||
WHERE {
|
||||
?s org:holds ?o.
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandataris>;
|
||||
<http://www.w3.org/ns/org#holds> ?mandate;
|
||||
?p ?o.
|
||||
|
||||
?orgaanInTime <http://www.w3.org/ns/org#hasPost> ?mandate ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan> ?orgaan .
|
||||
|
||||
?orgaan <http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuur .
|
||||
?bestuur <http://data.vlaanderen.be/ns/besluit#classificatie> ?classification .
|
||||
|
||||
|
||||
FILTER(?classification IN (
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000000>,
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001>,
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002>,
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000003>
|
||||
))
|
||||
|
||||
FILTER (?p NOT IN (mandaat:start, mandaat:einde))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://www.w3.org/ns/person#Person>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p IN (
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,
|
||||
<http://xmlns.com/foaf/0.1/familyName>,
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>
|
||||
))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# First name: persoon:gebruikteVoornaam => foaf:givenName
|
||||
# Alternatieve voornaam: foaf:name => persoon:gebruikteVoornaam
|
||||
|
||||
# We do both in one query with an OPTIONAL because they need to happen simultaneously
|
||||
# not to end up in a loop
|
||||
|
||||
# Part 1
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:gebruikteVoornaam ?name .
|
||||
} WHERE {
|
||||
?s a person:Person;
|
||||
foaf:name ?name .
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# First name: persoon:gebruikteVoornaam => foaf:givenName
|
||||
# Alternatieve voornaam: foaf:name => persoon:gebruikteVoornaam
|
||||
|
||||
# We do both in one query with an OPTIONAL because they need to happen simultaneously
|
||||
# not to end up in a loop
|
||||
|
||||
# Part 2
|
||||
|
||||
CONSTRUCT {
|
||||
?s foaf:givenName ?gebruikteVoornaam .
|
||||
} WHERE {
|
||||
?s a person:Person ;
|
||||
persoon_loket:gebruikteVoornaam ?gebruikteVoornaam .
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
PREFIX schema: <http://schema.org/>
|
||||
|
||||
CONSTRUCT {
|
||||
?s schema:telephone ?cleanedPhoneNumber .
|
||||
} WHERE {
|
||||
?s schema:telephone ?phoneNumber .
|
||||
|
||||
# Remove all non digits
|
||||
BIND(REPLACE(?phoneNumber, """[^+\\d]""", "") AS ?scrapeResult)
|
||||
|
||||
# Replace leading 00 with +
|
||||
BIND(REPLACE(?scrapeResult, """^00""", "+") AS ?replacedZeroZero)
|
||||
|
||||
BIND(REPLACE(?replacedZeroZero, """^0""", "+32") AS ?defaultBe)
|
||||
|
||||
BIND(REPLACE(?defaultBe, """\\+320""", "+32") AS ?extendedDefaultBe)
|
||||
|
||||
BIND(REPLACE(?extendedDefaultBe, """^320""", "+32") AS ?finalResult)
|
||||
|
||||
BIND(IF(REGEX(?finalResult, """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$"""), CONCAT("tel:", ?finalResult), ?phoneNumber) AS ?cleanedPhoneNumber)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ch:eindedatum ?endDateTime .
|
||||
} WHERE {
|
||||
?s ch:eindedatum ?endDate .
|
||||
|
||||
BIND(STRDT(CONCAT(STR(?endDate), 'T02:00:00'), xsd:dateTime) as ?endDateTime)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ch:startdatum ?startDateTime .
|
||||
} WHERE {
|
||||
?s ch:startdatum ?startDate .
|
||||
|
||||
BIND(STRDT(CONCAT(STR(?startDate), 'T02:00:00'), xsd:dateTime) as ?startDateTime)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ere:geplandeEinddatumAanstelling ?dateTime .
|
||||
} WHERE {
|
||||
?s ere:geplandeEinddatumAanstelling ?date .
|
||||
|
||||
BIND(STRDT(CONCAT(STR(?date), 'T02:00:00'), xsd:dateTime) as ?dateTime)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a dc_terms:Agent .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
|
||||
VALUES ?type {
|
||||
lblodlg:Functionaris
|
||||
mandaat:Mandataris
|
||||
ere:EredienstMandataris
|
||||
ere:RolBedienaar
|
||||
person:Person
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
|
||||
CONSTRUCT {
|
||||
?s a ch:AgentInPositie .
|
||||
} WHERE {
|
||||
?s a ?type .
|
||||
|
||||
VALUES ?type {
|
||||
lblodlg:Functionaris
|
||||
mandaat:Mandataris
|
||||
ere:EredienstMandataris
|
||||
ere:RolBedienaar
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
CONSTRUCT {
|
||||
?o org:holds ?s.
|
||||
}
|
||||
WHERE {
|
||||
?s org:heldBy ?o.
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
CONSTRUCT {
|
||||
?o org:heldBy ?s.
|
||||
}
|
||||
WHERE {
|
||||
?s org:holds ?o.
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://www.w3.org/ns/locn#Address>;
|
||||
?p ?o.
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
CONSTRUCT {
|
||||
?s <http://schema.org/contactPoint> ?contactpoint.
|
||||
}
|
||||
WHERE {
|
||||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Bestuursfunctie>.
|
||||
?s <http://schema.org/contactPoint> ?contactpoint.
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://schema.org/ContactPoint>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p NOT IN (<http://schema.org/telephone>))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://data.lblod.info/vocabularies/erediensten/EredienstMandataris>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p NOT IN (ch:startdatum, ch:eindedatum, ere:geplandeEinddatumAanstelling))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://www.w3.org/ns/person#Person>;
|
||||
?p ?o.
|
||||
|
||||
FILTER (?p IN (
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>,
|
||||
<http://xmlns.com/foaf/0.1/familyName>
|
||||
))
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://data.lblod.info/vocabularies/erediensten/RolBedienaar>;
|
||||
?p ?o.
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# Alternatieve voornaam: foaf:name => persoon:gebruikteVoornaam
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:gebruikteVoornaam ?name .
|
||||
} WHERE {
|
||||
?s a person:Person ;
|
||||
foaf:name ?name .
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
|
||||
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
||||
|
||||
# First name: persoon:gebruikteVoornaam => foaf:givenName
|
||||
|
||||
CONSTRUCT {
|
||||
?s foaf:givenName ?gebruikteVoornaam .
|
||||
} WHERE {
|
||||
?s a person:Person ;
|
||||
persoon_loket:gebruikteVoornaam ?gebruikteVoornaam .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
CONSTRUCT {
|
||||
?s ?p ?o.
|
||||
} WHERE {
|
||||
?s a <http://data.vlaanderen.be/ns/persoon#Geboorte>;
|
||||
?p ?o.
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?s ?p "" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s a persoon:Geboorte
|
||||
} WHERE {
|
||||
?s a persoon_loket:Geboorte .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:datum ?o .
|
||||
} WHERE {
|
||||
?s persoon_loket:datum ?o .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:geslacht ?o .
|
||||
} WHERE {
|
||||
?s persoon_loket:geslacht ?o .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:heeftGeboorte ?o .
|
||||
} WHERE {
|
||||
?s persoon_loket:heeftGeboorte ?o .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:heeftNationaliteit ?o .
|
||||
} WHERE {
|
||||
?s persoon_loket:heeftNationaliteit ?o .
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# Map from http persoon to https persoon namespace
|
||||
|
||||
CONSTRUCT {
|
||||
?s persoon:registratie ?o .
|
||||
} WHERE {
|
||||
?s persoon_loket:registratie ?o .
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
CONSTRUCT {
|
||||
?identifier
|
||||
generiek:gestructureerdeIdentificator ?structuredIdentifier ;
|
||||
skos:notation "Rijksregisternummer" .
|
||||
|
||||
?structuredIdentifier a generiek:GestructureerdeIdentificator ;
|
||||
mu:uuid ?uuid ;
|
||||
generiek:lokaleIdentificator ?notation .
|
||||
}
|
||||
WHERE {
|
||||
?identifier skos:notation ?notation.
|
||||
|
||||
BIND(MD5(CONCAT(STR(?identifier),"STRUCTURED_IDENTIFIER")) as ?uuid)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/gestructureerdeIdentificatoren/", ?uuid)) AS ?structuredIdentifier)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
|
||||
# identifier property in the export is only used for RRN.
|
||||
CONSTRUCT {
|
||||
?person persoon:registratie ?rrn .
|
||||
}
|
||||
WHERE {
|
||||
?person adms:identifier ?rrn .
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100;
|
||||
const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync';
|
||||
const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false;
|
||||
const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://triplestore:8890/sparql';
|
||||
const MAX_DB_RETRY_ATTEMPTS = parseInt(process.env.MAX_DB_RETRY_ATTEMPTS || 5);
|
||||
const MAX_REASONING_RETRY_ATTEMPTS = parseInt(process.env.MAX_REASONING_RETRY_ATTEMPTS || 5);
|
||||
const SLEEP_BETWEEN_BATCHES = parseInt(process.env.SLEEP_BETWEEN_BATCHES || 1000);
|
||||
const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000);
|
||||
const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000);
|
||||
|
||||
// Graphs
|
||||
const TARGET_GRAPH = process.env.TARGET_GRAPH || `http://mu.semte.ch/graphs/worship-service`;
|
||||
const PRIVACY_SENSITIVE_GRAPH = process.env.PRIVACY_SENSITIVE_GRAPH || `http://mu.semte.ch/graphs/worship-privacy-centric-graph`;
|
||||
const LANDING_ZONE_GRAPH = process.env.DCR_LANDING_ZONE_GRAPH || `http://mu.semte.ch/graphs/landing-zone/leidinggevenden`;
|
||||
|
||||
// Mappings
|
||||
const MAIN_INFO_MAPPING = "main-info";
|
||||
const PRIVATE_INFO_MAPPING = "private-info";
|
||||
|
||||
// ENDPOINTS
|
||||
const LANDING_ZONE_DATABASE = process.env.DCR_LANDING_ZONE_DATABASE || 'db';
|
||||
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,
|
||||
TARGET_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
MAIN_INFO_MAPPING,
|
||||
PRIVATE_INFO_MAPPING
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
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: []
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
contextConfig
|
||||
};
|
||||
@@ -1,114 +0,0 @@
|
||||
const {
|
||||
transformStatements,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph,
|
||||
deleteFromPrivateGraph,
|
||||
insertIntoPrivateGraph
|
||||
} = require('./util');
|
||||
|
||||
const {
|
||||
MAIN_INFO_MAPPING,
|
||||
PRIVATE_INFO_MAPPING
|
||||
} = require('./config');
|
||||
|
||||
/**
|
||||
* Dispatch the fetched information to a target graph.
|
||||
* Note: <share://file/data> 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, fetch } = lib;
|
||||
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[i]
|
||||
}));
|
||||
|
||||
console.log(`Received ${zippedChangeSets.length} change sets`)
|
||||
|
||||
for (let { original, withContext } of zippedChangeSets) {
|
||||
let originalDeletes, originalInserts, insertsWithContext, deletesWithContext;
|
||||
try {
|
||||
originalInserts = original.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
originalDeletes = original.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set: ${e}`);
|
||||
console.log(`Original change set: ${JSON.stringify(original)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Extra context needed for mapping from DL to OP model and filtering based on type.
|
||||
try {
|
||||
insertsWithContext = withContext.inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
deletesWithContext = withContext.deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
} catch (e) {
|
||||
console.log(`Error while processing change set with context: ${e}`);
|
||||
console.log(`Change set with context: ${JSON.stringify(withContext)}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (originalDeletes.length) {
|
||||
// Map main deletes from DL to OP model
|
||||
const transformedMainDeletes = await transformStatements(fetch, deletesWithContext, MAIN_INFO_MAPPING);
|
||||
|
||||
if (!transformedMainDeletes.length) {
|
||||
console.log(`Warn: Delete main statements mapped to empty result.`);
|
||||
console.log(`Input: ${deletesWithContext}`);
|
||||
console.log(`Output: ${transformedMainDeletes}`);
|
||||
} else {
|
||||
await deleteFromTargetGraph(lib, transformedMainDeletes);
|
||||
}
|
||||
|
||||
// Map private deletes from DL to OP model
|
||||
const transformedPrivateDeletes = await transformStatements(fetch, deletesWithContext, PRIVATE_INFO_MAPPING);
|
||||
|
||||
if (!transformedPrivateDeletes.length) {
|
||||
console.log(`Warn: Delete private statements mapped to empty result.`);
|
||||
console.log(`Input: ${deletesWithContext}`);
|
||||
console.log(`Output: ${transformedPrivateDeletes}`);
|
||||
} else {
|
||||
await deleteFromPrivateGraph(lib, transformedPrivateDeletes);
|
||||
}
|
||||
}
|
||||
|
||||
if (originalInserts.length) {
|
||||
// Map main inserts from DL to OP model
|
||||
const transformedMainInserts = await transformStatements(fetch, insertsWithContext, MAIN_INFO_MAPPING);
|
||||
|
||||
if (!transformedMainInserts.length) {
|
||||
console.log(`Warn: Insert statements mapped to empty result.`);
|
||||
console.log(`Input: ${insertsWithContext}`);
|
||||
console.log(`Output: ${transformedMainInserts}`);
|
||||
} else {
|
||||
await insertIntoTargetGraph(lib, transformedMainInserts);
|
||||
}
|
||||
|
||||
// Map private inserts from DL to OP model
|
||||
const transformedPrivateInserts = await transformStatements(fetch, insertsWithContext, PRIVATE_INFO_MAPPING);
|
||||
|
||||
if (!transformedPrivateInserts.length) {
|
||||
console.log(`Warn: Insert statements mapped to empty result.`);
|
||||
console.log(`Input: ${insertsWithContext}`);
|
||||
console.log(`Output: ${transformedPrivateInserts}`);
|
||||
} else {
|
||||
await insertIntoPrivateGraph(lib, transformedPrivateInserts);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,106 +0,0 @@
|
||||
const { batchedDbUpdate, transformLandingZoneGraph } = 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,
|
||||
TARGET_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT,
|
||||
MAIN_INFO_MAPPING,
|
||||
PRIVATE_INFO_MAPPING
|
||||
} = 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: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @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 - withouth 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 },
|
||||
LANDING_ZONE_DATABASE_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function onFinishInitialIngest(lib) {
|
||||
const { muAuthSudo, fetch } = lib;
|
||||
|
||||
console.log(`!! On-finish triggered !!`);
|
||||
|
||||
const transformedMainInsertTriples = await transformLandingZoneGraph(fetch, endpoint, MAIN_INFO_MAPPING);
|
||||
console.log(`Transformed ${transformedMainInsertTriples.length} main triples`);
|
||||
|
||||
if (transformedMainInsertTriples.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
transformedMainInsertTriples,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
|
||||
const transformedPrivateInsertTriples = await transformLandingZoneGraph(fetch, endpoint, PRIVATE_INFO_MAPPING);
|
||||
console.log(`Transformed ${transformedPrivateInsertTriples.length} private triples`);
|
||||
|
||||
if (transformedPrivateInsertTriples.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
transformedPrivateInsertTriples,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch,
|
||||
onFinishInitialIngest
|
||||
};
|
||||
@@ -1,204 +0,0 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
TARGET_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
LANDING_ZONE_GRAPH,
|
||||
BATCH_SIZE
|
||||
} = require('./config');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits an array into two parts, a part that passes and a part that fails a predicate function.
|
||||
* Credits: https://github.com/benjay10
|
||||
* @public
|
||||
* @function partition
|
||||
* @param {Array} arr - Array to be partitioned
|
||||
* @param {Function} fn - Function that accepts single argument: an element of the array, and should return a truthy or falsy value.
|
||||
* @returns {Object} Object that contains keys passes and fails, each representing an array with elemets that pass or fail the predicate respectively
|
||||
*/
|
||||
function partition(arr, fn) {
|
||||
let passes = [], fails = [];
|
||||
arr.forEach((item) => (fn(item) ? passes : fails).push(item));
|
||||
return { passes, fails };
|
||||
}
|
||||
|
||||
/**
|
||||
* Send triples to reasoning service for conversion
|
||||
*
|
||||
*/
|
||||
async function transformTriples(fetch, triples, mapping) {
|
||||
return await operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
async function mainConversion(fetch, triples, mapping) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
let requestOptions = {
|
||||
method: 'POST',
|
||||
body: formdata,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}`, requestOptions)
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
async function transformStatements(fetch, triples, mapping = 'main') {
|
||||
console.log(`Received ${JSON.stringify(triples)} to transform`);
|
||||
const transformedTriples = await transformTriples(fetch, triples.join('\n'), mapping);
|
||||
statements = transformedTriples ? transformedTriples.replace(/\n{2,}/g, '').split('\n') : [];
|
||||
console.log(`CONVERSION: FROM ${triples.length} triples to ${statements.length}`);
|
||||
return statements;
|
||||
}
|
||||
|
||||
async function deleteFromTargetGraph(lib, statements) {
|
||||
console.log(`Deleting ${statements.length} statements from target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
async function deleteFromPrivateGraph(lib, statements) {
|
||||
console.log(`Deleting ${statements.length} statements from target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'DELETE');
|
||||
}
|
||||
|
||||
async function insertIntoTargetGraph(lib, statements) {
|
||||
console.log(`Inserting ${statements.length} statements into target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
TARGET_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'INSERT');
|
||||
}
|
||||
|
||||
async function insertIntoPrivateGraph(lib, statements) {
|
||||
console.log(`Inserting ${statements.length} statements into target graph`);
|
||||
console.log(`Statements: ${JSON.stringify(statements)}`)
|
||||
|
||||
await batchedDbUpdate(
|
||||
lib.muAuthSudo.updateSudo,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
statements,
|
||||
{},
|
||||
process.env.MU_SPARQL_ENDPOINT,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
'INSERT');
|
||||
}
|
||||
|
||||
async function transformLandingZoneGraph(fetch, endpoint, mapping = 'main') {
|
||||
console.log(`Transforming landing zone graph: ${LANDING_ZONE_GRAPH}`);
|
||||
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}?data=${encodeURIComponent(`${endpoint}?default-graph-uri=&query=CONSTRUCT+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D+WHERE+%7B%0D%0A+GRAPH+<${LANDING_ZONE_GRAPH}>+%7B%0D%0A%3Fs+%3Fp+%3Fo%0D%0A%7D%0D%0A%7D&should-sponge=&format=text%2Fplain&timeout=0&run=+Run+Query`)}`);
|
||||
const text = await response.text();
|
||||
const statements = text.replace(/\n{2,}/g, '').split('\n');
|
||||
|
||||
return statements;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
batchedDbUpdate,
|
||||
partition,
|
||||
transformStatements,
|
||||
transformLandingZoneGraph,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph,
|
||||
deleteFromPrivateGraph,
|
||||
insertIntoPrivateGraph
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?organisation skos:prefLabel ?oldLabel;
|
||||
regorg:legalName ?oldName.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?organisation skos:prefLabel ?newName;
|
||||
regorg:legalName ?newName.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?organisation a besluit:Bestuurseenheid;
|
||||
skos:prefLabel ?oldLabel;
|
||||
regorg:legalName ?oldName.
|
||||
}
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
}
|
||||
VALUES (?organisation ?newName) {
|
||||
(<http://data.lblod.info/id/bestuurseenheden/99da98a7a0087d3429b084ebfc4eb5d488c593790d4d5af7253982a2e21a6a5f> """Bilzen-Hoeselt""")
|
||||
(<http://data.lblod.info/id/bestuurseenheden/9ae900a5447b7d727ca6496910220d4389aba7f1869923f1bbf9729bdeca28e2> """Bilzen-Hoeselt""")
|
||||
(<http://data.lblod.info/id/bestuurseenheden/05099fa1f6524b8b994d86f61549455d2c00b2a956d5308683ac2d1f810fc729> """Tessenderlo-Ham""")
|
||||
(<http://data.lblod.info/id/bestuurseenheden/42a43591e0db1dca9432f480f0f49f9bd4056c2b131e2fc997497130f5e099d0> """Tessenderlo-Ham""")
|
||||
(<http://data.lblod.info/id/bestuurseenheden/104f32d7fb8d4b8b61b71717301656f136fe046eabaf126fb3325896b5c2d625> """Tongeren-Borgloon""")
|
||||
(<http://data.lblod.info/id/bestuurseenheden/ab684633d605d93dbbe6b9ea40667e2bcf03a0856cafe1825e95b7829ed502a3> """Tongeren-Borgloon""")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
VALUES ?org {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e41ffa04f94bb450a79793020e70d55b5fee5033a5280277998608a9d0913117>
|
||||
<http://data.lblod.info/id/bestuurseenheden/7125fcbfb7a08f8c01efbed115cea602db249c04afe9b5a2cc298cc7949cd040>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/4f0eb4436c88cf831c35f84e7c34ce32f9ee4e99c5139aff62990e5e531aa1e7>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6af55cecaea3621f53bb32417a36ed6e3d41b2aa5b9f6d62ab3d80cc8ec11539>
|
||||
<http://data.lblod.info/id/bestuurseenheden/c362abc58ac4579ff417824ce620962ac57bc344b34fe8f51d21b35ef54da36d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/72bc672ceb6894d8dd31dc2dff2faad2fd93f4b9f5347d556d092516eaa30aa3>
|
||||
<http://data.lblod.info/id/bestuurseenheden/d3c76fd84794dad5e12c9eed6d6332dc5e5c99daf0e4ddd7ceebf13d5d6c0ccd>
|
||||
<http://data.lblod.info/id/bestuurseenheden/bbc23313f4c8585a0c51f15f920d77123356535cd1cad9af38f5707892c7088d>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/a3bd0845853278f478f90b14436d3efa99e73249a84d462f0ddc2e5b6e37a156>
|
||||
<http://data.lblod.info/id/bestuurseenheden/785e8d5516378c7382ad0e7e356d2301496d810c6cd46d72ccebb455d3ac525e>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/05441122597e0b20b61a8968ea1247c07f9014aad1f1f0709d0b1234e3dfbc2f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3834647b5e95ea20f5ffe5a12a09fbd3d7fdf0d187fab385cb7b841422176ad6>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/0327a51548f73607f8a5ec11b36711a3c96703686ad93a3d632718c135c295db>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e39bc997aa6dd9f240277735efd745b6a0422614d2b36cf01825c86b1b91a9ee>
|
||||
<http://data.lblod.info/id/bestuurseenheden/0a2d980559eb9f3e0820386541274a72692f495204cd6d951ea1907ecc65829b>
|
||||
<http://data.lblod.info/id/bestuurseenheden/144c75e403c5084af57f5c0c86252b8759b56baf9694326abbcb5ea40ab69f1a>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/00eb231f51bd6b4f5dcc6536b2d09a174ea8583f5bf28b10bc4fc769a07e511d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/c69192b973a3ca11531b9657b3ee20aa6688fa33ea1ef1392310fec751980ab2>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3eb8c9fae32d02359dcd7b22e2a74e67a5b48388df31ad819c27c688fedd10b0>
|
||||
<http://data.lblod.info/id/bestuurseenheden/ba8a253d98ea7d2ab1afc43e5e2cd145a12ccd86b68e71d023e3c13a83d7498f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/76c45d60f05bf8afc8c71859342b69cac6a57ee2b320b900a60afd6ba9b8eb9d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5d21ccef2f5aa3ccbf3a74c6f25ebe9f0b1ef5a97b87f3d79c86ae9d6d857df8>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/af8969752f6b28c66b6bc402d7987fa38774901ac72b95c5cb7976570487c3c9>
|
||||
<http://data.lblod.info/id/bestuurseenheden/fb1be873c4b31e391613dfae8e68edd694b1fdf126eeecb502b1e5cad6f2f682>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/f6b131de5e40a0dfd4fc93fedf3b95c9bf156ece718b87fe00469dea2564b3fb>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3e077115eeb70b649d44e2ebbb218f2cfcac5d84e130c88584f0ec23f7cebbf9>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/1313d4a58f9ecf52cc7e274e3549a759b35e731973cc9f5e07562e5650f594dd>
|
||||
<http://data.lblod.info/id/bestuurseenheden/7c6b38fa6fc65879cb674a654617de171adfcfacba086fb918da3749dbaa43b5>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/c5dbb08e35e2d090a05d119fef4cc161b5ee1f322698cb8ea3c8c6643a521cf2>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f2a9a2392d5e4c0f992a84a0871d048a7b91b14681e9980a63aa6ba4b1f7eb8c>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/c0b6b5cf198cd939251dff8ed052177cfff245074c6b8d43394c8c97f7b6e945>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8ef1e4a43efd913e6b09b0ddea344b7b5d723a344ad559389a55ae1ff0bebc8f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/04895013fe6301f32aa46deae98abfb833a717ece5a33b6c453674c6d0f4cc5e>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f56f068943a99059f5bfc3b905fe8848a25a47cfa30fb3ed3d294b47815b2255>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/5a4b2b4f1de1f3b91b0348a7eb6d6aa0ef9420b8ec31374970c9ffe933a79515>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3f57a17fbcdfc13def910c54948bec11d71d3f75946b0336fffc0587bf18d783>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/2564e21e3650f91625189ccb7eb055e47754a0633c54c7582a899171fef60c52>
|
||||
<http://data.lblod.info/id/bestuurseenheden/60daf27c2cf12dd123447aa300dd7320890391dbd8dd6b4dd7ec02258f8281b3>
|
||||
}
|
||||
}
|
||||
;
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?org regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
VALUES ?org {
|
||||
<http://data.lblod.info/id/bestuurseenheden/4b44e6f1-113b-4692-b149-44a889b215f2>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/1ca65d65-54ff-4b44-b750-bd70c91191af>
|
||||
<http://data.lblod.info/id/bestuurseenheden/7d53f659-3a3b-44b1-9e77-3ea067678c0e>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/b8bb293d-aa22-4b43-bda4-0b6af76e9493>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5d94b2fd-60ee-4e56-a1f0-a586d596adf6>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/19483103-318e-435a-aa37-45e485406ee9>
|
||||
<http://data.lblod.info/id/bestuurseenheden/fd41f573-7d9a-4d9f-b7d0-d5b6114d1622>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/add1e4eb-9ec7-4ea6-af82-335aa76b7d48>
|
||||
<http://data.lblod.info/id/bestuurseenheden/650378e7-1bee-4737-91ff-5b20ac4623cf>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address locn:adminUnitL2 "Antwerpen".
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?address locn:adminUnitL2 "Oost-Vlaanderen".
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address a locn:Address;
|
||||
adres:gemeentenaam "Zwijndrecht";
|
||||
locn:adminUnitL2 "Antwerpen"
|
||||
FILTER (EXISTS { ?site organisatie:bestaatUit ?address. } ||
|
||||
EXISTS { ?site org:siteAddress/locn:address ?address. })
|
||||
|
||||
}
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address adres:gemeentenaam ?oldMunicipality.
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?address adres:gemeentenaam ?newMunicipality.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH ?g {
|
||||
?address a locn:Address;
|
||||
adres:gemeentenaam ?oldMunicipality.
|
||||
FILTER (EXISTS { ?site organisatie:bestaatUit ?address. } ||
|
||||
EXISTS { ?site org:siteAddress/locn:address ?address. })
|
||||
}
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
}
|
||||
VALUES (?oldMunicipality ?newMunicipality) {
|
||||
("Borsbeek" "Antwerpen")
|
||||
("Galmaarden" "Pajottegem")
|
||||
("Gooik" "Pajottegem")
|
||||
("Herne" "Pajottegem")
|
||||
("Ruiselede" "Wingene")
|
||||
("Meulebeke" "Tielt")
|
||||
("De Pinte" "Nazareth-De Pinte")
|
||||
("Nazareth" "Nazareth-De Pinte")
|
||||
("Wachtebeke" "Lochristi")
|
||||
("Moerbeke" "Lokeren")
|
||||
("Melle" "Merelbeke-Melle")
|
||||
("Merelbeke" "Merelbeke-Melle")
|
||||
("Beveren" "Beveren-Kruibeke-Zwijndrecht")
|
||||
("Kruibeke" "Beveren-Kruibeke-Zwijndrecht")
|
||||
("Zwijndrecht" "Beveren-Kruibeke-Zwijndrecht")
|
||||
("Bilzen" "Bilzen-Hoeselt")
|
||||
("Hoeselt" "Bilzen-Hoeselt")
|
||||
("Borgloon" "Tongeren-Borgloon")
|
||||
("Tongeren" "Tongeren-Borgloon")
|
||||
("Ham" "Tessenderlo-Ham")
|
||||
("Tessenderlo" "Tessenderlo-Ham")
|
||||
("Kortessem" "Hasselt")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?newFullAddress.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress;
|
||||
locn:thoroughfare ?street;
|
||||
adres:Adresvoorstelling.huisnummer ?buildingNo;
|
||||
locn:postCode ?postalCode;
|
||||
adres:gemeentenaam ?municipality;
|
||||
adres:land ?country.
|
||||
FILTER NOT EXISTS { ?address adres:Adresvoorstelling.busnummer ?boxNo. }
|
||||
FILTER (EXISTS { ?site organisatie:bestaatUit ?address. } ||
|
||||
EXISTS { ?site org:siteAddress/locn:address ?address. })
|
||||
FILTER (?municipality IN (
|
||||
"Antwerpen",
|
||||
"Pajottegem",
|
||||
"Wingene",
|
||||
"Tielt",
|
||||
"Nazareth-De Pinte",
|
||||
"Lochristi",
|
||||
"Lokeren",
|
||||
"Merelbeke-Melle",
|
||||
"Beveren-Kruibeke-Zwijndrecht",
|
||||
"Bilzen-Hoeselt",
|
||||
"Tongeren-Borgloon",
|
||||
"Tessenderlo-Ham",
|
||||
"Hasselt"
|
||||
))
|
||||
BIND (CONCAT(?street, " ", ?buildingNo, ", ", ?postalCode, " ", ?municipality, ", ", ?country) AS ?newFullAddress)
|
||||
FILTER (?fullAddress != ?newFullAddress)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
}
|
||||
}
|
||||
;
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?newFullAddress.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress;
|
||||
locn:thoroughfare ?street;
|
||||
adres:Adresvoorstelling.huisnummer ?buildingNo;
|
||||
adres:Adresvoorstelling.busnummer ?boxNo;
|
||||
locn:postCode ?postalCode;
|
||||
adres:gemeentenaam ?municipality;
|
||||
adres:land ?country.
|
||||
FILTER (EXISTS { ?site organisatie:bestaatUit ?address. } ||
|
||||
EXISTS { ?site org:siteAddress/locn:address ?address. })
|
||||
FILTER (?municipality IN (
|
||||
"Antwerpen",
|
||||
"Pajottegem",
|
||||
"Wingene",
|
||||
"Tielt",
|
||||
"Nazareth-De Pinte",
|
||||
"Lochristi",
|
||||
"Lokeren",
|
||||
"Merelbeke-Melle",
|
||||
"Beveren-Kruibeke-Zwijndrecht",
|
||||
"Bilzen-Hoeselt",
|
||||
"Tongeren-Borgloon",
|
||||
"Tessenderlo-Ham",
|
||||
"Hasselt"
|
||||
))
|
||||
BIND (CONCAT(?street, " ", ?buildingNo, " ", ?boxNo, ", ", ?postalCode, " ", ?municipality, ", ", ?country) AS ?newFullAddress)
|
||||
FILTER (?fullAddress != ?newFullAddress)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s regorg:orgStatus ?activeStatus.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s regorg:orgStatus ?notActiveStatus.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?s {
|
||||
<http://data.lblod.info/id/bestuurseenheden/150440a8bb763d6f53d24ca1c6f1460cb5817c8a261fd90e74aadac3292c3efe>
|
||||
<http://data.lblod.info/id/bestuurseenheden/41d31a2eb697af977aadf64c73e0bcffb094e0f20e4017fe3b49c507079c0976>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/330516b323c00851cf4b93e6d5d7a2ef4591f68ae6e71ad9c1f432ee70521bb2>
|
||||
<http://data.lblod.info/id/bestuurseenheden/7dd1250996188607bb1e28df1ebea0b943e8db59c08ea01e3c57672531c43ec6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/541c1603eb8c01968f95d1f262854134499e00d135cd7c9147d307ccbd1e20fd>
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/4deae42b2b25bff407f5abc7cbb6d62eb02afaf2892086341c324fdf2c0e6e92>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b7af3483cb5d0021c6f5864a433b211fce30246ef685621d104b1951915c21c4>
|
||||
}
|
||||
BIND (<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> AS ?notActiveStatus)
|
||||
BIND (<http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> AS ?activeStatus)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?stAmandus regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?stAmandus regorg:orgStatus ?notActiveStatus.
|
||||
|
||||
?mergerChangeEvent org:originalOrganization ?stAmandus.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?stAmandus regorg:orgStatus ?oldStatus.
|
||||
}
|
||||
VALUES ?stAmandus {
|
||||
<http://data.lblod.info/id/besturenVanDeEredienst/b18a5d3943087d509d76dcceeba102c3>
|
||||
}
|
||||
BIND (<http://data.lblod.info/id/veranderingsgebeurtenissen/677E445E29299CC832892A0F> AS ?mergerChangeEvent)
|
||||
BIND (<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> AS ?notActiveStatus)
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?timedBody mandaat:bindingEinde "2025-01-02"^^xsd:dateTime
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?body besluit:bestuurt ?org.
|
||||
?timedBody generiek:isTijdspecialisatieVan ?body;
|
||||
mandaat:bindingStart ?startDate.
|
||||
FILTER (YEAR(?startDate) = 2019)
|
||||
FILTER NOT EXISTS {?timedBody mandaat:bindingEinde ?endDate}
|
||||
}
|
||||
# These are the municipalities and OCMWs that will become inactive after the
|
||||
# merger. For the organisations that are already active, such as Antwerp and
|
||||
# Bilzen, an end date was already set previously.
|
||||
VALUES ?org {
|
||||
<http://data.lblod.info/id/bestuurseenheden/7125fcbfb7a08f8c01efbed115cea602db249c04afe9b5a2cc298cc7949cd040> # Borsbeek (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/e41ffa04f94bb450a79793020e70d55b5fee5033a5280277998608a9d0913117> # Borsbeek (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/72bc672ceb6894d8dd31dc2dff2faad2fd93f4b9f5347d556d092516eaa30aa3> # Beveren (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/4f0eb4436c88cf831c35f84e7c34ce32f9ee4e99c5139aff62990e5e531aa1e7> # Beveren (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/d3c76fd84794dad5e12c9eed6d6332dc5e5c99daf0e4ddd7ceebf13d5d6c0ccd> # Kruibeke (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/6af55cecaea3621f53bb32417a36ed6e3d41b2aa5b9f6d62ab3d80cc8ec11539> # Kruibeke (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/bbc23313f4c8585a0c51f15f920d77123356535cd1cad9af38f5707892c7088d> # Zwijndrecht (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/c362abc58ac4579ff417824ce620962ac57bc344b34fe8f51d21b35ef54da36d> # Zwijndrecht (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/785e8d5516378c7382ad0e7e356d2301496d810c6cd46d72ccebb455d3ac525e> # Hoeselt (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/a3bd0845853278f478f90b14436d3efa99e73249a84d462f0ddc2e5b6e37a156> # Hoeselt (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/3834647b5e95ea20f5ffe5a12a09fbd3d7fdf0d187fab385cb7b841422176ad6> # Borgloon (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/05441122597e0b20b61a8968ea1247c07f9014aad1f1f0709d0b1234e3dfbc2f> # Borgloon (Gemeente)
|
||||
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/0a2d980559eb9f3e0820386541274a72692f495204cd6d951ea1907ecc65829b> # Nazareth (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/0327a51548f73607f8a5ec11b36711a3c96703686ad93a3d632718c135c295db> # Nazareth (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/144c75e403c5084af57f5c0c86252b8759b56baf9694326abbcb5ea40ab69f1a> # De Pinte (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/e39bc997aa6dd9f240277735efd745b6a0422614d2b36cf01825c86b1b91a9ee> # De Pinte (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/ba8a253d98ea7d2ab1afc43e5e2cd145a12ccd86b68e71d023e3c13a83d7498f> # Galmaarden (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/00eb231f51bd6b4f5dcc6536b2d09a174ea8583f5bf28b10bc4fc769a07e511d> # Galmaarden (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/76c45d60f05bf8afc8c71859342b69cac6a57ee2b320b900a60afd6ba9b8eb9d> # Gooik (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/c69192b973a3ca11531b9657b3ee20aa6688fa33ea1ef1392310fec751980ab2> # Gooik (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/5d21ccef2f5aa3ccbf3a74c6f25ebe9f0b1ef5a97b87f3d79c86ae9d6d857df8> # Herne (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/3eb8c9fae32d02359dcd7b22e2a74e67a5b48388df31ad819c27c688fedd10b0> # Herne (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/fb1be873c4b31e391613dfae8e68edd694b1fdf126eeecb502b1e5cad6f2f682> # Tessenderlo (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/af8969752f6b28c66b6bc402d7987fa38774901ac72b95c5cb7976570487c3c9> # Tessenderlo (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/3e077115eeb70b649d44e2ebbb218f2cfcac5d84e130c88584f0ec23f7cebbf9> # Kortessem (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/f6b131de5e40a0dfd4fc93fedf3b95c9bf156ece718b87fe00469dea2564b3fb> # Kortessem (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/7c6b38fa6fc65879cb674a654617de171adfcfacba086fb918da3749dbaa43b5> # Wachtebeke (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/1313d4a58f9ecf52cc7e274e3549a759b35e731973cc9f5e07562e5650f594dd> # Wachtebeke (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/04895013fe6301f32aa46deae98abfb833a717ece5a33b6c453674c6d0f4cc5e> # Melle (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/c0b6b5cf198cd939251dff8ed052177cfff245074c6b8d43394c8c97f7b6e945> # Melle (Gemeente)
|
||||
<http://data.lblod.info/id/bestuurseenheden/f56f068943a99059f5bfc3b905fe8848a25a47cfa30fb3ed3d294b47815b2255> # Merelbeke (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/8ef1e4a43efd913e6b09b0ddea344b7b5d723a344ad559389a55ae1ff0bebc8f> # Merelbeke (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/3f57a17fbcdfc13def910c54948bec11d71d3f75946b0336fffc0587bf18d783> # Meulebeke (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/5a4b2b4f1de1f3b91b0348a7eb6d6aa0ef9420b8ec31374970c9ffe933a79515> # Meulebeke (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/f2a9a2392d5e4c0f992a84a0871d048a7b91b14681e9980a63aa6ba4b1f7eb8c> # Moerbeke (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/c5dbb08e35e2d090a05d119fef4cc161b5ee1f322698cb8ea3c8c6643a521cf2> # Moerbeke (Gemeente)
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/60daf27c2cf12dd123447aa300dd7320890391dbd8dd6b4dd7ec02258f8281b3> # Ruiselede (OCMW)
|
||||
<http://data.lblod.info/id/bestuurseenheden/2564e21e3650f91625189ccb7eb055e47754a0633c54c7582a899171fef60c52> # Ruiselede (Gemeente)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
|
||||
# This migration add merger change events for municipalities and OCMWs for which
|
||||
# the resulting active organisation is a new, different resource.
|
||||
|
||||
## Mergers involving two original organisations
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
org:resultingOrganization ?resultingOrg;
|
||||
dct:date "2025-01-01"^^xsd:dateTime;
|
||||
dct:description ?description;
|
||||
org:originalOrganization ?firstOrgToMerge;
|
||||
org:originalOrganization ?secondOrgToMerge;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventFirstNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventSecondNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventActiveResult;
|
||||
ch:typeWijziging <http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1>. # Merger
|
||||
|
||||
?changeEventFirstNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventFirstNotActiveResult;
|
||||
ext:resultingOrganization ?firstOrgToMerge;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventSecondNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventSecondNotActiveResult;
|
||||
ext:resultingOrganization ?secondOrgToMerge;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventActiveResult;
|
||||
ext:resultingOrganization ?resultingOrg;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>. # active
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?firstOrgToMerge ?secondOrgToMerge ?resultingOrg) {
|
||||
# Nazareth (municipality) + De Pinte (municipality) = Nazareth-De Pinte (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/0327a51548f73607f8a5ec11b36711a3c96703686ad93a3d632718c135c295db>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e39bc997aa6dd9f240277735efd745b6a0422614d2b36cf01825c86b1b91a9ee>
|
||||
<http://data.lblod.info/id/bestuurseenheden/1ca65d65-54ff-4b44-b750-bd70c91191af>)
|
||||
# Nazareth (OCMW) + De Pinte (OCMW) = Nazareth-De Pinte (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/0a2d980559eb9f3e0820386541274a72692f495204cd6d951ea1907ecc65829b>
|
||||
<http://data.lblod.info/id/bestuurseenheden/144c75e403c5084af57f5c0c86252b8759b56baf9694326abbcb5ea40ab69f1a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/7d53f659-3a3b-44b1-9e77-3ea067678c0e>)
|
||||
|
||||
# Melle (municipality) + Merelbeke (municipality) = Merelbeke-Melle (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/c0b6b5cf198cd939251dff8ed052177cfff245074c6b8d43394c8c97f7b6e945>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8ef1e4a43efd913e6b09b0ddea344b7b5d723a344ad559389a55ae1ff0bebc8f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b8bb293d-aa22-4b43-bda4-0b6af76e9493>)
|
||||
# Melle (OCMW) + Merelbeke (OCMW) = Merelbeke-Melle (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/04895013fe6301f32aa46deae98abfb833a717ece5a33b6c453674c6d0f4cc5e>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f56f068943a99059f5bfc3b905fe8848a25a47cfa30fb3ed3d294b47815b2255>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5d94b2fd-60ee-4e56-a1f0-a586d596adf6>)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?firstOrgToMerge skos:prefLabel ?labelFirstOrg.
|
||||
?secondOrgToMerge skos:prefLabel ?labelSecondOrg.
|
||||
?resultingOrg skos:prefLabel ?labelResultingOrg;
|
||||
org:classification ?classification.
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?classification skos:prefLabel ?classificationResultingOrg.
|
||||
}
|
||||
|
||||
BIND(CONCAT("Fusie tussen ", ?labelFirstOrg," en ", ?labelSecondOrg, " resulteert in ", ?classificationResultingOrg, " ", ?labelResultingOrg) as ?description)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?firstOrgToMerge), STR(?secondOrgToMerge), STR(?resultingOrg),"fusieChangeEvent")) AS ?uuidChangeEvent)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?firstOrgToMerge),"fusieChangeEventFirstNotActiveResult")) AS ?uuidChangeEventFirstNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventFirstNotActiveResult))) AS ?changeEventFirstNotActiveResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?secondOrgToMerge),"fusieChangeEventSecondNotActiveResult")) AS ?uuidChangeEventSecondNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventSecondNotActiveResult))) AS ?changeEventSecondNotActiveResult)
|
||||
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?firstOrgToMerge), STR(?secondOrgToMerge), STR(?resultingOrg),"fusieChangeEventActiveResult")) AS ?uuidChangeEventActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventActiveResult))) AS ?changeEventActiveResult)
|
||||
}
|
||||
;
|
||||
## Mergers involving three original organisations
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
org:resultingOrganization ?resultingOrg;
|
||||
dct:date "2025-01-01"^^xsd:dateTime;
|
||||
dct:description ?description;
|
||||
org:originalOrganization ?firstOrgToMerge;
|
||||
org:originalOrganization ?secondOrgToMerge;
|
||||
org:originalOrganization ?thirdOrgToMerge;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventFirstNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventSecondNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventThirdNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventActiveResult;
|
||||
ch:typeWijziging <http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1>. # Merger
|
||||
|
||||
?changeEventFirstNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventFirstNotActiveResult;
|
||||
ext:resultingOrganization ?firstOrgToMerge;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventSecondNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventSecondNotActiveResult;
|
||||
ext:resultingOrganization ?secondOrgToMerge;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventThirdNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventThirdNotActiveResult;
|
||||
ext:resultingOrganization ?thirdOrgToMerge;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventActiveResult;
|
||||
ext:resultingOrganization ?resultingOrg;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>. # active
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?firstOrgToMerge ?secondOrgToMerge ?thirdOrgToMerge ?resultingOrg) {
|
||||
# Beveren (municipality) + Kruibeke (municipality) + Zwijndrecht (municipality) = Beveren-Kruibeke-Zwijndrecht (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/4f0eb4436c88cf831c35f84e7c34ce32f9ee4e99c5139aff62990e5e531aa1e7> <http://data.lblod.info/id/bestuurseenheden/6af55cecaea3621f53bb32417a36ed6e3d41b2aa5b9f6d62ab3d80cc8ec11539> <http://data.lblod.info/id/bestuurseenheden/c362abc58ac4579ff417824ce620962ac57bc344b34fe8f51d21b35ef54da36d> <http://data.lblod.info/id/bestuurseenheden/19483103-318e-435a-aa37-45e485406ee9>)
|
||||
# Beveren (OCMW) + Kruibeke (OCMW) + Zwijndrecht (OCMW) = Beveren-Kruibeke-Zwijndrecht (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/72bc672ceb6894d8dd31dc2dff2faad2fd93f4b9f5347d556d092516eaa30aa3> <http://data.lblod.info/id/bestuurseenheden/d3c76fd84794dad5e12c9eed6d6332dc5e5c99daf0e4ddd7ceebf13d5d6c0ccd> <http://data.lblod.info/id/bestuurseenheden/bbc23313f4c8585a0c51f15f920d77123356535cd1cad9af38f5707892c7088d> <http://data.lblod.info/id/bestuurseenheden/fd41f573-7d9a-4d9f-b7d0-d5b6114d1622>)
|
||||
|
||||
# Galmaarden (municipality) + Gooik (municipality) + Herne (municipality) = Pajottegem (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/00eb231f51bd6b4f5dcc6536b2d09a174ea8583f5bf28b10bc4fc769a07e511d> <http://data.lblod.info/id/bestuurseenheden/c69192b973a3ca11531b9657b3ee20aa6688fa33ea1ef1392310fec751980ab2> <http://data.lblod.info/id/bestuurseenheden/3eb8c9fae32d02359dcd7b22e2a74e67a5b48388df31ad819c27c688fedd10b0> <http://data.lblod.info/id/bestuurseenheden/add1e4eb-9ec7-4ea6-af82-335aa76b7d48>)
|
||||
# Galmaarden (OCMW) + Gooik (OCMW) + Herne (OCMW) = Pajottegem (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/ba8a253d98ea7d2ab1afc43e5e2cd145a12ccd86b68e71d023e3c13a83d7498f> <http://data.lblod.info/id/bestuurseenheden/76c45d60f05bf8afc8c71859342b69cac6a57ee2b320b900a60afd6ba9b8eb9d> <http://data.lblod.info/id/bestuurseenheden/5d21ccef2f5aa3ccbf3a74c6f25ebe9f0b1ef5a97b87f3d79c86ae9d6d857df8> <http://data.lblod.info/id/bestuurseenheden/650378e7-1bee-4737-91ff-5b20ac4623cf>)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?firstOrgToMerge skos:prefLabel ?labelFirstOrg.
|
||||
?secondOrgToMerge skos:prefLabel ?labelSecondOrg.
|
||||
?thirdOrgToMerge skos:prefLabel ?labelThirdOrg.
|
||||
?resultingOrg skos:prefLabel ?labelResultingOrg;
|
||||
org:classification ?classification.
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?classification skos:prefLabel ?classificationResultingOrg.
|
||||
}
|
||||
|
||||
BIND(CONCAT("Fusie tussen ", ?labelFirstOrg, ", ", ?labelSecondOrg," en ", ?labelThirdOrg, " resulteert in ", ?classificationResultingOrg, " ", ?labelResultingOrg) as ?description)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?firstOrgToMerge), STR(?secondOrgToMerge), STR(?thirdOrgToMerge), STR(?resultingOrg),"fusieChangeEvent")) AS ?uuidChangeEvent)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?firstOrgToMerge),"fusieChangeEventFirstNotActiveResult")) AS ?uuidChangeEventFirstNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventFirstNotActiveResult))) AS ?changeEventFirstNotActiveResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?secondOrgToMerge),"fusieChangeEventSecondNotActiveResult")) AS ?uuidChangeEventSecondNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventSecondNotActiveResult))) AS ?changeEventSecondNotActiveResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?thirdOrgToMerge),"fusieChangeEventThirdNotActiveResult")) AS ?uuidChangeEventThirdNotActiveResult) .
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventThirdNotActiveResult))) AS ?changeEventThirdNotActiveResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?resultingOrg),"fusieChangeEventActiveResult")) AS ?uuidChangeEventActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventActiveResult))) AS ?changeEventActiveResult)
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
# This migration adds merger change events for municipalities and OCMWs for
|
||||
# which the resulting active organisation is one of the original organisations.
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
org:resultingOrganization ?resultingOrg;
|
||||
dct:date "2025-01-01"^^xsd:dateTime;
|
||||
dct:description ?description;
|
||||
org:originalOrganization ?resultingOrg;
|
||||
org:originalOrganization ?notActiveOrganisation;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventActiveResult;
|
||||
ch:typeWijziging <http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1>. # Merger
|
||||
|
||||
?changeEventNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventNotActiveResult;
|
||||
ext:resultingOrganization ?notActiveOrganisation;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventActiveResult;
|
||||
ext:resultingOrganization ?resultingOrg;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>. # Active
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?notActiveOrganisation ?resultingOrg) {
|
||||
# Hoeselt (municipality) + Bilzen (municipality) = Bilzen (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/a3bd0845853278f478f90b14436d3efa99e73249a84d462f0ddc2e5b6e37a156>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99da98a7a0087d3429b084ebfc4eb5d488c593790d4d5af7253982a2e21a6a5f>)
|
||||
# Hoeselt (OCMW) + Bilzen (OCMW) = Bilzen (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/785e8d5516378c7382ad0e7e356d2301496d810c6cd46d72ccebb455d3ac525e>
|
||||
<http://data.lblod.info/id/bestuurseenheden/9ae900a5447b7d727ca6496910220d4389aba7f1869923f1bbf9729bdeca28e2>)
|
||||
|
||||
# Borgloon (municipality) + Tongeren (municipality) = Tongeren (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/05441122597e0b20b61a8968ea1247c07f9014aad1f1f0709d0b1234e3dfbc2f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/104f32d7fb8d4b8b61b71717301656f136fe046eabaf126fb3325896b5c2d625>)
|
||||
# Borgloon (OCMW) + Tongeren (OCMW) = Tongeren (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/3834647b5e95ea20f5ffe5a12a09fbd3d7fdf0d187fab385cb7b841422176ad6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/ab684633d605d93dbbe6b9ea40667e2bcf03a0856cafe1825e95b7829ed502a3>)
|
||||
|
||||
# Tessenderlo (municipality) + Ham (municipality) = Ham (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/af8969752f6b28c66b6bc402d7987fa38774901ac72b95c5cb7976570487c3c9>
|
||||
<http://data.lblod.info/id/bestuurseenheden/05099fa1f6524b8b994d86f61549455d2c00b2a956d5308683ac2d1f810fc729>)
|
||||
# Tessenderlo (OCMW) + Ham (OCMW) = Ham (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/fb1be873c4b31e391613dfae8e68edd694b1fdf126eeecb502b1e5cad6f2f682>
|
||||
<http://data.lblod.info/id/bestuurseenheden/42a43591e0db1dca9432f480f0f49f9bd4056c2b131e2fc997497130f5e099d0>)
|
||||
|
||||
# Kortessem (municipality) + Hasselt (municipality) = Hasselt (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/f6b131de5e40a0dfd4fc93fedf3b95c9bf156ece718b87fe00469dea2564b3fb>
|
||||
<http://data.lblod.info/id/bestuurseenheden/9db1b46874a57fe63c08fb5f16b117e6f61fdd98e7f64f745d0fceb9d3731169>)
|
||||
# Kortessem (OCMW) + Hasselt (OCMW) = Hasselt (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/3e077115eeb70b649d44e2ebbb218f2cfcac5d84e130c88584f0ec23f7cebbf9>
|
||||
<http://data.lblod.info/id/bestuurseenheden/026509cf3b4eeb7ad88fe57a270060574f60abd1c3524837d36700e40809d210>)
|
||||
|
||||
# Wachtebeke (municipality) + Lochristi (municipality) = Lochristi (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/1313d4a58f9ecf52cc7e274e3549a759b35e731973cc9f5e07562e5650f594dd>
|
||||
<http://data.lblod.info/id/bestuurseenheden/2ac1bb2a7d7bbd98e2e7a24be2c67e42171788a71c2436a33060626593bb2f78>)
|
||||
# Wachtebeke (OCMW) + Lochristi (OCMW) = Lochristi (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/7c6b38fa6fc65879cb674a654617de171adfcfacba086fb918da3749dbaa43b5>
|
||||
<http://data.lblod.info/id/bestuurseenheden/ee5d6d9da5fcf9e7bbd5c60931e37451f6bc816233c9c269565d79c2b2a37af5>)
|
||||
|
||||
# Moerbeke (municipality) + Lokeren (municipality) = Lokeren (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/c5dbb08e35e2d090a05d119fef4cc161b5ee1f322698cb8ea3c8c6643a521cf2>
|
||||
<http://data.lblod.info/id/bestuurseenheden/cb2a6e0a490ee881ddd0d9ded7f2b3d1dc2df7e57a19d014caac054bfa355f5a>)
|
||||
# Moerbeke (OCMW) + Lokeren (OCMW) = Lokeren (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/f2a9a2392d5e4c0f992a84a0871d048a7b91b14681e9980a63aa6ba4b1f7eb8c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/323a24f2fe81ee0b6586ec78be36760e478092e07386b2785992ea8b61941833>)
|
||||
|
||||
# Meulebeke (municipality) + Tielt (municipality) = Tielt (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/5a4b2b4f1de1f3b91b0348a7eb6d6aa0ef9420b8ec31374970c9ffe933a79515>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b36da606fba6dd4dc99ae1ef5f4a52bba3268d33f4bc2cd1e65b87f01f35101a>)
|
||||
# Meulebeke (OCMW) + Tielt (OCMW) = Tielt (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/3f57a17fbcdfc13def910c54948bec11d71d3f75946b0336fffc0587bf18d783>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f6ef0202c1dca780c66e269f2d21aa39a690f4c57ad05ece63f178b629bbb98e>)
|
||||
|
||||
# Ruiselede (municipality) + Wingene (municipality) = Wingene (municipality)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/2564e21e3650f91625189ccb7eb055e47754a0633c54c7582a899171fef60c52>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99ed6eee81a7aca47517cbffb46eaba38f3987eeb4ad32c020898644769eb615>)
|
||||
# Ruiselede (OCMW) + Wingene (OCMW) = Wingene (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/60daf27c2cf12dd123447aa300dd7320890391dbd8dd6b4dd7ec02258f8281b3>
|
||||
<http://data.lblod.info/id/bestuurseenheden/518c31a6e89f514c075e0927bce9fb2c91a552b6d65208c04a687d4bcb81148c>)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?notActiveOrganisation skos:prefLabel ?labelNotActiveOrganisation.
|
||||
?resultingOrg skos:prefLabel ?labelResultingOrg;
|
||||
org:classification ?classification.
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?classification skos:prefLabel ?classificationResultingOrg.
|
||||
}
|
||||
|
||||
BIND(CONCAT("Fusie tussen ", ?labelResultingOrg," en ", ?labelNotActiveOrganisation, " resulteert in ", ?classificationResultingOrg, " ", ?labelResultingOrg) as ?description)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation), STR(?resultingOrg),"fusieChangeEvent")) AS ?uuidChangeEvent)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation),"fusieChangeEventNotActiveResult")) AS ?uuidChangeEventNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventNotActiveResult))) AS ?changeEventNotActiveResult)
|
||||
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation), STR(?resultingOrg),"fusieChangeEventActiveResult")) AS ?uuidChangeEventActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventActiveResult))) AS ?changeEventActiveResult)
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
# Add merger change event for Borsbeek (municipality) + Antwerpen (municipality) = Borsbeek (district) + Antwerpen (municipality)
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
ch:typeWijziging <http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1>; # Merger
|
||||
dct:date "2025-01-01"^^xsd:dateTime;
|
||||
dct:description ?description;
|
||||
org:originalOrganization ?borsbeekMunicipality;
|
||||
org:originalOrganization ?antwerpMunicipality;
|
||||
org:resultingOrganization ?borsbeekDistrict;
|
||||
org:resultingOrganization ?antwerpMunicipality;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?borsbeekMunicipalityResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?borsbeekDistrictResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?antwerpMunicipalityResult.
|
||||
|
||||
?borsbeekMunicipalityResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidBorsbeekMunicipalityResult;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>; # not active
|
||||
ext:resultingOrganization ?borsbeekMunicipality.
|
||||
|
||||
?borsbeekDistrictResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidBorsbeekDistrictResult;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>; # Active
|
||||
ext:resultingOrganization ?borsbeekDistrict.
|
||||
|
||||
?antwerpMunicipalityResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidAntwerpMunicipalityResult;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>; # Active
|
||||
ext:resultingOrganization ?antwerpMunicipality.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?borsbeekMunicipality ?antwerpMunicipality ?borsbeekDistrict) {
|
||||
(<http://data.lblod.info/id/bestuurseenheden/e41ffa04f94bb450a79793020e70d55b5fee5033a5280277998608a9d0913117> # Borsbeek (municipality)
|
||||
<http://data.lblod.info/id/bestuurseenheden/670db1d66c0de3b931962e1044033ccfa9d6e3023aa9828a5f252c3bc69bd32c> # Antwerpen (municipality)
|
||||
<http://data.lblod.info/id/bestuurseenheden/4b44e6f1-113b-4692-b149-44a889b215f2>) # Borsbeek (district)
|
||||
}
|
||||
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?antwerpMunicipality skos:prefLabel ?antwerpMunicipalityLabel;
|
||||
org:classification ?antwerpClassification.
|
||||
|
||||
?borsbeekMunicipality skos:prefLabel ?borsbeekMunicipalityLabel.
|
||||
|
||||
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?borsbeekDistrict skos:prefLabel ?borsbeekDistrictLabel;
|
||||
org:classification ?borsbeekDistrictClassification.
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?antwerpClassification skos:prefLabel ?antwerpClassificationLabel.
|
||||
?borsbeekDistrictClassification skos:prefLabel ?borsbeekDistrictClassificationLabel.
|
||||
}
|
||||
|
||||
BIND(CONCAT("Fusie tussen ", ?borsbeekMunicipalityLabel," en ", ?antwerpMunicipalityLabel, " resulteert in ", ?borsbeekDistrictClassificationLabel, " ", ?borsbeekDistrictLabel, " en ", ?antwerpClassificationLabel, " ", ?antwerpMunicipalityLabel) as ?description)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?borsbeekMunicipality), STR(?antwerpMunicipality), STR(?borsbeekDistrict),"fusieChangeEvent")) AS ?uuidChangeEvent)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?borsbeekMunicipality),"mergerBorsbeekMunicipalityChangeEventResult")) AS ?uuidBorsbeekMunicipalityResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidBorsbeekMunicipalityResult))) AS ?borsbeekMunicipalityResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?borsbeekDistrict),"mergerBorsbeekDistrictChangeEventResult")) AS ?uuidBorsbeekDistrictResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidBorsbeekDistrictResult))) AS ?borsbeekDistrictResult)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?antwerpMunicipality),"mergerAntwerpMunicipalityChangeEventResult")) AS ?uuidAntwerpMunicipalityResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidAntwerpMunicipalityResult))) AS ?antwerpMunicipalityResult)
|
||||
}
|
||||
;
|
||||
# Add merger change event for Borsbeek (OCMW) + Antwerp (OCMW) = Antwerp (OCMW)
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
org:resultingOrganization ?resultingOrg;
|
||||
dct:date "2025-01-01"^^xsd:dateTime;
|
||||
dct:description ?description;
|
||||
org:originalOrganization ?resultingOrg;
|
||||
org:originalOrganization ?notActiveOrganisation;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventNotActiveResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?changeEventActiveResult;
|
||||
ch:typeWijziging <http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1>. # Merger
|
||||
|
||||
?changeEventNotActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventNotActiveResult;
|
||||
ext:resultingOrganization ?notActiveOrganisation;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>. # not active
|
||||
|
||||
?changeEventActiveResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidChangeEventActiveResult;
|
||||
ext:resultingOrganization ?resultingOrg;
|
||||
lblodOrg:resulterendeStatus <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6>. # Active
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?notActiveOrganisation ?resultingOrg) {
|
||||
# Borsbeek (OCMW) + Antwerp (OCMW) = Antwerp (OCMW)
|
||||
(<http://data.lblod.info/id/bestuurseenheden/7125fcbfb7a08f8c01efbed115cea602db249c04afe9b5a2cc298cc7949cd040>
|
||||
<http://data.lblod.info/id/bestuurseenheden/83c7a12a4a8ac8dd82895715095a866dc4794e60de61b967419bdfc1e207ad96>)
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?notActiveOrganisation skos:prefLabel ?labelNotActiveOrganisation.
|
||||
?resultingOrg skos:prefLabel ?labelResultingOrg;
|
||||
org:classification ?classification.
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?classification skos:prefLabel ?classificationResultingOrg.
|
||||
}
|
||||
|
||||
BIND(CONCAT("Fusie tussen ", ?labelResultingOrg," en ", ?labelNotActiveOrganisation, " resulteert in ", ?classificationResultingOrg, " ", ?labelResultingOrg) as ?description)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation), STR(?resultingOrg),"fusieChangeEvent")) AS ?uuidChangeEvent)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent)
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation),"fusieChangeEventNotActiveResult")) AS ?uuidChangeEventNotActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventNotActiveResult))) AS ?changeEventNotActiveResult)
|
||||
|
||||
|
||||
BIND(SHA256(CONCAT(STR(?notActiveOrganisation), STR(?resultingOrg),"fusieChangeEventActiveResult")) AS ?uuidChangeEventActiveResult)
|
||||
BIND(IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidChangeEventActiveResult))) AS ?changeEventActiveResult)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/public
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?nisCode <http://mu.semte.ch/vocabularies/core/uuid> ?uuid .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?nisCode a skos:Concept ;
|
||||
skos:inScheme <http://vocab.belgif.be/auth/refnis2025> .
|
||||
|
||||
BIND(SHA256(CONCAT("NIS codes 2025", STR(?nisCode))) AS ?uuid) .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?werkingsgebied <http://www.w3.org/2004/02/skos/core#exactMatch> ?nis2019 .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?werkingsgebied <http://www.w3.org/2004/02/skos/core#exactMatch> ?nis2025 .
|
||||
}
|
||||
} WHERE {
|
||||
?werkingsgebied a <http://www.w3.org/ns/prov#Location> ;
|
||||
<http://www.w3.org/2004/02/skos/core#exactMatch> ?nis2019 .
|
||||
|
||||
?nis2019 skos:inScheme <http://vocab.belgif.be/auth/refnis2019> .
|
||||
|
||||
?nis2025 a skos:Concept ;
|
||||
skos:inScheme <http://vocab.belgif.be/auth/refnis2025> ;
|
||||
skos:exactMatch ?nis2019 .
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?werkingsgebied <http://www.w3.org/2004/02/skos/core#exactMatch> ?preMergerNIS .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?werkingsgebied <http://www.w3.org/2004/02/skos/core#exactMatch> ?postMergerNIS .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?werkingsgebied ?postMergerNIS) {
|
||||
(<http://data.lblod.info/id/werkingsgebieden/92398c49-30d5-46b2-af90-37f135c89e47> <http://vocab.belgif.be/auth/refnis2025/23106>) # Pajottegem
|
||||
(<http://data.lblod.info/id/werkingsgebieden/21034a361da5b5c45424cbbef38a89029ca025e32aa1b132fcceca1d13149ee6> <http://vocab.belgif.be/auth/refnis2025/37021>) # Wingene
|
||||
(<http://data.lblod.info/id/werkingsgebieden/1fb92312354f3d900670e2b9cfbd80148910f1227e321f2c377f92957b071cb1> <http://vocab.belgif.be/auth/refnis2025/37022>) # Tielt
|
||||
(<http://data.lblod.info/id/werkingsgebieden/41362ab2-5130-4160-b76b-4bfa5d9a1f59> <http://vocab.belgif.be/auth/refnis2025/44086>) # Nazareth-De Pinte
|
||||
(<http://data.lblod.info/id/werkingsgebieden/f1552be4471af0742d8ea03cd8596900c634a66f67e1fbc130d79f655de0240e> <http://vocab.belgif.be/auth/refnis2025/44087>) # Lochristi
|
||||
(<http://data.lblod.info/id/werkingsgebieden/4afbdfef4de7314c2637a9f950b13bb9b0b4eaaf3413c0bd5d0600852a9d7cb3> <http://vocab.belgif.be/auth/refnis2025/46029>) # Lokeren
|
||||
(<http://data.lblod.info/id/werkingsgebieden/62fef519-b1de-4a0f-911a-c63a5365c17b> <http://vocab.belgif.be/auth/refnis2025/44088>) # Merelbeke-Melle
|
||||
(<http://data.lblod.info/id/werkingsgebieden/b97c1b58-6431-4509-ab94-3300d27759a8> <http://vocab.belgif.be/auth/refnis2025/46030>) # Beveren-Kruibeke-Zwijndrecht
|
||||
(<http://data.lblod.info/id/werkingsgebieden/1f5dd7043ad54d07751da8689d5b47ad9ae0e52dccce8f00cc8debab35f8e2b2> <http://vocab.belgif.be/auth/refnis2025/73110>) # Bilzen-Hoeselt
|
||||
(<http://data.lblod.info/id/werkingsgebieden/fabec9e745fc9efa32afadd8b7268938805b9679dcf3b032c9b9a9a3530d6b59> <http://vocab.belgif.be/auth/refnis2025/73111>) # Tongeren-Borgloon
|
||||
(<http://data.lblod.info/id/werkingsgebieden/fc34bb0a1dbf157ac5e5f8e657dd774210f03d2efa21370dd3b9a6342906c7ab> <http://vocab.belgif.be/auth/refnis2025/71071>) # Tessenderlo-Ham
|
||||
(<http://data.lblod.info/id/werkingsgebieden/e55336a3ecbae33f21e595458ba93eeeb0fa4390626622884d4d32523d0e0033> <http://vocab.belgif.be/auth/refnis2025/71072>) # Hasselt
|
||||
}
|
||||
|
||||
?werkingsgebied a <http://www.w3.org/ns/prov#Location> .
|
||||
|
||||
OPTIONAL {
|
||||
?werkingsgebied <http://www.w3.org/2004/02/skos/core#exactMatch> ?preMergerNIS .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/0da11d9fdef2d45f90fd4ebd353ecd3c> ?p ?o.
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/d9f7c0ab4920fdecf3f9a60b92e921b5ca07248fcb0eac2113eb97392ddd6c6c> <http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> <http://data.lblod.info/id/betrokkenLokaleBesturen/0da11d9fdef2d45f90fd4ebd353ecd3c>.
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?localInvolvementWortegemPetegem <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> ?percentage.
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?localInvolvementWortegemPetegem <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> 100.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
BIND(<http://mu.semte.ch/graphs/worship-service> AS ?g)
|
||||
GRAPH ?g {
|
||||
?localInvolvementWortegemPetegem <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> ?percentage.
|
||||
}
|
||||
VALUES ?localInvolvementWortegemPetegem {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/00b8f19ce0fafa090df049498337aad8>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?province org:hasSubOrganization ?municipality.
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?province org:hasSubOrganization ?municipality.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?province org:hasSubOrganization ?municipality.
|
||||
}
|
||||
VALUES ?municipality {
|
||||
<http://data.lblod.info/id/bestuurseenheden/19483103-318e-435a-aa37-45e485406ee9> # Beveren-Kruibeke-Zwijndrecht
|
||||
<http://data.lblod.info/id/bestuurseenheden/1ca65d65-54ff-4b44-b750-bd70c91191af> # Nazareth-De Pinte
|
||||
<http://data.lblod.info/id/bestuurseenheden/add1e4eb-9ec7-4ea6-af82-335aa76b7d48> # Pajottegem
|
||||
<http://data.lblod.info/id/bestuurseenheden/b8bb293d-aa22-4b43-bda4-0b6af76e9493> # Merelbeke-Melle
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/b38d5606b539da68af04891d9ca08605> ?p ?o.
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e41ffa04f94bb450a79793020e70d55b5fee5033a5280277998608a9d0913117> <http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> <http://data.lblod.info/id/betrokkenLokaleBesturen/b38d5606b539da68af04891d9ca08605>.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/1f525a624264469c0a765a33f1c609cc> ?p ?o.
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/5a4b2b4f1de1f3b91b0348a7eb6d6aa0ef9420b8ec31374970c9ffe933a79515> <http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> <http://data.lblod.info/id/betrokkenLokaleBesturen/1f525a624264469c0a765a33f1c609cc>.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/623B1D5CB72F9F4B3350823E> ?p ?o.
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a3bd0845853278f478f90b14436d3efa99e73249a84d462f0ddc2e5b6e37a156> <http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur> <http://data.lblod.info/id/betrokkenLokaleBesturen/623B1D5CB72F9F4B3350823E>.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
ch:typeWijziging ?mergerChangeEventType;
|
||||
org:resultingOrganization ?resultingOrganisation;
|
||||
dct:date "2025-01-01"^^xsd:date;
|
||||
dct:description "Fusie tussen PZ Alken/Borgloon/Heers/Kortessem/Wellen (= 5379 PZ Kanton Borgloon) en PZ Tongeren/Herstappe (= 5380 PZ Tongeren/Herstappe) resulteert in PZ Tongeren-Borgloon/Herstappe/Heers/Wellen (= 5962 PZ Haspengouw)";
|
||||
org:originalOrganization ?firstNotActiveOriginal;
|
||||
org:originalOrganization ?secondNotActiveOriginal;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?firstNotActiveChangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?secondNotActivechangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?resultingOrganisationChangeEventResult.
|
||||
|
||||
?firstNotActiveChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidFirstNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?firstNotActiveOriginal.
|
||||
|
||||
?secondNotActivechangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidSecondNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?secondNotActiveOriginal.
|
||||
|
||||
?resultingOrganisationChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidResultingOrganisationChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?activeStatus;
|
||||
ext:resultingOrganization ?resultingOrganisation.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?firstNotActiveOriginal ?secondNotActiveOriginal ?resultingOrganisation) {
|
||||
(<http://data.lblod.info/id/bestuurseenheden/150440a8bb763d6f53d24ca1c6f1460cb5817c8a261fd90e74aadac3292c3efe> # PZ Alken/Borgloon/Heers/Kortessem/Wellen
|
||||
<http://data.lblod.info/id/bestuurseenheden/41d31a2eb697af977aadf64c73e0bcffb094e0f20e4017fe3b49c507079c0976> # PZ Tongeren/Herstappe
|
||||
<http://data.lblod.info/id/bestuurseenheden/677E848329299CC832892A1B> # PZ Tongeren-Borgloon/Herstappe/Heers/Wellen
|
||||
)
|
||||
}
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?resultingOrganization))) AS ?uuidChangeEvent) .
|
||||
BIND (IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), "FirstNotActiveMergerChangeEventResult")) AS ?uuidFirstNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidFirstNotActiveChangeEventResult))) AS ?firstNotActiveChangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?secondNotActiveOriginal), "SecondNotActiveMergerChangeEventResult")) AS ?uuidSecondNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidSecondNotActiveChangeEventResult))) AS ?secondNotActivechangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?resultingOrganization), "fusieChangeEventActiveResult")) AS ?uuidResultingOrganisationChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidResultingOrganisationChangeEventResult))) AS ?resultingOrganisationChangeEventResult) .
|
||||
|
||||
BIND (<http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1> AS ?mergerChangeEventType)
|
||||
BIND (<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> AS ?notActiveStatus)
|
||||
BIND (<http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> AS ?activeStatus)
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
# Add fusion change event
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
ch:typeWijziging ?mergerChangeEventType;
|
||||
org:resultingOrganization ?resultingOrganisation;
|
||||
dct:date "2025-01-01"^^xsd:date;
|
||||
dct:description "Fusie tussen PZ Zwijndrecht (= 5346 PZ Zwijndrecht) en PZ Kruibeke/Temse (= 5433 PZ Kruibeke/Temse) en PZ Beveren/Sint-Gillis-Waas/Stekene (= 5904 Waasland-Noord) resulteert in PZ Beveren-Kruibeke-Zwijndrecht/Sint-Gillis-Waas/Stekene/Temse (= 5964 PZ Scheldewaas)";
|
||||
org:originalOrganization ?firstNotActiveOriginal;
|
||||
org:originalOrganization ?secondNotActiveOriginal;
|
||||
org:originalOrganization ?thirdNotActiveOriginal;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?firstNotActiveChangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?secondNotActiveChangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?thirdNotActiveChangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?resultingOrganisationChangeEventResult.
|
||||
|
||||
?firstNotActiveChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidFirstNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?firstNotActiveOriginal.
|
||||
|
||||
?secondNotActiveChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidSecondNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?secondNotActiveOriginal.
|
||||
|
||||
?thirdNotActiveChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidThirdNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?thirdNotActiveOriginal.
|
||||
|
||||
?resultingOrganisationChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidResultingOrganisationChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?activeStatus;
|
||||
ext:resultingOrganization ?resultingOrganisation.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?firstNotActiveOriginal ?secondNotActiveOriginal ?thirdNotActiveOriginal ?resultingOrganisation) {
|
||||
(<http://data.lblod.info/id/bestuurseenheden/330516b323c00851cf4b93e6d5d7a2ef4591f68ae6e71ad9c1f432ee70521bb2> # PZ Zwijndrecht
|
||||
<http://data.lblod.info/id/bestuurseenheden/7dd1250996188607bb1e28df1ebea0b943e8db59c08ea01e3c57672531c43ec6> # PZ Kruibeke/Temse
|
||||
<http://data.lblod.info/id/bestuurseenheden/541c1603eb8c01968f95d1f262854134499e00d135cd7c9147d307ccbd1e20fd> # PZ Beveren/Sint-Gillis-Waas/Stekene
|
||||
<http://data.lblod.info/id/bestuurseenheden/677E959629299CC832892A24> # PZ Beveren-Kruibeke-Zwijndrecht/Sint-Gillis-Waas/Stekene/Temse
|
||||
)
|
||||
}
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?resultingOrganization))) AS ?uuidChangeEvent) .
|
||||
BIND (IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), "FirstNotActiveMergerChangeEventResult")) AS ?uuidFirstNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidFirstNotActiveChangeEventResult))) AS ?firstNotActiveChangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?secondNotActiveOriginal), "SecondNotActiveMergerChangeEventResult")) AS ?uuidSecondNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidSecondNotActiveChangeEventResult))) AS ?secondNotActiveChangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?thirdNotActiveOriginal), "ThirdNotActiveMergerChangeEventResult")) AS ?uuidThirdNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidThirdNotActiveChangeEventResult))) AS ?thirdNotActiveChangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?thirdNotActiveOriginal), STR(?resultingOrganization), "MergerChangeEventResultActiveResult")) AS ?uuidResultingOrganisationChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidResultingOrganisationChangeEventResult))) AS ?resultingOrganisationChangeEventResult) .
|
||||
|
||||
BIND (<http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1> AS ?mergerChangeEventType)
|
||||
BIND (<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> AS ?notActiveStatus)
|
||||
BIND (<http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> AS ?activeStatus)
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX lblodOrg: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
# Add fusion change event
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?changeEvent a org:ChangeEvent;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
ch:typeWijziging ?mergerChangeEventType;
|
||||
org:resultingOrganization ?resultingOrganisation;
|
||||
dct:date "2025-01-01"^^xsd:date;
|
||||
dct:description "Fusie tussen PZ Kluisbergen/Kruisem/Oudenaarde/Wortegem-Petegem (= 5425 PZ Vlaamse Ardennen) en PZ Brakel/Horebeke/Maarkedal/Zwalm (= 5426 PZ Brakel) resulteert in PZ Vlaamse Ardennen (= 5915 PZ Vlaamse Ardennen)";
|
||||
org:originalOrganization ?firstNotActiveOriginal;
|
||||
org:originalOrganization ?secondNotActiveOriginal;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?firstNotActiveChangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?secondNotActivechangeEventResult;
|
||||
lblodOrg:veranderingsgebeurtenisResultaat ?resultingOrganisationChangeEventResult.
|
||||
|
||||
?firstNotActiveChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidFirstNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?firstNotActiveOriginal.
|
||||
|
||||
?secondNotActivechangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidSecondNotActiveChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?notActiveStatus;
|
||||
ext:resultingOrganization ?secondNotActiveOriginal.
|
||||
|
||||
?resultingOrganisationChangeEventResult a lblodOrg:VeranderingsgebeurtenisResultaat;
|
||||
mu:uuid ?uuidResultingOrganisationChangeEventResult;
|
||||
lblodOrg:resulterendeStatus ?activeStatus;
|
||||
ext:resultingOrganization ?resultingOrganisation.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES (?firstNotActiveOriginal ?secondNotActiveOriginal ?resultingOrganisation) {
|
||||
(<http://data.lblod.info/id/bestuurseenheden/4deae42b2b25bff407f5abc7cbb6d62eb02afaf2892086341c324fdf2c0e6e92> # PZ Kluisbergen/Kruisem/Oudenaarde/Wortegem-Petegem
|
||||
<http://data.lblod.info/id/bestuurseenheden/b7af3483cb5d0021c6f5864a433b211fce30246ef685621d104b1951915c21c4> # PZ Brakel/Horebeke/Maarkedal/Zwalm
|
||||
<http://data.lblod.info/id/bestuurseenheden/677E966229299CC832892A2D> # PZ Vlaamse Ardennen
|
||||
)
|
||||
}
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?resultingOrganization))) AS ?uuidChangeEvent) .
|
||||
BIND (IRI(CONCAT("http://data.lblod.info/id/veranderingsgebeurtenissen/", STR(?uuidChangeEvent))) AS ?changeEvent) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), "FirstNotActiveMergerChangeEventResult")) AS ?uuidFirstNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidFirstNotActiveChangeEventResult))) AS ?firstNotActiveChangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?secondNotActiveOriginal), "SecondNotActiveMergerChangeEventResult")) AS ?uuidSecondNotActiveChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidSecondNotActiveChangeEventResult))) AS ?secondNotActivechangeEventResult) .
|
||||
|
||||
BIND (SHA256(CONCAT(STR(?firstNotActiveOriginal), STR(?secondNotActiveOriginal), STR(?resultingOrganization), "fusieChangeEventActiveResult")) AS ?uuidResultingOrganisationChangeEventResult) .
|
||||
BIND (IRI(CONCAT("http://lblod.data.info/id/veranderingsgebeurtenis-resultaten/", STR(?uuidResultingOrganisationChangeEventResult))) AS ?resultingOrganisationChangeEventResult) .
|
||||
|
||||
BIND (<http://lblod.data.gift/concepts/fa80032794c841ecac73ff874f856db1> AS ?mergerChangeEventType)
|
||||
BIND (<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> AS ?notActiveStatus)
|
||||
BIND (<http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> AS ?activeStatus)
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/4b8450cf-a326-4c66-9e63-b4ec10acc7f6>
|
||||
<http://www.w3.org/2004/02/skos/core#inScheme> <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?container ?containerP ?containerO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
task:operation ?operation;
|
||||
dct:created ?created.
|
||||
|
||||
FILTER(?created < "2024-01-01T00:00:00"^^xsd:dateTime)
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
task:resultsContainer ?container.
|
||||
|
||||
?container a nfo:DataContainer;
|
||||
?containerP ?containerO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?task ?taskP ?taskO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
dct:created ?created;
|
||||
task:operation ?operation.
|
||||
|
||||
FILTER(?created < "2024-01-01T00:00:00"^^xsd:dateTime)
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
?taskP ?taskO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?job ?jobP ?jobO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
dct:created ?created;
|
||||
task:operation ?operation;
|
||||
?jobP ?jobO.
|
||||
|
||||
FILTER(?created < "2024-01-01T00:00:00"^^xsd:dateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?container ?containerP ?containerO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
task:operation ?operation;
|
||||
dct:created ?created.
|
||||
|
||||
FILTER(?created < "2025-01-01T00:00:00"^^xsd:dateTime)
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
task:resultsContainer ?container.
|
||||
|
||||
?container a nfo:DataContainer;
|
||||
?containerP ?containerO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?task ?taskP ?taskO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
dct:created ?created;
|
||||
task:operation ?operation.
|
||||
|
||||
FILTER(?created < "2025-01-01T00:00:00"^^xsd:dateTime)
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
?taskP ?taskO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?job ?jobP ?jobO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
dct:created ?created;
|
||||
task:operation ?operation;
|
||||
?jobP ?jobO.
|
||||
|
||||
FILTER(?created < "2025-01-01T00:00:00"^^xsd:dateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?container ?containerP ?containerO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
task:operation ?operation.
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
task:resultsContainer ?container.
|
||||
|
||||
?container a nfo:DataContainer;
|
||||
?containerP ?containerO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?task ?taskP ?taskO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
task:operation ?operation.
|
||||
|
||||
?task dct:isPartOf ?job;
|
||||
?taskP ?taskO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX task: <http://redpencil.data.gift/vocabularies/tasks/>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX oslc: <http://open-services.net/ns/core#>
|
||||
PREFIX cogs: <http://vocab.deri.ie/cogs#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/resource/>
|
||||
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?job ?jobP ?jobO.
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?operation {
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/initialSync/leidinggevenden>
|
||||
<http://redpencil.data.gift/id/jobs/concept/JobOperation/deltas/consumer/deltaSync/leidinggevenden>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?job a <http://vocab.deri.ie/cogs#Job>;
|
||||
task:operation ?operation;
|
||||
?jobP ?jobO.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://www.w3.org/ns/person#Person>;
|
||||
?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
|
||||
VALUES ?p {
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>
|
||||
foaf:givenName
|
||||
foaf:familyName
|
||||
<http://data.vlaanderen.be/ns/persoon#gebruikteVoornaam>
|
||||
}
|
||||
|
||||
?functionaris a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris>;
|
||||
<http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan> ?s.
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://www.w3.org/ns/person#Person>;
|
||||
?p ?o.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris>;
|
||||
?p ?o.
|
||||
}
|
||||
|
||||
} WHERE {
|
||||
|
||||
VALUES ?p {
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>
|
||||
<http://www.w3.org/ns/org#holds>
|
||||
<http://data.vlaanderen.be/ns/mandaat#status>
|
||||
<http://data.vlaanderen.be/ns/mandaat#start>
|
||||
<http://data.vlaanderen.be/ns/mandaat#einde>
|
||||
<http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan>
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris>;
|
||||
?p ?o.
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user