Compare commits
119 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43caffdce8 | ||
|
|
0d3ba99048 | ||
|
|
8b40cf597f | ||
|
|
f78e7ad99a | ||
|
|
8fb0bd245a | ||
|
|
cdfe850b47 | ||
|
|
ab6da30578 | ||
|
|
33740d1749 | ||
|
|
245786a94a | ||
|
|
5d30fa368d | ||
|
|
8bc16f1551 | ||
|
|
412ebf3220 | ||
|
|
46da33334a | ||
|
|
d27a99cdee | ||
|
|
04b689b9d2 | ||
|
|
29d0203311 | ||
|
|
af56734cde | ||
|
|
e948aea401 | ||
|
|
e89aba8d53 | ||
|
|
43948054aa | ||
|
|
024a090453 | ||
|
|
f34672d697 | ||
|
|
14f18793e7 | ||
| b7f70202bd | |||
| 1aa950a521 | |||
|
|
f81e591238 | ||
|
|
c82317e2bb | ||
|
|
e38769fb1f | ||
|
|
f4ea1e7307 | ||
|
|
cc49c6c5b7 | ||
| 4581fd0b61 | |||
|
|
a8d16d966f | ||
| e34561f4e7 | |||
|
|
9f4ec2f3d9 | ||
|
|
90c4105c10 | ||
|
|
35a11c917d | ||
|
|
996be3625c | ||
|
|
5b742e1161 | ||
|
|
4b92e0a9a6 | ||
|
|
768b1bc5df | ||
|
|
8083deffe3 | ||
|
|
8c869af7f1 | ||
|
|
7c5ab8ec4f | ||
|
|
91e06501d3 | ||
|
|
aa06ae84c5 | ||
|
|
ba802bfaf6 | ||
|
|
496f52512a | ||
|
|
8f14716eb4 | ||
|
|
1a1b0937c2 | ||
|
|
523247b4da | ||
|
|
ba14cdf1e8 | ||
|
|
08f3424e11 | ||
|
|
a9efd0564a | ||
|
|
9fa3e6e30d | ||
|
|
2662c962f9 | ||
|
|
313c13e28c | ||
|
|
5948f3ece6 | ||
|
|
da4bece141 | ||
|
|
0c0a644225 | ||
|
|
80b72fe09d | ||
|
|
b7b6d2bc40 | ||
|
|
fc22377b28 | ||
|
|
b13d6f7b03 | ||
|
|
4078f8149d | ||
|
|
4c356113aa | ||
|
|
e617b471c4 | ||
|
|
3a23aa3c2d | ||
|
|
7c136c5494 | ||
|
|
68b5c67a16 | ||
|
|
21532f17c0 | ||
|
|
ae53746323 | ||
|
|
73ff073540 | ||
|
|
2dbc29adeb | ||
|
|
22cc8ad09e | ||
|
|
622dae7969 | ||
|
|
47a2ca5072 | ||
|
|
a4098a5b84 | ||
|
|
dfb7bbd7dc | ||
|
|
70d6add28d | ||
|
|
cc4a842281 | ||
|
|
d01168989f | ||
|
|
b518a5ea79 | ||
| c62c0aa4a9 | |||
| 8a779c5d9f | |||
| a7334e161d | |||
|
|
6293b77492 | ||
|
|
12bacd7391 | ||
|
|
627b4950dd | ||
|
|
1fbe0f2fda | ||
|
|
d1925167b3 | ||
|
|
f7df3a3cb0 | ||
| 539e88f604 | |||
| ed321540ba | |||
|
|
b32930f4bb | ||
|
|
4454a95137 | ||
| a94ddafb98 | |||
| e887c6ffeb | |||
| 96175d3de2 | |||
|
|
4ed997dabd | ||
|
|
02de06921e | ||
|
|
fefb103cb5 | ||
|
|
3aadf0960e | ||
|
|
666945f077 | ||
|
|
e3883db087 | ||
|
|
86e4304b7e | ||
|
|
64a2c22afc | ||
|
|
8d0686926e | ||
|
|
d08c88f312 | ||
|
|
9486643214 | ||
|
|
dc0aeec0dc | ||
|
|
53c449f08d | ||
|
|
f43ae9f642 | ||
|
|
4858aa51f3 | ||
|
|
6e4c5a45ed | ||
|
|
42dc3af86a | ||
|
|
99fe30d2ef | ||
| 7774283905 | |||
| 335501ede6 | |||
| a538b42abd |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
# Virtuoso files /data/db
|
||||
/data/db.bck/**
|
||||
/data/db/*
|
||||
!/data/db/virtuoso.ini
|
||||
/data/db/virtuoso.ini
|
||||
!/data/db/toLoad
|
||||
!/data/db/toLoad/*
|
||||
/data/files/*
|
||||
@@ -11,6 +11,7 @@ docker-compose.override.yml
|
||||
*.iml
|
||||
|
||||
/data/elasticsearch/**
|
||||
/data/ldes-feed/*
|
||||
/tmp
|
||||
.DS_STORE
|
||||
.env
|
||||
|
||||
@@ -223,6 +223,18 @@
|
||||
"https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://www.w3.org/ns/adms#Identifier",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/worship-service"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://www.w3.org/2004/02/skos/core#notation",
|
||||
"https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator"
|
||||
],
|
||||
"additionalFilter": "?ro <http://www.w3.org/ns/adms#identifier> ?subject ; a <http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> ."
|
||||
},
|
||||
{
|
||||
"type": "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator",
|
||||
"graphsFilter": [
|
||||
@@ -241,6 +253,17 @@
|
||||
"https://data.vlaanderen.be/ns/generiek#lokaleIdentificator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/worship-service"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"https://data.vlaanderen.be/ns/generiek#lokaleIdentificator"
|
||||
],
|
||||
"additionalFilter": "?ro <http://www.w3.org/ns/adms#identifier>/<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> ?subject ; a <http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> ."
|
||||
},
|
||||
{
|
||||
"type": "http://lblod.data.gift/vocabularies/organisatie/BestuurseenheidClassificatieCode",
|
||||
"graphsFilter": [
|
||||
@@ -256,48 +279,21 @@
|
||||
},
|
||||
{
|
||||
"type": "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan",
|
||||
"strictTypeExport": "true",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/shared",
|
||||
"http://mu.semte.ch/graphs/worship-service",
|
||||
"http://mu.semte.ch/graphs/administrative-unit"
|
||||
],
|
||||
"pathToConceptScheme": [
|
||||
"http://www.w3.org/ns/org#classification",
|
||||
"http://www.w3.org/2004/02/skos/core#inScheme"
|
||||
"http://mu.semte.ch/graphs/administrative-unit",
|
||||
"http://mu.semte.ch/graphs/worship-service"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://data.vlaanderen.be/ns/mandaat#bindingEinde",
|
||||
"http://data.vlaanderen.be/ns/mandaat#bindingStart",
|
||||
"http://data.vlaanderen.be/ns/besluit#bestuurt",
|
||||
"http://www.w3.org/ns/org#classification",
|
||||
"https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan",
|
||||
"http://www.w3.org/ns/org#hasPost"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://data.vlaanderen.be/ns/besluit#Bestuursorgaan",
|
||||
"strictTypeExport": "true",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/shared",
|
||||
"http://mu.semte.ch/graphs/worship-service",
|
||||
"http://mu.semte.ch/graphs/administrative-unit"
|
||||
],
|
||||
"pathToConceptScheme": [
|
||||
"https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan",
|
||||
"http://www.w3.org/ns/org#classification",
|
||||
"http://www.w3.org/2004/02/skos/core#inScheme"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://data.vlaanderen.be/ns/mandaat#bindingEinde",
|
||||
"http://data.vlaanderen.be/ns/mandaat#bindingStart",
|
||||
"http://data.vlaanderen.be/ns/besluit#bestuurt",
|
||||
"http://www.w3.org/ns/org#classification",
|
||||
"https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan",
|
||||
"http://www.w3.org/ns/org#hasPost"
|
||||
]
|
||||
],
|
||||
"additionalFilter": "?subject (<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan>/<http://www.w3.org/ns/org#classification>/<http://www.w3.org/2004/02/skos/core#inScheme>)|(<http://www.w3.org/ns/org#classification>/<http://www.w3.org/2004/02/skos/core#inScheme>) <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> ."
|
||||
},
|
||||
{
|
||||
"type": "http://lblod.data.gift/vocabularies/organisatie/TypeEredienst",
|
||||
|
||||
@@ -105,24 +105,6 @@ export default [
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
graph: {
|
||||
type: 'uri',
|
||||
value: 'http://redpencil.data.gift/id/deltas/producer/organizations'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
url: 'http://delta-producer-json-diff-publisher-organizations/delta',
|
||||
method: 'POST'
|
||||
},
|
||||
options: {
|
||||
resourceFormat: 'v0.0.1',
|
||||
gracePeriod: 1000,
|
||||
ignoreFromSelf: true,
|
||||
optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"]
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
},
|
||||
@@ -140,24 +122,6 @@ export default [
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
graph: {
|
||||
type: 'uri',
|
||||
value: 'http://redpencil.data.gift/id/deltas/producer/public'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
url: 'http://delta-producer-json-diff-publisher-public/delta',
|
||||
method: 'POST'
|
||||
},
|
||||
options: {
|
||||
resourceFormat: 'v0.0.1',
|
||||
gracePeriod: 1000,
|
||||
ignoreFromSelf: true,
|
||||
optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"]
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
// anything
|
||||
@@ -197,5 +161,56 @@ export default [
|
||||
ignoreFromSelf: true,
|
||||
optOutMuScopeIds: ["http://redpencil.data.gift/id/concept/muScope/deltas/initialSync"]
|
||||
}
|
||||
},
|
||||
/*
|
||||
Commenting ldes rules until ready to go to qa/prod. In the meantime, we override the configuration on dev.
|
||||
{
|
||||
match: {
|
||||
graph: {
|
||||
type: 'uri',
|
||||
value: 'http://mu.semte.ch/graphs/shared',
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
url: 'http://ldes-delta-pusher/publish',
|
||||
method: 'POST',
|
||||
},
|
||||
options: {
|
||||
resourceFormat: 'v0.0.1',
|
||||
gracePeriod: 1000,
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
graph: {
|
||||
type: 'uri',
|
||||
value: 'http://mu.semte.ch/graphs/worship-service',
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
url: 'http://ldes-delta-pusher/publish',
|
||||
method: 'POST',
|
||||
},
|
||||
options: {
|
||||
resourceFormat: 'v0.0.1',
|
||||
gracePeriod: 1000,
|
||||
}
|
||||
},
|
||||
{
|
||||
match: {
|
||||
graph: {
|
||||
type: 'uri',
|
||||
value: 'http://mu.semte.ch/graphs/administrative-unit',
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
url: 'http://ldes-delta-pusher/publish',
|
||||
method: 'POST',
|
||||
},
|
||||
options: {
|
||||
resourceFormat: 'v0.0.1',
|
||||
gracePeriod: 1000,
|
||||
}
|
||||
}
|
||||
*/
|
||||
]
|
||||
|
||||
4
config/dev/tlsproxy/Caddyfile
Normal file
4
config/dev/tlsproxy/Caddyfile
Normal file
@@ -0,0 +1,4 @@
|
||||
{$SITE_ADDRESS}:443 {
|
||||
reverse_proxy identifier:80
|
||||
tls internal
|
||||
}
|
||||
@@ -305,6 +305,10 @@ defmodule Dispatcher do
|
||||
forward conn, path, "http://construct-administrative-unit-relationships/create-relationships/"
|
||||
end
|
||||
|
||||
get "/ldes/*path", %{ layer: :api_services } do
|
||||
forward conn, path, "http://ldes-backend/"
|
||||
end
|
||||
|
||||
#################################################################
|
||||
# ERROR REPORT
|
||||
#################################################################
|
||||
@@ -337,21 +341,12 @@ defmodule Dispatcher do
|
||||
Proxy.forward conn, path, "http://resource/distributions/"
|
||||
end
|
||||
|
||||
|
||||
#################################################################
|
||||
# DELTA: administrative-units
|
||||
#################################################################
|
||||
|
||||
get "/sync/administrative-units/files/*path" do
|
||||
Proxy.forward conn, path, "http://delta-producer-json-diff-file-publisher-administrative-units/files/"
|
||||
end
|
||||
|
||||
#################################################################
|
||||
# DELTA: organizations
|
||||
#################################################################
|
||||
|
||||
get "/sync/organizations/files/*path" do
|
||||
Proxy.forward conn, path, "http://delta-producer-json-diff-file-publisher-organizations/files/"
|
||||
Proxy.forward conn, path, "http://delta-producer-pub-graph-maintainer-organizations/files/"
|
||||
end
|
||||
|
||||
#################################################################
|
||||
@@ -359,7 +354,7 @@ defmodule Dispatcher do
|
||||
#################################################################
|
||||
|
||||
get "/sync/public/files/*path" do
|
||||
Proxy.forward conn, path, "http://delta-producer-json-diff-publisher-public/files/"
|
||||
Proxy.forward conn, path, "http://delta-producer-pub-graph-maintainer-public/files/"
|
||||
end
|
||||
|
||||
#################################################################
|
||||
@@ -374,10 +369,6 @@ defmodule Dispatcher do
|
||||
# frontend layer
|
||||
###############################################################
|
||||
|
||||
match "/authorization/callback/*_path", %{ accept: [:html], layer: :api } do
|
||||
Proxy.forward conn, [], "http://frontend/torii/redirect.html"
|
||||
end
|
||||
|
||||
match "/assets/*path", %{ layer: :api } do
|
||||
Proxy.forward conn, path, "http://frontend/assets/"
|
||||
end
|
||||
|
||||
73
config/ldes-delta-pusher/dispatch.ts
Normal file
73
config/ldes-delta-pusher/dispatch.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import { moveTriples } from "../support";
|
||||
import { Changeset } from "../types";
|
||||
import { query, sparqlEscapeUri } from 'mu';
|
||||
|
||||
export default async function dispatch(changesets: Changeset[]) {
|
||||
for (const changeset of changesets) {
|
||||
const subjects = new Set(changeset.inserts.map((insert) => insert.subject.value));
|
||||
for (const subject of subjects) {
|
||||
const { results: { bindings } } = await query(`
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX code: <http://telegraphis.net/ontology/measurement/code#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
|
||||
CONSTRUCT {
|
||||
?organization a org:Organization;
|
||||
skos:prefLabel ?prefLabel;
|
||||
adms:identifier ?identifier;
|
||||
org:hasPrimarySite ?site.
|
||||
?identifier skos:notation ?identifierLabel;
|
||||
generiek:gestructureerdeIdentificator ?gestructureerdeIdentificator.
|
||||
?gestructureerdeIdentificator generiek:lokaleIdentificator ?lokaleIdentificator.
|
||||
?site org:siteAddress ?siteAddress.
|
||||
?siteAddress ?p ?o.
|
||||
} WHERE {
|
||||
{
|
||||
VALUES ?organization { ${sparqlEscapeUri(subject)} }
|
||||
?organization a org:Organization;
|
||||
skos:prefLabel ?prefLabel;
|
||||
adms:identifier ?identifier;
|
||||
org:hasPrimarySite ?site.
|
||||
?identifier skos:notation ?identifierLabel;
|
||||
generiek:gestructureerdeIdentificator ?gestructureerdeIdentificator.
|
||||
?gestructureerdeIdentificator generiek:lokaleIdentificator ?lokaleIdentificator.
|
||||
?site org:siteAddress ?siteAddress.
|
||||
?siteAddress ?p ?o.
|
||||
} UNION {
|
||||
VALUES ?site { ${sparqlEscapeUri(subject)} }
|
||||
?organization a org:Organization;
|
||||
skos:prefLabel ?prefLabel;
|
||||
adms:identifier ?identifier;
|
||||
org:hasPrimarySite ?site.
|
||||
?identifier skos:notation ?identifierLabel;
|
||||
generiek:gestructureerdeIdentificator ?gestructureerdeIdentificator.
|
||||
?gestructureerdeIdentificator generiek:lokaleIdentificator ?lokaleIdentificator.
|
||||
?site org:siteAddress ?siteAddress.
|
||||
?siteAddress ?p ?o.
|
||||
} UNION {
|
||||
VALUES ?siteAddress { ${sparqlEscapeUri(subject)} }
|
||||
?organization a org:Organization;
|
||||
skos:prefLabel ?prefLabel;
|
||||
adms:identifier ?identifier;
|
||||
org:hasPrimarySite ?site.
|
||||
?identifier skos:notation ?identifierLabel;
|
||||
generiek:gestructureerdeIdentificator ?gestructureerdeIdentificator.
|
||||
?gestructureerdeIdentificator generiek:lokaleIdentificator ?lokaleIdentificator.
|
||||
?site org:siteAddress ?siteAddress.
|
||||
?siteAddress ?p ?o.
|
||||
}
|
||||
}
|
||||
`);
|
||||
if(bindings.length){
|
||||
console.log('SUCCESS')
|
||||
await moveTriples([
|
||||
{
|
||||
inserts: bindings.map(({ s, p, o}) => { return { subject: s, predicate: p, object: o} }),
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100;
|
||||
const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync';
|
||||
const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false;
|
||||
const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://virtuoso:8890/sparql';
|
||||
const 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);
|
||||
const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`;
|
||||
|
||||
// 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`;
|
||||
|
||||
if (!process.env.FILE_SYNC_GRAPH)
|
||||
throw `Expected 'FILE_SYNC_GRAPH' to be provided.`;
|
||||
const FILE_SYNC_GRAPH = process.env.FILE_SYNC_GRAPH;
|
||||
// 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,
|
||||
@@ -24,6 +26,7 @@ module.exports = {
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION,
|
||||
INGEST_GRAPH,
|
||||
FILE_SYNC_GRAPH
|
||||
LANDING_ZONE_GRAPH,
|
||||
TARGET_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT
|
||||
};
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
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,11 +1,8 @@
|
||||
const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util');
|
||||
const {
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
INGEST_GRAPH
|
||||
} = require('./config');
|
||||
transformStatements,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph,
|
||||
} = require('./util');
|
||||
|
||||
/**
|
||||
* Dispatch the fetched information to a target graph.
|
||||
@@ -23,43 +20,61 @@ const {
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, muAuthSudo, fetch } = lib;
|
||||
const { termObjectChangeSets } = data;
|
||||
const { mu, fetch } = lib;
|
||||
let { termObjectChangeSets, termObjectChangeSetsWithContext } = data;
|
||||
|
||||
for (let { deletes, inserts } of termObjectChangeSets) {
|
||||
const deleteStatements = deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
const insertStatements = inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
// 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]
|
||||
}));
|
||||
|
||||
if (deleteStatements.length) {
|
||||
const transformedStatementsToDelete = await transformStatements(fetch, deleteStatements);
|
||||
if (transformedStatementsToDelete.length) {
|
||||
await deleteFromAllGraphs(
|
||||
muAuthSudo.updateSudo,
|
||||
transformedStatementsToDelete,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
);
|
||||
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 (insertStatements.length) {
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, insertStatements);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
"INSERT"
|
||||
);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
const { transformStatements, batchedDbUpdate } = require('./util');
|
||||
const { BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES,
|
||||
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,
|
||||
INGEST_GRAPH
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -24,34 +28,58 @@ const endpoint = BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES ? DIRECT_DATABASE_ENDPOINT
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, muAuthSudo, fetch } = lib;
|
||||
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) {
|
||||
originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`)
|
||||
const originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
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
|
||||
dispatch,
|
||||
onFinishInitialIngest
|
||||
};
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION
|
||||
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,
|
||||
async function batchedDbUpdate(
|
||||
muUpdate,
|
||||
graph,
|
||||
triples,
|
||||
extraHeaders,
|
||||
@@ -37,39 +44,6 @@ ${batch}
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteFromAllGraphs(muUpdate,
|
||||
triples,
|
||||
extraHeaders,
|
||||
endpoint,
|
||||
maxAttempts,
|
||||
sleepBetweenBatches = 1000,
|
||||
sleepTimeOnFail = 1000,
|
||||
) {
|
||||
|
||||
for (const triple of triples) {
|
||||
|
||||
console.log(`Deleting a triple from all graphs in triplestore`);
|
||||
|
||||
const deleteCall = async () => {
|
||||
await muUpdate(`
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
}
|
||||
`, extraHeaders, endpoint);
|
||||
};
|
||||
|
||||
await operationWithRetry(deleteCall, 0, maxAttempts, sleepTimeOnFail);
|
||||
console.log(`Sleeping before next query execution: ${sleepBetweenBatches}`);
|
||||
await new Promise(r => setTimeout(r, sleepBetweenBatches));
|
||||
}
|
||||
}
|
||||
|
||||
async function operationWithRetry(callback,
|
||||
attempt,
|
||||
maxAttempts,
|
||||
@@ -110,18 +84,16 @@ function partition(arr, fn) {
|
||||
return { passes, fails };
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send triples to reasoning service for conversion
|
||||
*
|
||||
*/
|
||||
function transformTriples(fetch, triples) {
|
||||
return operationWithRetry(mainConversion(fetch, triples), 0,
|
||||
async function transformTriples(fetch, triples, mapping) {
|
||||
return await operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
|
||||
function mainConversion(fetch, triples) {
|
||||
async function mainConversion(fetch, triples, mapping) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
@@ -131,23 +103,66 @@ function mainConversion(fetch, triples) {
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
return fetch("http://reasoner/reason/dl2op/main", requestOptions)
|
||||
.then(response => response.text());
|
||||
const response = await fetch(`http://reasoner/reason/dl2op/${mapping}`, requestOptions)
|
||||
return await response.text();
|
||||
}
|
||||
|
||||
function transformStatements(fetch, triples) {
|
||||
return transformTriples(fetch, triples.join('\n')).then(
|
||||
graph => {
|
||||
statements = graph.replace(/\n{2,}/g, '').split('\n')
|
||||
console.log(`CONVERSION: FROM ${triples.length} triples to ${statements.length}`)
|
||||
return statements
|
||||
}
|
||||
)
|
||||
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,
|
||||
deleteFromAllGraphs,
|
||||
partition,
|
||||
transformStatements
|
||||
transformStatements,
|
||||
transformLandingZoneGraph,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph
|
||||
};
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE) || 100;
|
||||
const MU_CALL_SCOPE_ID_INITIAL_SYNC = process.env.MU_CALL_SCOPE_ID_INITIAL_SYNC || 'http://redpencil.data.gift/id/concept/muScope/deltas/consumer/initialSync';
|
||||
const BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES = process.env.BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES == 'true' ? true : false;
|
||||
const DIRECT_DATABASE_ENDPOINT = process.env.DIRECT_DATABASE_ENDPOINT || 'http://virtuoso:8890/sparql';
|
||||
const 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);
|
||||
const INGEST_GRAPH = process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/administrative-unit`;
|
||||
|
||||
// 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`;
|
||||
|
||||
if (!process.env.FILE_SYNC_GRAPH)
|
||||
throw `Expected 'FILE_SYNC_GRAPH' to be provided.`;
|
||||
const FILE_SYNC_GRAPH = process.env.FILE_SYNC_GRAPH;
|
||||
// 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,
|
||||
@@ -24,6 +26,8 @@ module.exports = {
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION,
|
||||
INGEST_GRAPH,
|
||||
FILE_SYNC_GRAPH
|
||||
LANDING_ZONE_GRAPH,
|
||||
LANDING_ZONE_DATABASE_ENDPOINT,
|
||||
TARGET_GRAPH
|
||||
};
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
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,9 +1,16 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION
|
||||
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,
|
||||
async function batchedDbUpdate(
|
||||
muUpdate,
|
||||
graph,
|
||||
triples,
|
||||
extraHeaders,
|
||||
@@ -37,39 +44,6 @@ ${batch}
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteFromAllGraphs(muUpdate,
|
||||
triples,
|
||||
extraHeaders,
|
||||
endpoint,
|
||||
maxAttempts,
|
||||
sleepBetweenBatches = 1000,
|
||||
sleepTimeOnFail = 1000,
|
||||
) {
|
||||
|
||||
for (const triple of triples) {
|
||||
|
||||
console.log(`Deleting a triple from all graphs in triplestore`);
|
||||
|
||||
const deleteCall = async () => {
|
||||
await muUpdate(`
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
}
|
||||
`, extraHeaders, endpoint);
|
||||
};
|
||||
|
||||
await operationWithRetry(deleteCall, 0, maxAttempts, sleepTimeOnFail);
|
||||
console.log(`Sleeping before next query execution: ${sleepBetweenBatches}`);
|
||||
await new Promise(r => setTimeout(r, sleepBetweenBatches));
|
||||
}
|
||||
}
|
||||
|
||||
async function operationWithRetry(callback,
|
||||
attempt,
|
||||
maxAttempts,
|
||||
@@ -110,18 +84,16 @@ function partition(arr, fn) {
|
||||
return { passes, fails };
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send triples to reasoning service for conversion
|
||||
*
|
||||
*/
|
||||
function transformTriples(fetch, triples, mapping) {
|
||||
return operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
async function transformTriples(fetch, triples, mapping) {
|
||||
return await operationWithRetry(mainConversion(fetch, triples, mapping), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
|
||||
function mainConversion(fetch, triples, mapping) {
|
||||
async function mainConversion(fetch, triples, mapping) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
@@ -131,24 +103,66 @@ function mainConversion(fetch, triples, mapping) {
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
return fetch(`http://reasoner/reason/dl2op/${mapping}`, requestOptions)
|
||||
.then(response => response.text());
|
||||
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;
|
||||
}
|
||||
|
||||
function transformStatements(fetch, triples, mapping) {
|
||||
return transformTriples(fetch, triples.join('\n'), mapping).then(
|
||||
graph => {
|
||||
statements = graph ? graph.split('\n') : [];
|
||||
console.log(`CONVERSION ${mapping}: 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,
|
||||
deleteFromAllGraphs,
|
||||
partition,
|
||||
transformStatements
|
||||
transformStatements,
|
||||
transformLandingZoneGraph,
|
||||
deleteFromTargetGraph,
|
||||
insertIntoTargetGraph
|
||||
};
|
||||
@@ -1,70 +0,0 @@
|
||||
const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util');
|
||||
const {
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
INGEST_GRAPH
|
||||
} = 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, muAuthSudo, fetch } = lib;
|
||||
const { termObjectChangeSets } = data;
|
||||
|
||||
for (let { deletes, inserts } of termObjectChangeSets) {
|
||||
const deleteStatements = deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
const insertStatements = inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
|
||||
if (deleteStatements.length) {
|
||||
const transformedStatementsToDelete = await transformStatements(fetch, deleteStatements);
|
||||
if (transformedStatementsToDelete.length) {
|
||||
await deleteFromAllGraphs(
|
||||
muAuthSudo.updateSudo,
|
||||
transformedStatementsToDelete,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (insertStatements.length) {
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, insertStatements);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
"INSERT"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,57 +0,0 @@
|
||||
const { transformStatements, batchedDbUpdate } = 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,
|
||||
INGEST_GRAPH
|
||||
} = require('./config');
|
||||
const endpoint = BYPASS_MU_AUTH_FOR_EXPENSIVE_QUERIES ? DIRECT_DATABASE_ENDPOINT : process.env.MU_SPARQL_ENDPOINT;
|
||||
|
||||
/**
|
||||
* Dispatch the fetched information to a target graph.
|
||||
* @param { mu, muAuthSudo } lib - The provided libraries from the host service.
|
||||
* @param { termObjects } data - The fetched quad information, which objects of serialized Terms
|
||||
* [ {
|
||||
* graph: "<http://foo>",
|
||||
* subject: "<http://bar>",
|
||||
* predicate: "<http://baz>",
|
||||
* object: "<http://boom>^^<http://datatype>"
|
||||
* }
|
||||
* ]
|
||||
* @return {void} Nothing
|
||||
*/
|
||||
async function dispatch(lib, data) {
|
||||
const { mu, muAuthSudo, fetch } = lib;
|
||||
const { termObjects } = data;
|
||||
|
||||
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) {
|
||||
originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`)
|
||||
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,153 +0,0 @@
|
||||
const {
|
||||
MAX_REASONING_RETRY_ATTEMPTS,
|
||||
SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION
|
||||
} = 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 deleteFromAllGraphs(muUpdate,
|
||||
triples,
|
||||
extraHeaders,
|
||||
endpoint,
|
||||
maxAttempts,
|
||||
sleepBetweenBatches = 1000,
|
||||
sleepTimeOnFail = 1000,
|
||||
) {
|
||||
|
||||
for (const triple of triples) {
|
||||
|
||||
console.log(`Deleting a triple from all graphs in triplestore`);
|
||||
|
||||
const deleteCall = async () => {
|
||||
await muUpdate(`
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
${triple}
|
||||
}
|
||||
}
|
||||
`, extraHeaders, endpoint);
|
||||
};
|
||||
|
||||
await operationWithRetry(deleteCall, 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
|
||||
*
|
||||
*/
|
||||
function transformTriples(fetch, triples) {
|
||||
return operationWithRetry(mainConversion(fetch, triples), 0,
|
||||
MAX_REASONING_RETRY_ATTEMPTS, SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION);
|
||||
}
|
||||
|
||||
|
||||
function mainConversion(fetch, triples) {
|
||||
let formdata = new URLSearchParams();
|
||||
formdata.append("data", triples);
|
||||
|
||||
let requestOptions = {
|
||||
method: 'POST',
|
||||
body: formdata,
|
||||
redirect: 'follow'
|
||||
};
|
||||
|
||||
return fetch("http://reasoner/reason/dl2op/main", requestOptions)
|
||||
.then(response => response.text());
|
||||
}
|
||||
|
||||
function transformStatements(fetch, triples) {
|
||||
return transformTriples(fetch, triples.join('\n')).then(
|
||||
graph => {
|
||||
statements = graph.replace(/\n{2,}/g, '').split('\n')
|
||||
console.log(`CONVERSION: FROM ${triples.length} triples to ${statements.length}`)
|
||||
return statements
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
batchedDbUpdate,
|
||||
deleteFromAllGraphs,
|
||||
partition,
|
||||
transformStatements
|
||||
};
|
||||
@@ -1,51 +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://virtuoso:8890/sparql";
|
||||
const MAX_DB_RETRY_ATTEMPTS = parseInt(process.env.MAX_DB_RETRY_ATTEMPTS || 5);
|
||||
const MAX_REASONING_RETRY_ATTEMPTS = parseInt(
|
||||
process.env.MAX_REASONING_RETRY_ATTEMPTS || 5
|
||||
);
|
||||
const SLEEP_BETWEEN_BATCHES = parseInt(
|
||||
process.env.SLEEP_BETWEEN_BATCHES || 1000
|
||||
);
|
||||
const SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION = parseInt(
|
||||
process.env.SLEEP_TIME_AFTER_FAILED_REASONING_OPERATION || 10000
|
||||
);
|
||||
const SLEEP_TIME_AFTER_FAILED_DB_OPERATION = parseInt(
|
||||
process.env.SLEEP_TIME_AFTER_FAILED_DB_OPERATION || 60000
|
||||
);
|
||||
const INGEST_GRAPH =
|
||||
process.env.INGEST_GRAPH || `http://mu.semte.ch/graphs/worship-service`;
|
||||
const PRIVACY_SENSITIVE_GRAPH =
|
||||
process.env.PRIVACY_SENSITIVE_GRAPH ||
|
||||
`http://mu.semte.ch/graphs/worship-privacy-centric-graph`;
|
||||
const UNFILTERED_MAPPING = "main";
|
||||
const MAIN_INFO_MAPPING = "main-info";
|
||||
const PRIVATE_INFO_MAPPING = "private-info";
|
||||
|
||||
if (!process.env.FILE_SYNC_GRAPH)
|
||||
throw `Expected 'FILE_SYNC_GRAPH' to be provided.`;
|
||||
const FILE_SYNC_GRAPH = process.env.FILE_SYNC_GRAPH;
|
||||
|
||||
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,
|
||||
INGEST_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
UNFILTERED_MAPPING,
|
||||
MAIN_INFO_MAPPING,
|
||||
PRIVATE_INFO_MAPPING,
|
||||
FILE_SYNC_GRAPH,
|
||||
};
|
||||
@@ -1,88 +0,0 @@
|
||||
const { transformStatements, batchedDbUpdate, deleteFromAllGraphs } = require('./util');
|
||||
const {
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
INGEST_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
UNFILTERED_MAPPING,
|
||||
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, muAuthSudo, fetch } = lib;
|
||||
const { termObjectChangeSets } = data;
|
||||
|
||||
for (let { deletes, inserts } of termObjectChangeSets) {
|
||||
const deleteStatements = deletes.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
const insertStatements = inserts.map(o => `${o.subject} ${o.predicate} ${o.object}.`);
|
||||
|
||||
if (deleteStatements.length) {
|
||||
const transformedStatementsToDelete = await transformStatements(fetch, deleteStatements, UNFILTERED_MAPPING);
|
||||
if (transformedStatementsToDelete.length) {
|
||||
await deleteFromAllGraphs(
|
||||
muAuthSudo.updateSudo,
|
||||
transformedStatementsToDelete,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (insertStatements.length) {
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, insertStatements, MAIN_INFO_MAPPING);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, //Note: this is the default endpoint through auth
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
|
||||
const transformedStatementsToInsertPrivate = await transformStatements(fetch, insertStatements, PRIVATE_INFO_MAPPING);
|
||||
if (transformedStatementsToInsertPrivate.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
transformedStatementsToInsertPrivate,
|
||||
{ 'mu-call-scope-id': 'http://redpencil.data.gift/id/concept/muScope/deltas/write-for-dispatch' },
|
||||
process.env.MU_SPARQL_ENDPOINT, // Note: this is the default endpoint through auth
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
const { transformStatements, batchedDbUpdate, } = 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,
|
||||
INGEST_GRAPH,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
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, fetch } = lib;
|
||||
const { termObjects } = data;
|
||||
|
||||
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) {
|
||||
originalInsertTriples = termObjects.map(o => `${o.subject} ${o.predicate} ${o.object}.`)
|
||||
|
||||
const transformedStatementsToInsert = await transformStatements(fetch, originalInsertTriples, MAIN_INFO_MAPPING);
|
||||
if (transformedStatementsToInsert.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
INGEST_GRAPH,
|
||||
transformedStatementsToInsert,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
|
||||
const transformedStatementsToInsertPrivate = await transformStatements(fetch, originalInsertTriples, PRIVATE_INFO_MAPPING);
|
||||
if (transformedStatementsToInsertPrivate.length) {
|
||||
await batchedDbUpdate(
|
||||
muAuthSudo.updateSudo,
|
||||
PRIVACY_SENSITIVE_GRAPH,
|
||||
transformedStatementsToInsertPrivate,
|
||||
{ 'mu-call-scope-id': MU_CALL_SCOPE_ID_INITIAL_SYNC },
|
||||
endpoint,
|
||||
BATCH_SIZE,
|
||||
MAX_DB_RETRY_ATTEMPTS,
|
||||
SLEEP_BETWEEN_BATCHES,
|
||||
SLEEP_TIME_AFTER_FAILED_DB_OPERATION
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dispatch
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
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
|
||||
};
|
||||
@@ -0,0 +1,204 @@
|
||||
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,46 @@
|
||||
DELETE DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/besturenVanDeEredienst/d640003a744edbe1a0597ab57243ab5e>
|
||||
<http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> .
|
||||
}
|
||||
}
|
||||
;
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/besturenVanDeEredienst/d640003a744edbe1a0597ab57243ab5e>
|
||||
<http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> .
|
||||
|
||||
<http://data.lblod.info/id/eredienstbestuursorganen/18d843d47e223409b9bb6e7af8a4d8a8>
|
||||
a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "18d843d47e223409b9bb6e7af8a4d8a8" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> <http://data.lblod.info/id/eredienstbestuursorganen/520e20dd93d0eb546ee2402f124b499e> ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2020-04-01T00:00:00"^^xsd:dateTime ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingEinde> "2023-03-31T00:00:00"^^xsd:dateTime ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/c6d754b17be9634e629f7d751753bb27> ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/37fc68e584d93a8c165a2b9b5b0f183a> ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/daac7f53-b020-443d-92a7-9d47be6cb186> ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/3618fc2a-83f7-45dd-969f-06afd0c3277b> ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/e4b05858-c66d-4098-9c43-59af0359e603> ;
|
||||
<http://www.w3.org/ns/org#hasPost> <http://data.lblod.info/id/mandaten/5147f880-b0a5-4145-ac01-db8323a5410d> .
|
||||
|
||||
<http://data.lblod.info/id/mandaten/daac7f53-b020-443d-92a7-9d47be6cb186>
|
||||
a <http://data.vlaanderen.be/ns/mandaat#Mandaat> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "daac7f53-b020-443d-92a7-9d47be6cb186" ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/2962f0bd-2836-4758-9866-8ce8ea2c536f> .
|
||||
|
||||
<http://data.lblod.info/id/mandaten/3618fc2a-83f7-45dd-969f-06afd0c3277b>
|
||||
a <http://data.vlaanderen.be/ns/mandaat#Mandaat> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "3618fc2a-83f7-45dd-969f-06afd0c3277b" ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/67e6e585166cd97575b3e17ffc430a43> .
|
||||
|
||||
<http://data.lblod.info/id/mandaten/e4b05858-c66d-4098-9c43-59af0359e603>
|
||||
a <http://data.vlaanderen.be/ns/mandaat#Mandaat> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "e4b05858-c66d-4098-9c43-59af0359e603" ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5ac134b9800b81da3c450d6b9605cef2> .
|
||||
|
||||
<http://data.lblod.info/id/mandaten/5147f880-b0a5-4145-ac01-db8323a5410d>
|
||||
a <http://data.vlaanderen.be/ns/mandaat#Mandaat> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "5147f880-b0a5-4145-ac01-db8323a5410d" ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/180d13930d6f1a3938e0aa7fa9990002> .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
http://mu.semte.ch/graphs/public
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
||||
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
rdf:type <http://mu.semte.ch/vocabularies/ext/BestuurseenheidClassificatieCode> , skos:Concept ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d" ;
|
||||
skos:topConceptOf <https://data.vlaanderen.be/id/conceptscheme/BestuurseenheidClassificatieCode> ;
|
||||
skos:prefLabel "Autonoom provinciebedrijf" ;
|
||||
skos:inScheme <https://data.vlaanderen.be/id/conceptscheme/BestuurseenheidClassificatieCode> ;
|
||||
<http://schema.org/publication> <http://lblod.data.gift/concepts/83f7b480-fcaf-4795-b603-7f3bce489325> .
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
rdf:type <http://mu.semte.ch/vocabularies/ext/BestuurseenheidClassificatieCode> , skos:Concept ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "36a82ba0-7ff1-4697-a9dd-2e94df73b721" ;
|
||||
skos:topConceptOf <https://data.vlaanderen.be/id/conceptscheme/BestuurseenheidClassificatieCode> ;
|
||||
skos:prefLabel "Autonoom gemeentebedrijf" ;
|
||||
skos:inScheme <https://data.vlaanderen.be/id/conceptscheme/BestuurseenheidClassificatieCode> ;
|
||||
<http://schema.org/publication> <http://lblod.data.gift/concepts/83f7b480-fcaf-4795-b603-7f3bce489325> .
|
||||
|
||||
|
||||
<http://lblod.data.gift/concepts/dcc01338-842c-4fbd-ba68-3ca6f3af975c> a <http://lblod.data.gift/vocabularies/organisatie/TypeVestiging>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "dcc01338-842c-4fbd-ba68-3ca6f3af975c";
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> "Correspondentieadres";
|
||||
<http://www.w3.org/2004/02/skos/core#inScheme> <http://lblod.data.gift/concept-schemes/f8319ccf40fc2a1697edc5cf7e03018f>;
|
||||
<http://www.w3.org/2004/02/skos/core#inScheme> <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b>;
|
||||
<http://www.w3.org/2004/02/skos/core#topConceptOf> <http://lblod.data.gift/concept-schemes/f8319ccf40fc2a1697edc5cf7e03018f>.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
http://mu.semte.ch/graphs/public
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
||||
|
||||
<http://lblod.data.gift/concepts/b85363df-b598-4a21-b8ae-0dea78db73cb>
|
||||
rdf:type <http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "b85363df-b598-4a21-b8ae-0dea78db73cb" ;
|
||||
skos:prefLabel "In ontbinding" ;
|
||||
skos:inScheme <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> , <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> ;
|
||||
skos:topConceptOf <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> .
|
||||
|
||||
<http://lblod.data.gift/concepts/e8dc166e-4769-4f28-bcf8-af2fb8cb7d15>
|
||||
rdf:type <http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "e8dc166e-4769-4f28-bcf8-af2fb8cb7d15" ;
|
||||
skos:prefLabel "In vereffening" ;
|
||||
skos:inScheme <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> , <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> ;
|
||||
skos:topConceptOf <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> .
|
||||
|
||||
<http://lblod.data.gift/concepts/b5f471a8-eb2e-4ec3-9f84-2c179134e2be>
|
||||
rdf:type <http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "b5f471a8-eb2e-4ec3-9f84-2c179134e2be" ;
|
||||
skos:prefLabel "Ontbonden en vereffend" ;
|
||||
skos:inScheme <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> , <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> ;
|
||||
skos:topConceptOf <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> .
|
||||
|
||||
|
||||
<http://lblod.data.gift/concepts/f0e2706a-3b64-4464-ad9c-4e65dc976288>
|
||||
rdf:type <http://lblod.data.gift/vocabularies/organisatie/Veranderingsgebeurtenis> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "f0e2706a-3b64-4464-ad9c-4e65dc976288" ;
|
||||
skos:prefLabel "Oprichting" ;
|
||||
skos:inScheme <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> , <http://lblod.data.gift/concept-schemes/10caf4a4-1ff5-4c05-917e-56489910d68b> ;
|
||||
skos:topConceptOf <http://lblod.data.gift/concept-schemes/e1ff33ee76b5662ec8486f0e2abec384> .
|
||||
@@ -0,0 +1,27 @@
|
||||
# AGB AG2B has been added in Loket in the meantime. I'm adapting to Loket's URI
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a7aaef2f-6e8f-4351-9303-bdc4288bc6f0> ?p ?o .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855> ?p ?o .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a7aaef2f-6e8f-4351-9303-bdc4288bc6f0> ?p ?o .
|
||||
}
|
||||
}
|
||||
;
|
||||
DELETE DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855> <http://mu.semte.ch/vocabularies/core/uuid> "a7aaef2f-6e8f-4351-9303-bdc4288bc6f0" .
|
||||
}
|
||||
}
|
||||
;
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855> <http://mu.semte.ch/vocabularies/core/uuid> "e0920e46-85b9-4736-a906-b254cc7f1855" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
# Classification Raad van bestuur
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaanInTime ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> ?orgaan ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00"^^xsd:dateTime .
|
||||
|
||||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaan ;
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> ?orgaanLabel ;
|
||||
<http://www.w3.org/ns/org#classification> ?classificationOrgaan ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuurseenheid .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?classificationBestuurseenheid {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
}
|
||||
|
||||
VALUES ?classificationOrgaan {
|
||||
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/013cc838-173a-4657-b1ae-b00c048df943>
|
||||
}
|
||||
|
||||
VALUES ?bestuurseenheid {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0d71bad-4684-4796-9f76-c3babb972a0f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/cec30867-e378-4e86-9568-1efebb6ccd7d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b206763c-d8d2-45bd-ba1b-b5462bdd823c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56>
|
||||
<http://data.lblod.info/id/bestuurseenheden/2908c8ed-0f67-44c0-b69e-5a8b07238d15>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f4228a39-de89-4a50-925f-d5d8d5109e79>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8d6609b4-1a20-46b8-97ed-150c6d53acd6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b25f4408-0b7c-46d0-a234-0936cac4eb7c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b81fdc5f-d1ba-49f2-831f-ed549ad94394>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3deaa042-58f3-474f-abc2-9cb3e15f4221>
|
||||
<http://data.lblod.info/id/bestuurseenheden/863673c6-7bc9-4bbd-a42a-9ef1d2dc4c05>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99509194-025b-4292-9add-aa98b4867350>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479BE11E20833AEA681F731>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3D65190444E254CA3901>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C4C67190444E254CA390E>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B935E20833AEA681F719>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5c6ab343-3405-475d-a184-d44bbe7e787a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646DCAC8E20833AEA681F608>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3BB7190444E254CA38F4>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2BB5E20833AEA681F62C>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8e448f7f-5a1d-44b0-a99d-274b2cc66f58>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5202c9ba-40fb-44e2-8116-6eceadc1e60a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6478831EE20833AEA681F690>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F25AEE20833AEA681F61A>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2609E20833AEA681F623>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488403F190444E254CA3891>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3B22190444E254CA38EB>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2295E20833AEA681F611>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B670E20833AEA681F702>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488488C190444E254CA38A5>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648841E2190444E254CA389A>
|
||||
}
|
||||
|
||||
?bestuurseenheid a <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;
|
||||
skos:prefLabel ?bestuurseenheidLabel .
|
||||
|
||||
?classificationOrgaan skos:prefLabel ?classificationOrgaanLabel .
|
||||
|
||||
BIND(CONCAT(?bestuurseenheidLabel, " Leidend ambtenaar") as ?functieLabel)
|
||||
BIND(CONCAT(?classificationOrgaanLabel, " ", ?bestuurseenheidLabel) as ?orgaanLabel)
|
||||
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaanInTime")) as ?uuidOrgaanInTime)
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaan")) as ?uuidOrgaan)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaanInTime)) AS ?orgaanInTime)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaan)) AS ?orgaan)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
# Classification Bevoegd beslissingsorgaan
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaanInTime ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> ?orgaan ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00"^^xsd:dateTime .
|
||||
|
||||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaan ;
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> ?orgaanLabel ;
|
||||
<http://www.w3.org/ns/org#classification> ?classificationOrgaan ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuurseenheid .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?classificationBestuurseenheid {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
}
|
||||
|
||||
VALUES ?classificationOrgaan {
|
||||
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/0dbc70ec-6be9-4997-b8e1-11b6c0542382>
|
||||
}
|
||||
|
||||
VALUES ?bestuurseenheid {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0d71bad-4684-4796-9f76-c3babb972a0f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/cec30867-e378-4e86-9568-1efebb6ccd7d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b206763c-d8d2-45bd-ba1b-b5462bdd823c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56>
|
||||
<http://data.lblod.info/id/bestuurseenheden/2908c8ed-0f67-44c0-b69e-5a8b07238d15>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f4228a39-de89-4a50-925f-d5d8d5109e79>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8d6609b4-1a20-46b8-97ed-150c6d53acd6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b25f4408-0b7c-46d0-a234-0936cac4eb7c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b81fdc5f-d1ba-49f2-831f-ed549ad94394>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3deaa042-58f3-474f-abc2-9cb3e15f4221>
|
||||
<http://data.lblod.info/id/bestuurseenheden/863673c6-7bc9-4bbd-a42a-9ef1d2dc4c05>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99509194-025b-4292-9add-aa98b4867350>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479BE11E20833AEA681F731>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3D65190444E254CA3901>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C4C67190444E254CA390E>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B935E20833AEA681F719>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5c6ab343-3405-475d-a184-d44bbe7e787a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646DCAC8E20833AEA681F608>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3BB7190444E254CA38F4>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2BB5E20833AEA681F62C>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8e448f7f-5a1d-44b0-a99d-274b2cc66f58>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5202c9ba-40fb-44e2-8116-6eceadc1e60a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6478831EE20833AEA681F690>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F25AEE20833AEA681F61A>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2609E20833AEA681F623>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488403F190444E254CA3891>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3B22190444E254CA38EB>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2295E20833AEA681F611>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B670E20833AEA681F702>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488488C190444E254CA38A5>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648841E2190444E254CA389A>
|
||||
}
|
||||
|
||||
?bestuurseenheid a <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;
|
||||
skos:prefLabel ?bestuurseenheidLabel .
|
||||
|
||||
?classificationOrgaan skos:prefLabel ?classificationOrgaanLabel .
|
||||
|
||||
BIND(CONCAT(?bestuurseenheidLabel, " Leidend ambtenaar") as ?functieLabel)
|
||||
BIND(CONCAT(?classificationOrgaanLabel, " ", ?bestuurseenheidLabel) as ?orgaanLabel)
|
||||
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaanInTime")) as ?uuidOrgaanInTime)
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaan")) as ?uuidOrgaan)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaanInTime)) AS ?orgaanInTime)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaan)) AS ?orgaan)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
# Classification Algemene vergadering
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaanInTime ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> ?orgaan ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00"^^xsd:dateTime .
|
||||
|
||||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaan ;
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> ?orgaanLabel ;
|
||||
<http://www.w3.org/ns/org#classification> ?classificationOrgaan ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuurseenheid .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?classificationBestuurseenheid {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
}
|
||||
|
||||
VALUES ?classificationOrgaan {
|
||||
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/b52094ff-21a2-4da8-8dbe-f513365d1528>
|
||||
}
|
||||
|
||||
VALUES ?bestuurseenheid {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0d71bad-4684-4796-9f76-c3babb972a0f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/cec30867-e378-4e86-9568-1efebb6ccd7d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b206763c-d8d2-45bd-ba1b-b5462bdd823c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56>
|
||||
<http://data.lblod.info/id/bestuurseenheden/2908c8ed-0f67-44c0-b69e-5a8b07238d15>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f4228a39-de89-4a50-925f-d5d8d5109e79>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8d6609b4-1a20-46b8-97ed-150c6d53acd6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b25f4408-0b7c-46d0-a234-0936cac4eb7c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b81fdc5f-d1ba-49f2-831f-ed549ad94394>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3deaa042-58f3-474f-abc2-9cb3e15f4221>
|
||||
<http://data.lblod.info/id/bestuurseenheden/863673c6-7bc9-4bbd-a42a-9ef1d2dc4c05>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99509194-025b-4292-9add-aa98b4867350>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479BE11E20833AEA681F731>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3D65190444E254CA3901>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C4C67190444E254CA390E>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B935E20833AEA681F719>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5c6ab343-3405-475d-a184-d44bbe7e787a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646DCAC8E20833AEA681F608>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3BB7190444E254CA38F4>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2BB5E20833AEA681F62C>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8e448f7f-5a1d-44b0-a99d-274b2cc66f58>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5202c9ba-40fb-44e2-8116-6eceadc1e60a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6478831EE20833AEA681F690>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F25AEE20833AEA681F61A>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2609E20833AEA681F623>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488403F190444E254CA3891>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3B22190444E254CA38EB>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2295E20833AEA681F611>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B670E20833AEA681F702>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488488C190444E254CA38A5>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648841E2190444E254CA389A>
|
||||
}
|
||||
|
||||
?bestuurseenheid a <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;
|
||||
skos:prefLabel ?bestuurseenheidLabel .
|
||||
|
||||
?classificationOrgaan skos:prefLabel ?classificationOrgaanLabel .
|
||||
|
||||
BIND(CONCAT(?bestuurseenheidLabel, " Leidend ambtenaar") as ?functieLabel)
|
||||
BIND(CONCAT(?classificationOrgaanLabel, " ", ?bestuurseenheidLabel) as ?orgaanLabel)
|
||||
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaanInTime")) as ?uuidOrgaanInTime)
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaan")) as ?uuidOrgaan)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaanInTime)) AS ?orgaanInTime)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaan)) AS ?orgaan)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
# Classification Leidend Ambtenaar
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaanInTime ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> ?orgaan ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00"^^xsd:dateTime .
|
||||
|
||||
?orgaan a <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?uuidOrgaan ;
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> ?orgaanLabel ;
|
||||
<http://www.w3.org/ns/org#classification> ?classificationOrgaan ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuurseenheid .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?classificationBestuurseenheid {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
}
|
||||
|
||||
VALUES ?classificationOrgaan {
|
||||
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/41caf7e6-b040-4720-9cc2-a96cfffed5b4>
|
||||
}
|
||||
|
||||
VALUES ?bestuurseenheid {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0d71bad-4684-4796-9f76-c3babb972a0f>
|
||||
<http://data.lblod.info/id/bestuurseenheden/cec30867-e378-4e86-9568-1efebb6ccd7d>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b206763c-d8d2-45bd-ba1b-b5462bdd823c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56>
|
||||
<http://data.lblod.info/id/bestuurseenheden/2908c8ed-0f67-44c0-b69e-5a8b07238d15>
|
||||
<http://data.lblod.info/id/bestuurseenheden/f4228a39-de89-4a50-925f-d5d8d5109e79>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8d6609b4-1a20-46b8-97ed-150c6d53acd6>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b25f4408-0b7c-46d0-a234-0936cac4eb7c>
|
||||
<http://data.lblod.info/id/bestuurseenheden/b81fdc5f-d1ba-49f2-831f-ed549ad94394>
|
||||
<http://data.lblod.info/id/bestuurseenheden/3deaa042-58f3-474f-abc2-9cb3e15f4221>
|
||||
<http://data.lblod.info/id/bestuurseenheden/863673c6-7bc9-4bbd-a42a-9ef1d2dc4c05>
|
||||
<http://data.lblod.info/id/bestuurseenheden/e0920e46-85b9-4736-a906-b254cc7f1855>
|
||||
<http://data.lblod.info/id/bestuurseenheden/99509194-025b-4292-9add-aa98b4867350>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479BE11E20833AEA681F731>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3D65190444E254CA3901>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C4C67190444E254CA390E>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B935E20833AEA681F719>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5c6ab343-3405-475d-a184-d44bbe7e787a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646DCAC8E20833AEA681F608>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3BB7190444E254CA38F4>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2BB5E20833AEA681F62C>
|
||||
<http://data.lblod.info/id/bestuurseenheden/8e448f7f-5a1d-44b0-a99d-274b2cc66f58>
|
||||
<http://data.lblod.info/id/bestuurseenheden/5202c9ba-40fb-44e2-8116-6eceadc1e60a>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6478831EE20833AEA681F690>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F25AEE20833AEA681F61A>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2609E20833AEA681F623>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488403F190444E254CA3891>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648C3B22190444E254CA38EB>
|
||||
<http://data.lblod.info/id/bestuurseenheden/646F2295E20833AEA681F611>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6479B670E20833AEA681F702>
|
||||
<http://data.lblod.info/id/bestuurseenheden/6488488C190444E254CA38A5>
|
||||
<http://data.lblod.info/id/bestuurseenheden/648841E2190444E254CA389A>
|
||||
}
|
||||
|
||||
?bestuurseenheid a <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> ;
|
||||
skos:prefLabel ?bestuurseenheidLabel .
|
||||
|
||||
?classificationOrgaan skos:prefLabel ?classificationOrgaanLabel .
|
||||
|
||||
BIND(CONCAT(?bestuurseenheidLabel, " Leidend ambtenaar") as ?functieLabel)
|
||||
BIND(CONCAT(?classificationOrgaanLabel, " ", ?bestuurseenheidLabel) as ?orgaanLabel)
|
||||
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaanInTime")) as ?uuidOrgaanInTime)
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?classificationOrgaan, "orgaan")) as ?uuidOrgaan)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaanInTime)) AS ?orgaanInTime)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaan)) AS ?orgaan)
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime <http://data.vlaanderen.be/ns/mandaat#bindingStart> ?start .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?orgaanInTime <http://data.vlaanderen.be/ns/mandaat#bindingStart> ?startDateTime .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
VALUES ?classificationBestuurseenheid {
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>
|
||||
<http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d>
|
||||
}
|
||||
|
||||
?orgaanInTime <https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan>/<http://data.vlaanderen.be/ns/besluit#bestuurt> ?bestuurseenheid ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> ?start .
|
||||
|
||||
?bestuurseenheid <http://www.w3.org/ns/org#classification> ?classificationBestuurseenheid .
|
||||
|
||||
# The hour is arbitrary, but there is a bug in virtuoso when if the time is `T00:00:00` it doesn't apply the type change at all
|
||||
BIND(IF(strlen(str(?start)) = 10, strdt(concat(str(?start), 'T02:00:00'), xsd:dateTime), ?start) as ?startDateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
# We have two bestuursorganen of the same classification for 2 bestuurseenheden.
|
||||
# Then need to be merged, as we should only have one orgaan (not in time) per classification.
|
||||
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?otherBestuursorgaan ?potherBestuursorgaan ?ootherBestuursorgaan .
|
||||
?s ?p ?otherBestuursorgaan .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?s ?p ?bestuursorgaan .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
VALUES ?type {
|
||||
ere:BestuurVanDeEredienst
|
||||
ere:CentraalBestuurVanDeEredienst
|
||||
}
|
||||
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?bestuurseenheid <http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> .
|
||||
}
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid ;
|
||||
<http://www.w3.org/ns/org#classification> ?classif .
|
||||
|
||||
?otherBestuursorgaan besluit:bestuurt ?bestuurseenheid ;
|
||||
<http://www.w3.org/ns/org#classification> ?classif ;
|
||||
?potherBestuursorgaan ?ootherBestuursorgaan .
|
||||
|
||||
?s ?p ?otherBestuursorgaan .
|
||||
|
||||
FILTER (str(?bestuursorgaan) > str(?otherBestuursorgaan))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime a besluit:Bestuursorgaan ;
|
||||
mu:uuid ?uuidOrgaanInTime ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
VALUES ?type {
|
||||
ere:BestuurVanDeEredienst
|
||||
ere:CentraalBestuurVanDeEredienst
|
||||
}
|
||||
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?bestuurseenheid <http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> .
|
||||
}
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?missingOrgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
?missingOrgaanInTime mandaat:bindingStart ?start .
|
||||
FILTER CONTAINS(STR(?start), "2023")
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?missingOrgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
?missingOrgaanInTime mandaat:bindingEinde ?end .
|
||||
FILTER CONTAINS(STR(?end), "2026")
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?bestuurseenheid, ?bestuursorgaan, "2023-2026")) as ?uuidOrgaanInTime)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/bestuursorganen/", ?uuidOrgaanInTime)) AS ?orgaanInTime)
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
# Add missing mandates to central worship services
|
||||
|
||||
## 2023 - 2026
|
||||
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?expert .
|
||||
|
||||
?expert a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidExpert ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/8c91c321ad477c4fc372ee36358d3ed4> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:CentraalBestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?expert .
|
||||
?expert org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/8c91c321ad477c4fc372ee36358d3ed4> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Expert 2023-2026")) as ?uuidExpert)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidExpert)) AS ?expert)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?vertegenwoordiger .
|
||||
|
||||
?vertegenwoordiger a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidVertegenwoordiger ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/6e26e94ea4b127eeb850fb6debe07271> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:CentraalBestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?vertegenwoordiger .
|
||||
?vertegenwoordiger org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/6e26e94ea4b127eeb850fb6debe07271> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Vertegenwoordiger 2023-2026")) as ?uuidVertegenwoordiger)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidVertegenwoordiger)) AS ?vertegenwoordiger)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?secretaris .
|
||||
|
||||
?secretaris a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidSecretaris ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/e2af0ea1a6af96cfb698ac39ad985eea> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:CentraalBestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?secretaris .
|
||||
?secretaris org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/e2af0ea1a6af96cfb698ac39ad985eea> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Secretaris 2023-2026")) as ?uuidSecretaris)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidSecretaris)) AS ?secretaris)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?voorzitter .
|
||||
|
||||
?voorzitter a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidVoorzitter ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5960262f753661cf84329f3afa9f7df7> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:CentraalBestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?voorzitter .
|
||||
?voorzitter org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5960262f753661cf84329f3afa9f7df7> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Voorzitter 2023-2026")) as ?uuidVoorzitter)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidVoorzitter)) AS ?voorzitter)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?bestuurslid .
|
||||
|
||||
?bestuurslid a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidBestuurslid ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/f848fa3cc2c5fb7c581a116866293925> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:CentraalBestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?worshipService <http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> .
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?bestuurslid .
|
||||
?bestuurslid org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/f848fa3cc2c5fb7c581a116866293925> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Bestuurslid 2023-2026")) as ?uuidBestuurslid)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidBestuurslid)) AS ?bestuurslid)
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
# Add missing mandates to worship services for period 2023-2026
|
||||
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
## Case LidVanRechtswege : shared mandate for all the organen in time
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?lidVanRechtswege .
|
||||
|
||||
?lidVanRechtswege a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidLidVanRechtswege ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5972fccd87f864c4ec06bfbd20b5008b> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
VALUES (?start ?end) {
|
||||
("2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
|
||||
}
|
||||
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart ?start ;
|
||||
mandaat:bindingEinde ?end .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?lidVanRechtswege .
|
||||
?lidVanRechtswege org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5972fccd87f864c4ec06bfbd20b5008b> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Rechtswege")) as ?uuidLidVanRechtswege)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidLidVanRechtswege)) AS ?lidVanRechtswege)
|
||||
}
|
||||
|
||||
## Case Bestuursleden, small or big half : 2023 is the beggining of a KH
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?bestuurslidGH .
|
||||
|
||||
?bestuurslidGH a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidBestuurslidGH ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/a8b5509b-f86b-48f8-94d6-fe463a9b77e3> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?bestuurslidGH .
|
||||
?bestuurslidGH org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/a8b5509b-f86b-48f8-94d6-fe463a9b77e3> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "BestuurslidGH 2020-2026")) as ?uuidBestuurslidGH)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidBestuurslidGH)) AS ?bestuurslidGH)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?bestuurslidKH .
|
||||
|
||||
?bestuurslidKH a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidBestuurslidKH ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/2962f0bd-2836-4758-9866-8ce8ea2c536f> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
VALUES (?start ?end) {
|
||||
("2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
|
||||
}
|
||||
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart ?start ;
|
||||
mandaat:bindingEinde ?end .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?bestuurslidKH .
|
||||
?bestuurslidKH org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/2962f0bd-2836-4758-9866-8ce8ea2c536f> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "BestuurslidKH 2023-2029")) as ?uuidBestuurslidKH)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidBestuurslidKH)) AS ?bestuurslidKH)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
## Other cases are simpler, one mandate is linked to only one orgaan in time. Creating them when missing.
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?voorzitter .
|
||||
|
||||
?voorzitter a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidVoorzitter ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/67e6e585166cd97575b3e17ffc430a43> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?voorzitter .
|
||||
?voorzitter org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/67e6e585166cd97575b3e17ffc430a43> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Voorzitter 2023-2026")) as ?uuidVoorzitter)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidVoorzitter)) AS ?voorzitter)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?secretaris .
|
||||
|
||||
?secretaris a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidSecretaris ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5ac134b9800b81da3c450d6b9605cef2> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?secretaris .
|
||||
?secretaris org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/5ac134b9800b81da3c450d6b9605cef2> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Secretaris 2023-2026")) as ?uuidSecretaris)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidSecretaris)) AS ?secretaris)
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?orgaanInTime org:hasPost ?penningmeester .
|
||||
|
||||
?penningmeester a mandaat:Mandaat ;
|
||||
mu:uuid ?uuidPenningmeester ;
|
||||
org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/180d13930d6f1a3938e0aa7fa9990002> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipService a ere:BestuurVanDeEredienst .
|
||||
?orgaan besluit:bestuurt ?worshipService .
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?orgaan ;
|
||||
mandaat:bindingStart "2023-04-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ;
|
||||
mandaat:bindingEinde "2026-03-31T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
?orgaanInTime org:hasPost ?penningmeester .
|
||||
?penningmeester org:role <http://data.vlaanderen.be/id/concept/BestuursfunctieCode/180d13930d6f1a3938e0aa7fa9990002> .
|
||||
}
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?worshipService, ?orgaan, "Penningmeester 2023-2026")) as ?uuidPenningmeester)
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/mandaten/", ?uuidPenningmeester)) AS ?penningmeester)
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?person
|
||||
?p ?o
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?person a person:Person ;
|
||||
?p ?o.
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
VALUES ?typePosition {
|
||||
<http://data.lblod.info/vocabularies/leidinggevenden/Functionaris>
|
||||
<http://data.vlaanderen.be/ns/mandaat#Mandataris>
|
||||
}
|
||||
|
||||
?position mandaat:isBestuurlijkeAliasVan ?person ;
|
||||
a ?typePosition .
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?worshipPosition <http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan> ?person .
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?functionaris ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?functionaris a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris> ;
|
||||
org:holds ?bestuursFunctie ;
|
||||
?p ?o .
|
||||
}
|
||||
|
||||
?bestuursorgaanInTime lblodlg:heeftBestuursfunctie ?bestuursFunctie ;
|
||||
generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
VALUES ?typeBestuur {
|
||||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst>
|
||||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst>
|
||||
}
|
||||
?bestuurseenheid a ?typeBestuur .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
org:holds ?mandaat ;
|
||||
?p ?o .
|
||||
}
|
||||
|
||||
?bestuursorgaanInTime org:hasPost ?mandaat ;
|
||||
generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
VALUES ?typeBestuur {
|
||||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst>
|
||||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst>
|
||||
}
|
||||
?bestuurseenheid a ?typeBestuur .
|
||||
}
|
||||
}
|
||||
LIMIT 1000000
|
||||
@@ -0,0 +1,53 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
org:holds ?mandaat ;
|
||||
?p ?o .
|
||||
}
|
||||
|
||||
?bestuursorgaanInTime org:hasPost ?mandaat ;
|
||||
generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
VALUES ?typeBestuur {
|
||||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst>
|
||||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst>
|
||||
}
|
||||
?bestuurseenheid a ?typeBestuur .
|
||||
}
|
||||
}
|
||||
LIMIT 1000000
|
||||
@@ -0,0 +1,52 @@
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?mandataris a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
org:holds ?mandaat ;
|
||||
?p ?o .
|
||||
}
|
||||
|
||||
?bestuursorgaanInTime org:hasPost ?mandaat ;
|
||||
generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
VALUES ?typeBestuur {
|
||||
<http://data.lblod.info/vocabularies/erediensten/BestuurVanDeEredienst>
|
||||
<http://data.lblod.info/vocabularies/erediensten/CentraalBestuurVanDeEredienst>
|
||||
}
|
||||
?bestuurseenheid a ?typeBestuur .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?minister ?p ?o .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?minister a ere:RolBedienaar ;
|
||||
org:holds ?ministerPosition ;
|
||||
?p ?o .
|
||||
|
||||
VALUES ?status {
|
||||
<http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> # Actief
|
||||
<http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> # Niet Actief
|
||||
}
|
||||
|
||||
?worshipService <http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor> ?ministerPosition ;
|
||||
<http://www.w3.org/ns/regorg#orgStatus> ?status .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
delete {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?position <http://data.lblod.info/vocabularies/erediensten/functie> ?function.
|
||||
}
|
||||
}
|
||||
|
||||
insert {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?position <http://data.lblod.info/vocabularies/erediensten/functie> <http://lblod.data.gift/concepts/7d8e0c15-7726-4196-9416-6dc40ed858bb>.
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?position <http://data.lblod.info/vocabularies/erediensten/functie> ?function.
|
||||
?worshipService <http://data.lblod.info/vocabularies/erediensten/wordtBediendDoor> ?position;
|
||||
<http://www.w3.org/ns/regorg#orgStatus> ?worshipStatus.
|
||||
|
||||
filter (?function in (<http://lblod.data.gift/concepts/5ebb798bd59c3b48c25116032caa02b7>,
|
||||
<http://lblod.data.gift/concepts/c4a3fd586211b17b06f574885e23f355>,
|
||||
<http://lblod.data.gift/concepts/e357bc8f4cc3a694fde2239748768a22>)
|
||||
&& ?worshipStatus = <http://lblod.data.gift/concepts/abf4fee82019f88cf122f986830621ab>)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://www.w3.org/ns/org#Post> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandaat> .
|
||||
}
|
||||
}
|
||||
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?s a <http://www.w3.org/ns/org#Post> .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandaat> .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
delete {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/642E815DE025A7C706F41E5D> <http://purl.org/dc/terms/date> "2023-03-30"^^xsd:date .
|
||||
}
|
||||
}
|
||||
insert {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/642E815DE025A7C706F41E5D> <http://purl.org/dc/terms/date> "2023-04-06"^^xsd:date .
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/642E815DE025A7C706F41E5D> <http://purl.org/dc/terms/date> "2023-03-30"^^xsd:date .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
DELETE DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuursorganen/ad933a3247ab634eb1a8c7233e77d6ea8cd2b6e1950d302832d065dcb516bcf5> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Voeren" .
|
||||
<http://data.lblod.info/id/bestuursorganen/082976d57de0655ac4f123b57d5cb008f612956d0a6de1742c02913dcbfcf125> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Drogenbos" .
|
||||
<http://data.lblod.info/id/bestuursorganen/cc803c53b2e0b17aac1069f5566fb8e1c8dad2f702845515a662229721803c00> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Wezembeek-Oppem" .
|
||||
<http://data.lblod.info/id/bestuursorganen/f373ece36dc05b29737c0adc14de95682161bb78a55cb85f786fac3fbd5b1cfc> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Sint-Genesius-Rode" .
|
||||
<http://data.lblod.info/id/bestuursorganen/317126204426dc7cabb60ecb09cbe4ca4830882652884e1e5800e60231195f5c> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Linkebeek" .
|
||||
<http://data.lblod.info/id/bestuursorganen/db8c3e2da85d7621120a986adc19fd8d21f501b39c01952238073abfe7d4a7e7> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Wemmel" .
|
||||
<http://data.lblod.info/id/bestuursorganen/d7fffe5c17d1936d46b92620d1e454f38393736988514b5f339910a17c7134f0> <http://www.w3.org/2004/02/skos/core#prefLabel> "OCMWraad(Rechtstreeksverkiezing) Kraainem" .
|
||||
}
|
||||
}
|
||||
;
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuursorganen/f373ece36dc05b29737c0adc14de95682161bb78a55cb85f786fac3fbd5b1cfc> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Sint-Genesius-Rode" .
|
||||
<http://data.lblod.info/id/bestuursorganen/317126204426dc7cabb60ecb09cbe4ca4830882652884e1e5800e60231195f5c> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Linkebeek" .
|
||||
<http://data.lblod.info/id/bestuursorganen/cc803c53b2e0b17aac1069f5566fb8e1c8dad2f702845515a662229721803c00> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Wezembeek-Oppem" .
|
||||
<http://data.lblod.info/id/bestuursorganen/ad933a3247ab634eb1a8c7233e77d6ea8cd2b6e1950d302832d065dcb516bcf5> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Voeren" .
|
||||
<http://data.lblod.info/id/bestuursorganen/082976d57de0655ac4f123b57d5cb008f612956d0a6de1742c02913dcbfcf125> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Drogenbos" .
|
||||
<http://data.lblod.info/id/bestuursorganen/d7fffe5c17d1936d46b92620d1e454f38393736988514b5f339910a17c7134f0> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Kraainem" .
|
||||
<http://data.lblod.info/id/bestuursorganen/db8c3e2da85d7621120a986adc19fd8d21f501b39c01952238073abfe7d4a7e7> <http://www.w3.org/2004/02/skos/core#prefLabel> "Raad voor Maatschappelijk Welzijn Wemmel" .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
delete {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/644616FDF08BCC5A4747B5A2> <http://purl.org/dc/terms/date> ?date.
|
||||
}
|
||||
}
|
||||
insert {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/644616FDF08BCC5A4747B5A2> <http://purl.org/dc/terms/date> "2022-04-22".
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/644616FDF08BCC5A4747B5A2> <http://purl.org/dc/terms/date> ?date.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingEinde ?end .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingEinde ?endDateTime .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
GRAPH ?g {
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?orgaanInTime mandaat:bindingEinde ?end .
|
||||
FILTER (datatype(?end) = xsd:date)
|
||||
BIND(strdt(concat(str(?end), 'T01:00:00'), xsd:dateTime) as ?endDateTime)
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingStart ?start .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingStart ?startDateTime .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
GRAPH ?g {
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?orgaanInTime mandaat:bindingStart ?start .
|
||||
FILTER (datatype(?start) = xsd:date)
|
||||
BIND(strdt(concat(str(?start), 'T01:00:00'), xsd:dateTime) as ?startDateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingEinde ?end .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingEinde ?endDateTime .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
GRAPH ?g {
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?orgaanInTime mandaat:bindingEinde ?end .
|
||||
|
||||
FILTER (HOURS(?end) = 1)
|
||||
BIND(strdt(concat(xsd:date(?end), 'T00:00:00'), xsd:dateTime) as ?endDateTime)
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingStart ?start .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?orgaanInTime mandaat:bindingStart ?startDateTime .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
GRAPH ?g {
|
||||
?bestuurseenheid a ?type .
|
||||
|
||||
?bestuursorgaan besluit:bestuurt ?bestuurseenheid .
|
||||
|
||||
?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan .
|
||||
|
||||
?orgaanInTime mandaat:bindingStart ?start .
|
||||
|
||||
FILTER (HOURS(?start) = 1)
|
||||
BIND(strdt(concat(xsd:date(?start), 'T00:00:00'), xsd:dateTime) as ?startDateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s ?p ?o .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Fractie> ;
|
||||
?p ?o .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?org a org:Organization .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/shared>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
}
|
||||
GRAPH ?g {
|
||||
VALUES ?type {
|
||||
besluit:Bestuurseenheid
|
||||
ere:RepresentatiefOrgaan
|
||||
ere:EredienstBestuurseenheid
|
||||
ere:BestuurVanDeEredienst
|
||||
ere:CentraalBestuurVanDeEredienst
|
||||
}
|
||||
?org a ?type .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX concepts: <http://lblod.data.gift/concepts/>
|
||||
PREFIX bestuur: <http://data.lblod.info/id/besturenVanDeEredienst/>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX contacthub: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
PREFIX ce: <http://data.lblod.info/id/veranderingsgebeurtenissen/>
|
||||
PREFIX cer: <http://data.lblod.info/id/veranderingsgebeurtenis-resultaten/>
|
||||
PREFIX m8g: <http://data.europa.eu/m8g/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
|
||||
DELETE {
|
||||
graph <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?decision ?decisionP ?decisionO.
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?decision ?decisionP ?decisionO.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?changeEvent a <http://www.w3.org/ns/org#ChangeEvent>;
|
||||
<http://data.europa.eu/m8g/hasFormalFramework> ?decision.
|
||||
}
|
||||
graph <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?decision ?decisionP ?decisionO.
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
DELETE {
|
||||
graph <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?decisionActivity ?p ?o.
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?decisionActivity ?p ?o.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
graph <http://mu.semte.ch/graphs/worship-service> {
|
||||
?decision a <http://data.vlaanderen.be/ns/besluit#Besluit>.
|
||||
}
|
||||
graph <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?decisionActivity a <https://data.vlaanderen.be/ns/besluitvorming#Beslissingsactiviteit>;
|
||||
<http://www.w3.org/ns/prov#generated> ?decision;
|
||||
?p ?o.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
PREFIX dct: <http://purl.org/dc/terms/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX concepts: <http://lblod.data.gift/concepts/>
|
||||
PREFIX bestuur: <http://data.lblod.info/id/besturenVanDeEredienst/>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX contacthub: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
PREFIX ce: <http://data.lblod.info/id/veranderingsgebeurtenissen/>
|
||||
PREFIX cer: <http://data.lblod.info/id/veranderingsgebeurtenis-resultaten/>
|
||||
PREFIX m8g: <http://data.europa.eu/m8g/>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
|
||||
|
||||
DELETE {
|
||||
graph ?g {
|
||||
?changeEvent ?p ?o.
|
||||
?changeEventResult ?cP ?cO.
|
||||
?decision ?decisionP ?decisionO.
|
||||
?decisionActivity ?decisionActivityP ?desitionActivityO.
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
graph ?g {
|
||||
?changeEvent a <http://www.w3.org/ns/org#ChangeEvent>;
|
||||
<http://lblod.data.gift/vocabularies/organisatie/veranderingsgebeurtenisResultaat> ?changeEventResult;
|
||||
mu:uuid ?uuidChangeEvent;
|
||||
?p ?o.
|
||||
?changeEventResult a <http://lblod.data.gift/vocabularies/organisatie/VeranderingsgebeurtenisResultaat>;
|
||||
mu:uuid ?uuidChangeEventResult;
|
||||
?cP ?cO.
|
||||
|
||||
optional {
|
||||
?changeEvent <http://data.europa.eu/m8g/hasFormalFramework> ?decision.
|
||||
?decision ?decisionP ?decisionO.
|
||||
optional {
|
||||
?decisionActivity a <https://data.vlaanderen.be/ns/besluitvorming#Beslissingsactiviteit>;
|
||||
<http://www.w3.org/ns/prov#generated> ?decision;
|
||||
?decisionActivityP ?desitionActivityO.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
filter(?uuidChangeEvent in ("63343865036B579F0A26FF5C", "63343E99036B579F0A26FF6F", "633446D6036B579F0A26FF87","63345772036B579F0A26FF93"))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
delete {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/620E674C5747C883CA1D2EE4> <http://data.lblod.info/vocabularies/contacthub/typeWijziging> <http://lblod.data.gift/concepts/9f19f14910245f9b14737f1f1a2067f2>.
|
||||
}
|
||||
}
|
||||
insert {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/620E674C5747C883CA1D2EE4> <http://data.lblod.info/vocabularies/contacthub/typeWijziging> <http://lblod.data.gift/concepts/4297bc56c1a874240e4566e2c5b8816f>.
|
||||
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/620E674C5747C883CA1D2EE4> <http://data.lblod.info/vocabularies/contacthub/typeWijziging> <http://lblod.data.gift/concepts/9f19f14910245f9b14737f1f1a2067f2>.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?functionaris ?pfunctionaris ?ofunctionaris .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?functionaris a <http://data.lblod.info/vocabularies/leidinggevenden/Functionaris> ;
|
||||
<http://www.w3.org/ns/org#holds> ?bestuursfunctie ;
|
||||
?pfunctionaris ?ofunctionaris .
|
||||
}
|
||||
|
||||
?orgaan <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie> ?bestuursfunctie ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#isTijdspecialisatieVan>/<http://data.vlaanderen.be/ns/besluit#bestuurt>/<http://data.vlaanderen.be/ns/besluit#classificatie> ?classification .
|
||||
|
||||
FILTER(?classification NOT 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>
|
||||
))
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
delete {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/6380DDD34B5FEAF28DEDE982> <http://data.lblod.info/vocabularies/contacthub/typeWijziging>
|
||||
<http://lblod.data.gift/concepts/3dd7550843eaf18e1fa1ca6c6c3f2610>.
|
||||
}
|
||||
}
|
||||
insert {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/6380DDD34B5FEAF28DEDE982> <http://data.lblod.info/vocabularies/contacthub/typeWijziging>
|
||||
<http://lblod.data.gift/concepts/9f19f14910245f9b14737f1f1a2067f2>.
|
||||
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/veranderingsgebeurtenissen/6380DDD34B5FEAF28DEDE982> <http://data.lblod.info/vocabularies/contacthub/typeWijziging>
|
||||
<http://lblod.data.gift/concepts/3dd7550843eaf18e1fa1ca6c6c3f2610>.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
DELETE {
|
||||
graph <http://mu.semte.ch/graphs/public> {
|
||||
<http://lblod.data.gift/concepts/dcc01338-842c-4fbd-ba68-3ca6f3af975c> <http://www.w3.org/2004/02/skos/core#prefLabel> "Correspondentieadres".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
graph <http://mu.semte.ch/graphs/public> {
|
||||
<http://lblod.data.gift/concepts/dcc01338-842c-4fbd-ba68-3ca6f3af975c> <http://www.w3.org/2004/02/skos/core#prefLabel> "Andere vestiging".
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
graph <http://mu.semte.ch/graphs/public> {
|
||||
<http://lblod.data.gift/concepts/dcc01338-842c-4fbd-ba68-3ca6f3af975c> <http://www.w3.org/2004/02/skos/core#prefLabel> "Correspondentieadres".
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
|
||||
delete where {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/f8979469220360bbfecaf66afe1b94ae> ?p ?o.
|
||||
}
|
||||
}
|
||||
;
|
||||
delete {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/1de71abc7b02a6702960b403bf724ff8> <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> ?percentage.
|
||||
}
|
||||
}
|
||||
insert {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/1de71abc7b02a6702960b403bf724ff8> <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> 100.
|
||||
}
|
||||
}
|
||||
where {
|
||||
graph ?g {
|
||||
<http://data.lblod.info/id/betrokkenLokaleBesturen/1de71abc7b02a6702960b403bf724ff8> <http://data.lblod.info/vocabularies/erediensten/financieringspercentage> ?percentage.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX lblodlg: <https://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address
|
||||
locn:fullAddress
|
||||
?full_address.
|
||||
}
|
||||
}
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?address
|
||||
locn:fullAddress
|
||||
?fixed_full_address.
|
||||
}
|
||||
}
|
||||
|
||||
WHERE {
|
||||
GRAPH ?g {
|
||||
?address
|
||||
locn:thoroughfare
|
||||
?street;
|
||||
adres:Adresvoorstelling.huisnummer
|
||||
?streetNumber;
|
||||
adres:Adresvoorstelling.busnummer
|
||||
?busNumber;
|
||||
adres:gemeentenaam
|
||||
?gemeente;
|
||||
locn:postCode
|
||||
?postalCode;
|
||||
locn:fullAddress
|
||||
?full_address.
|
||||
FILTER (strlen(?busNumber) > 0 )
|
||||
FILTER (CONTAINS(?full_address, CONCAT(?streetNumber, ?busNumber)))
|
||||
FILTER (STRSTARTS(?full_address, CONCAT(?street, ' ',?streetNumber, ?busNumber, ', ', ?postalCode, ' ', ?gemeente)))
|
||||
BIND (CONCAT(?street, ' ',?streetNumber, ' ' , ?busNumber, ', ', ?postalCode, ' ', ?gemeente, ", België") as ?fixed_full_address)
|
||||
}
|
||||
}
|
||||
1
config/migrations/2023/20230622140000-moslimraad.graph
Normal file
1
config/migrations/2023/20230622140000-moslimraad.graph
Normal file
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/worship-service
|
||||
33
config/migrations/2023/20230622140000-moslimraad.ttl
Normal file
33
config/migrations/2023/20230622140000-moslimraad.ttl
Normal file
@@ -0,0 +1,33 @@
|
||||
<http://data.lblod.info/id/representatieveOrganen/3b150a479c9e456a94b76c6a59a2f674>
|
||||
a <http://data.lblod.info/vocabularies/erediensten/RepresentatiefOrgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "3b150a479c9e456a94b76c6a59a2f674";
|
||||
<http://www.w3.org/2004/02/skos/core#prefLabel> "Moslimraad van België";
|
||||
<http://data.lblod.info/vocabularies/erediensten/typeEredienst> <http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> ; # Islamitish
|
||||
<http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> ; # Actief
|
||||
<http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/d116df8f3e1d48fbb846131cc48186b7> ;
|
||||
<http://www.w3.org/ns/org#hasPrimarySite> <http://data.lblod.info/id/vestigingen/1a3cc52f51924d25ad7a2c6f0d4d342b> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/d116df8f3e1d48fbb846131cc48186b7>
|
||||
a <http://www.w3.org/ns/adms#Identifier> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "d116df8f3e1d48fbb846131cc48186b7" ;
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "KBO nummer" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/be28d9316bfb4038bf557c0ec9a45ac1> .
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/be28d9316bfb4038bf557c0ec9a45ac1>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "be28d9316bfb4038bf557c0ec9a45ac1" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "0802469122".
|
||||
|
||||
<http://data.lblod.info/id/vestigingen/1a3cc52f51924d25ad7a2c6f0d4d342b>
|
||||
a <http://www.w3.org/ns/org#Site> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "1a3cc52f51924d25ad7a2c6f0d4d342b" ;
|
||||
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> <http://data.lblod.info/id/adressen/29ced73adcc4479b8e96dd20fd2bdc43> .
|
||||
|
||||
<http://data.lblod.info/id/adressen/29ced73adcc4479b8e96dd20fd2bdc43>
|
||||
a <http://www.w3.org/ns/locn#Address> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "29ced73adcc4479b8e96dd20fd2bdc43" ;
|
||||
<http://www.w3.org/ns/locn#thoroughfare> "Wetstraat" ;
|
||||
<https://data.vlaanderen.be/ns/adres#Adresvoorstelling.huisnummer> "23" ;
|
||||
<http://www.w3.org/ns/locn#postCode> "1040" ;
|
||||
<https://data.vlaanderen.be/ns/adres#gemeentenaam> "Brussel" ;
|
||||
<http://www.w3.org/ns/locn#adminUnitL2> "Vlaams-Brabant" .
|
||||
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/worship-service
|
||||
@@ -0,0 +1,2 @@
|
||||
<http://data.lblod.info/id/adressen/29ced73adcc4479b8e96dd20fd2bdc43>
|
||||
<http://www.w3.org/ns/locn#fullAddress> "Wetstraat 23, 1040 Brussel, België".
|
||||
@@ -0,0 +1,51 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX lblodlg: <https://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
<http://data.lblod.info/id/adressen/15f057e425c2823809b079afe1ff82c4> adres:land "Frankrijk" .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
<http://data.lblod.info/id/adressen/15f057e425c2823809b079afe1ff82c4> ?p ?o.
|
||||
}
|
||||
};
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?address adres:land "België" .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address
|
||||
a locn:Address .
|
||||
FILTER NOT EXISTS {
|
||||
?address
|
||||
adres:land ?land .
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX locn: <http://www.w3.org/ns/locn#>
|
||||
PREFIX schema: <http://schema.org/>
|
||||
PREFIX regorg: <http://www.w3.org/ns/regorg#>
|
||||
PREFIX person: <http://www.w3.org/ns/person#>
|
||||
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
|
||||
PREFIX dbpedia: <http://dbpedia.org/ontology/>
|
||||
PREFIX adms: <http://www.w3.org/ns/adms#>
|
||||
PREFIX euro: <http://data.europa.eu/m8g/>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX organisatie: <https://data.vlaanderen.be/ns/organisatie#>
|
||||
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
||||
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX lblodlg: <https://data.lblod.info/vocabularies/leidinggevenden/>
|
||||
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX euvoc: <http://publications.europa.eu/ontology/euvoc#>
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
||||
PREFIX code: <http://lblod.data.gift/vocabularies/organisatie/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress .
|
||||
}
|
||||
};
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?address locn:fullAddress ?fullAddress .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?address
|
||||
a locn:Address;
|
||||
locn:thoroughfare ?straatnaam;
|
||||
adres:Adresvoorstelling.huisnummer ?huisnummer;
|
||||
locn:postCode ?postcode;
|
||||
adres:gemeentenaam ?gemeentenaam;
|
||||
adres:land ?land .
|
||||
|
||||
OPTIONAL {
|
||||
?address adres:Adresvoorstelling.busnummer ?busnummer .
|
||||
}
|
||||
|
||||
BIND(IF(BOUND(?busnummer), CONCAT(?straatnaam, " ", ?huisnummer, " ", ?busnummer, ", ", ?postcode, " ", ?gemeentenaam, ", ", ?land), CONCAT(?straatnaam, " ", ?huisnummer, ", ", ?postcode, " ", ?gemeentenaam, ", ", ?land)) AS ?fullAddress)
|
||||
}
|
||||
};
|
||||
|
||||
1
config/migrations/2023/20230628133125-agb-apb.graph
Normal file
1
config/migrations/2023/20230628133125-agb-apb.graph
Normal file
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/administrative-unit
|
||||
13412
config/migrations/2023/20230628133125-agb-apb.ttl
Normal file
13412
config/migrations/2023/20230628133125-agb-apb.ttl
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
DELETE DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/representatieveOrganen/e224c637ba8bb0e5dfbb87da225b4652> <http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> .
|
||||
}
|
||||
}
|
||||
;
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
<http://data.lblod.info/id/representatieveOrganen/e224c637ba8bb0e5dfbb87da225b4652> <http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311> .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
<http://data.vlaanderen.be/id/concept/BestuursfunctieCode/855489b9-b584-4f34-90b2-39aea808cd9f> ext:appliesTo <http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/41caf7e6-b040-4720-9cc2-a96cfffed5b4> . # Leidend ambtenaar
|
||||
|
||||
<http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/41caf7e6-b040-4720-9cc2-a96cfffed5b4> ext:appliesWithin <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721> , <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/80310756-ce0a-4a1b-9b8e-7c01b6cc7a2d> .
|
||||
}
|
||||
}
|
||||
51
config/migrations/2023/20230718163900-add-agb-brugge.ttl
Normal file
51
config/migrations/2023/20230718163900-add-agb-brugge.ttl
Normal file
@@ -0,0 +1,51 @@
|
||||
@prefix org: <http://www.w3.org/ns/org#>.
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix mu: <http://mu.semte.ch/vocabularies/core/> .
|
||||
@prefix persoon: <https://data.vlaanderen.be/ns/persoon#> .
|
||||
@prefix ext: <http://mu.semte.ch/vocabularies/ext/>.
|
||||
@prefix person: <http://www.w3.org/ns/person#>.
|
||||
@prefix session: <http://mu.semte.ch/vocabularies/session/>.
|
||||
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
|
||||
@prefix besluit: <http://data.vlaanderen.be/ns/besluit#>.
|
||||
@prefix ere: <http://data.lblod.info/vocabularies/erediensten/>.
|
||||
@prefix mandaat: <http://data.vlaanderen.be/ns/mandaat#>.
|
||||
@prefix dcterms: <http://purl.org/dc/terms/>.
|
||||
@prefix generiek: <https://data.vlaanderen.be/ns/generiek#>.
|
||||
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/2aa74846-a99d-423b-8c9e-b2a344b39f2a> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
mu:uuid "2aa74846-a99d-423b-8c9e-b2a344b39f2a";
|
||||
skos:notation "SharePoint identificator";
|
||||
generiek:gestructureerdeIdentificator <http://data.lblod.info/id/gestructureerdeIdentificatoren/0edd4e8e-44b6-4e86-8717-cda144f91ebb>.
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/0edd4e8e-44b6-4e86-8717-cda144f91ebb> a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
mu:uuid "0edd4e8e-44b6-4e86-8717-cda144f91ebb";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "666".
|
||||
|
||||
|
||||
<http://data.lblod.info/id/vestigingen/29faec77-652a-4d8e-afbb-635b141b13f0> a <http://www.w3.org/ns/org#Site>;
|
||||
mu:uuid "29faec77-652a-4d8e-afbb-635b141b13f0";
|
||||
<http://data.lblod.info/vocabularies/erediensten/vestigingstype> <http://lblod.data.gift/concepts/f1381723dec42c0b6ba6492e41d6f5dd>;
|
||||
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> <http://data.lblod.info/id/adressen/2d6c327a-cf81-43a6-8536-17602781fb2f>;
|
||||
org:siteAddress <http://data.lblod.info/id/contact-punten/bc66afca-f8cf-4e4d-b038-500906e9ffa9>,
|
||||
<http://data.lblod.info/id/contact-punten/1d1da2b5-8f38-41b6-a81d-5bfa72e7d7db>.
|
||||
|
||||
|
||||
<http://data.lblod.info/id/contact-punten/bc66afca-f8cf-4e4d-b038-500906e9ffa9> a <http://schema.org/ContactPoint>;
|
||||
mu:uuid "bc66afca-f8cf-4e4d-b038-500906e9ffa9";
|
||||
<http://schema.org/contactType> "Primary".
|
||||
<http://data.lblod.info/id/contact-punten/1d1da2b5-8f38-41b6-a81d-5bfa72e7d7db> a <http://schema.org/ContactPoint>;
|
||||
mu:uuid "1d1da2b5-8f38-41b6-a81d-5bfa72e7d7db";
|
||||
<http://schema.org/contactType> "Secondary".
|
||||
|
||||
<http://data.lblod.info/id/adressen/2d6c327a-cf81-43a6-8536-17602781fb2f> a <http://www.w3.org/ns/locn#Address>;
|
||||
mu:uuid "2d6c327a-cf81-43a6-8536-17602781fb2f".
|
||||
|
||||
|
||||
<http://data.lblod.info/id/bestuurseenheden/5c6ab343-3405-475d-a184-d44bbe7e787a> a besluit:Bestuurseenheid, org:Organization;
|
||||
mu:uuid "5c6ab343-3405-475d-a184-d44bbe7e787a";
|
||||
org:classification <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721>;
|
||||
skos:prefLabel "AGB BRUGGE";
|
||||
skos:altLabel "";
|
||||
<http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/d02c4e12bf88d2fdf5123b07f29c9311>;
|
||||
<http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/2aa74846-a99d-423b-8c9e-b2a344b39f2a>;
|
||||
<http://www.w3.org/ns/org#hasPrimarySite> <http://data.lblod.info/id/vestigingen/29faec77-652a-4d8e-afbb-635b141b13f0> .
|
||||
145
config/migrations/2023/20230720093300-add-district-ovos.sparql
Normal file
145
config/migrations/2023/20230720093300-add-district-ovos.sparql
Normal file
@@ -0,0 +1,145 @@
|
||||
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/33a1886b07b64ebe3a0e6c5ed8086f030ef1109492cb254832a716dd7e1b8d7b> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/f3755e7e-01e0-4f32-a3ff-dfed24591701> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/f3755e7e-01e0-4f32-a3ff-dfed24591701> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "f3755e7e-01e0-4f32-a3ff-dfed24591701";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/eafe6bcd-46bf-4d2d-9616-79a7480d81ad>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/eafe6bcd-46bf-4d2d-9616-79a7480d81ad>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "eafe6bcd-46bf-4d2d-9616-79a7480d81ad";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003110".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/43e3009526dac139a0abdcf75c1ddc5fa3fe9217391d6f64f7b7a30a99a4cda6> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/1c509343-1c44-4ed6-8c9a-529e4909e638> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/1c509343-1c44-4ed6-8c9a-529e4909e638> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "1c509343-1c44-4ed6-8c9a-529e4909e638";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/9029d979-8b3f-427a-a3d6-053126aafd14>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/9029d979-8b3f-427a-a3d6-053126aafd14>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "9029d979-8b3f-427a-a3d6-053126aafd14";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003109".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/859f08dcfbc8f68bac0879e7baf6463b260b6f4c16b734d0d1986f5f3af0407b> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/25d915ea-ee4e-422c-9909-72b993e6e1c4> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/25d915ea-ee4e-422c-9909-72b993e6e1c4> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "25d915ea-ee4e-422c-9909-72b993e6e1c4";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/33e03e9e-928f-47dc-bbcf-f06b460e9ff1>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/33e03e9e-928f-47dc-bbcf-f06b460e9ff1>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "33e03e9e-928f-47dc-bbcf-f06b460e9ff1";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003107".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/fb56bc40ce36390d2f12fc2057c89d4b6bc5b3217eabd41995b6401318ff648a> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/36bf4d05-274b-46f0-8c30-1a4ca3e63ef5> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/36bf4d05-274b-46f0-8c30-1a4ca3e63ef5> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "36bf4d05-274b-46f0-8c30-1a4ca3e63ef5";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/4ec108c1-bf5e-4d5e-88be-755bf91ac1b0>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/4ec108c1-bf5e-4d5e-88be-755bf91ac1b0>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "4ec108c1-bf5e-4d5e-88be-755bf91ac1b0";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003106".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a2ee394059cce91526392e73e4de974d90caffb92f70cde23b9e9e1a965526fa> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/86e98e72-e0a5-455f-813c-d95234e0d182> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/86e98e72-e0a5-455f-813c-d95234e0d182> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "86e98e72-e0a5-455f-813c-d95234e0d182";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/8b960e2f-d34f-44a1-86c1-edab0a267584>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/8b960e2f-d34f-44a1-86c1-edab0a267584>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "8b960e2f-d34f-44a1-86c1-edab0a267584";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003111".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/73e8904d83f7324e39abc0adf639b0e48bc52533c4c243b6419cac8fb70784cf> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/2d026045-d4e3-4268-810a-948f0cd38198> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/2d026045-d4e3-4268-810a-948f0cd38198> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "2d026045-d4e3-4268-810a-948f0cd38198";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/80950ff2-ff24-44ac-8e95-f4303efc1fed>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/80950ff2-ff24-44ac-8e95-f4303efc1fed>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "80950ff2-ff24-44ac-8e95-f4303efc1fed";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003113".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/5be3ff820769b385a32e499d17bbf1f15feeacb65381d5384841732dd4a1209b> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/8c6f7b9d-69e8-44f2-96ec-97171bd1cdde> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/8c6f7b9d-69e8-44f2-96ec-97171bd1cdde> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "8c6f7b9d-69e8-44f2-96ec-97171bd1cdde";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/8019744a-e4db-4d52-97c0-381a3c384891>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/8019744a-e4db-4d52-97c0-381a3c384891>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "8019744a-e4db-4d52-97c0-381a3c384891";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003105".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e7a75861661ee14ebe2bca0c79bda8b23f2f943d00a9693d2bff401a8f8dea65> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/4f3c7aa4-c6f4-421a-85a7-e5cc5da429fa> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/4f3c7aa4-c6f4-421a-85a7-e5cc5da429fa> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "4f3c7aa4-c6f4-421a-85a7-e5cc5da429fa";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/aad1246a-1fd6-48e8-8551-ad873b7f6f74>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/aad1246a-1fd6-48e8-8551-ad873b7f6f74>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "aad1246a-1fd6-48e8-8551-ad873b7f6f74";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003108".
|
||||
}
|
||||
}
|
||||
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/f1ad80291fbdc1f0b9b25d729ecc608a8e28fdddab01a1b8e135c841c75586e2> <http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/b7bcbf7b-8674-48b0-beb0-1e6ac78a6272> .
|
||||
|
||||
<http://data.lblod.info/id/identificatoren/b7bcbf7b-8674-48b0-beb0-1e6ac78a6272> a <http://www.w3.org/ns/adms#Identifier>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "b7bcbf7b-8674-48b0-beb0-1e6ac78a6272";
|
||||
<http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer";
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/d613b7f8-dcd9-4af0-bb44-04edd71095ad>.
|
||||
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/d613b7f8-dcd9-4af0-bb44-04edd71095ad>
|
||||
a <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator>;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "d613b7f8-dcd9-4af0-bb44-04edd71095ad";
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "OVO003112".
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/worship-service
|
||||
26092
config/migrations/2023/20230720093301-add-worship-services-ovos.ttl
Normal file
26092
config/migrations/2023/20230720093301-add-worship-services-ovos.ttl
Normal file
File diff suppressed because it is too large
Load Diff
65
config/migrations/2023/20230726100700-fix-agb-names.sparql
Normal file
65
config/migrations/2023/20230726100700-fix-agb-names.sparql
Normal file
@@ -0,0 +1,65 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e852a0c8-e610-4359-9d8f-baa42e1bf5cf> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Begijnendijk ".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/e852a0c8-e610-4359-9d8f-baa42e1bf5cf> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Begijnendijk".
|
||||
}
|
||||
}
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/3a12adea-221a-4a11-8961-3503598bbaf7> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Beleko ".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/3a12adea-221a-4a11-8961-3503598bbaf7> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Beleko".
|
||||
}
|
||||
}
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/f06cc0f693ac44d63dffbb8573da4b1ae2777decbaa9f3252aa50987ae6ed28b> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Pelt ".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/f06cc0f693ac44d63dffbb8573da4b1ae2777decbaa9f3252aa50987ae6ed28b> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB Pelt".
|
||||
}
|
||||
}
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a782c3c4e64bceeef7707ad4175aca615843683fc32c1a50249feee5beb3c43e> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB voor infrastructuur- en patrimoniumbeheer Turnhout".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/a782c3c4e64bceeef7707ad4175aca615843683fc32c1a50249feee5beb3c43e> <http://www.w3.org/2004/02/skos/core#prefLabel> "AGB voor infrastructuur- en patrimoniumbeheer Turnhout".
|
||||
}
|
||||
}
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/807d593ab5dd6a809ae8e9b9b585e97af857cff3850ef62053a6c7df86a223e0> <http://www.w3.org/2004/02/skos/core#prefLabel> "Stadsontwikkelingsbedrijf Kortrijk ".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/807d593ab5dd6a809ae8e9b9b585e97af857cff3850ef62053a6c7df86a223e0> <http://www.w3.org/2004/02/skos/core#prefLabel> "Stadsontwikkelingsbedrijf Kortrijk".
|
||||
}
|
||||
}
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56> <http://www.w3.org/2004/02/skos/core#prefLabel> "Stedelijk Parkeerbedrijf van de stad Gent ".
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
<http://data.lblod.info/id/bestuurseenheden/70285c2d-2045-414e-bd49-56155a736e56> <http://www.w3.org/2004/02/skos/core#prefLabel> "Stedelijk Parkeerbedrijf van de stad Gent".
|
||||
}
|
||||
}
|
||||
1590
config/migrations/2023/20230726123943-import-agb-addresses.sparql
Normal file
1590
config/migrations/2023/20230726123943-import-agb-addresses.sparql
Normal file
File diff suppressed because it is too large
Load Diff
1586
config/migrations/2023/20230726123944-import-agb-addresses-2.sparql
Normal file
1586
config/migrations/2023/20230726123944-import-agb-addresses-2.sparql
Normal file
File diff suppressed because it is too large
Load Diff
1615
config/migrations/2023/20230726123945-import-agb-addresses-3.sparql
Normal file
1615
config/migrations/2023/20230726123945-import-agb-addresses-3.sparql
Normal file
File diff suppressed because it is too large
Load Diff
1616
config/migrations/2023/20230726123946-import-agb-addresses-4.sparql
Normal file
1616
config/migrations/2023/20230726123946-import-agb-addresses-4.sparql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
||||
# Every value that is in the admin unit graph but NOT in the landing graph means that it has not been
|
||||
# ingested via the consumer, and has to be cleared out
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s ?predicate ?value .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?predicate {
|
||||
<http://www.w3.org/ns/org#hasMembership>
|
||||
<http://www.w3.org/ns/org#holds>
|
||||
<http://data.vlaanderen.be/ns/mandaat#status>
|
||||
<http://data.vlaanderen.be/ns/mandaat#isBestuurlijkeAliasVan>
|
||||
<http://data.vlaanderen.be/ns/mandaat#beleidsdomein>
|
||||
<http://data.vlaanderen.be/ns/mandaat#rangorde>
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
?predicate ?value .
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
?predicate ?value .
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
# Now, handling dates is more complex as dates in OP are datetimes in Loket
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s ?predicate ?date .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?predicate {
|
||||
<http://data.vlaanderen.be/ns/mandaat#start>
|
||||
<http://data.vlaanderen.be/ns/mandaat#einde>
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
?predicate ?date .
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
GRAPH <http://mu.semte.ch/graphs/landing-zone/mandatarissen> {
|
||||
?s a <http://data.vlaanderen.be/ns/mandaat#Mandataris> ;
|
||||
?predicate ?datetime .
|
||||
}
|
||||
|
||||
BIND(?datetime + xsd:duration('PT2H') as ?dateInOurTimezone)
|
||||
|
||||
# convert to strings
|
||||
BIND(STR(year(?dateInOurTimezone)) AS ?year)
|
||||
BIND(STR(month(?dateInOurTimezone)) AS ?month)
|
||||
BIND(STR(day(?dateInOurTimezone)) AS ?day)
|
||||
|
||||
# pad with zeros
|
||||
BIND(CONCAT("00", ?year) AS ?paddedYear)
|
||||
BIND(CONCAT("0000", ?month) AS ?paddedMonth)
|
||||
BIND(CONCAT("00", ?day) AS ?paddedDay)
|
||||
|
||||
# extract the right number of digits from the padded strings
|
||||
BIND(SUBSTR(?paddedYear, STRLEN(?paddedYear)-3) AS ?fourDigitYear)
|
||||
BIND(SUBSTR(?paddedDay, STRLEN(?paddedDay)-1) AS ?twoDigitDay)
|
||||
BIND(SUBSTR(?paddedMonth, STRLEN(?paddedMonth)-1) AS ?twoDigitMonth)
|
||||
|
||||
# put it all back together
|
||||
BIND(xsd:date(CONCAT(?fourDigitYear, "-", ?twoDigitMonth, "-", ?twoDigitDay)) as ?datetimeToDate)
|
||||
|
||||
FILTER (?datetimeToDate = ?date)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
PREFIX owl: <http://www.w3.org/2002/07/owl#>
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?s owl:sameAs ?ovoUriToInsert .
|
||||
}
|
||||
} WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
}
|
||||
GRAPH ?g {
|
||||
?s <http://www.w3.org/ns/adms#identifier> ?id .
|
||||
|
||||
?id <http://www.w3.org/2004/02/skos/core#notation> "OVO-nummer" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator>/<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> ?ovo .
|
||||
}
|
||||
|
||||
?s <http://www.w3.org/ns/org#classification>/skos:prefLabel ?classif .
|
||||
|
||||
FILTER(strlen(str(?ovo)) > 0)
|
||||
FILTER NOT EXISTS { ?s owl:sameAs ?ovoUri . }
|
||||
|
||||
BIND(URI(CONCAT("http://data.vlaanderen.be/id/organisatie/", ?ovo)) as ?ovoUriToInsert)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/administrative-unit
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/administrative-unit
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user