Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d46472a090 | ||
|
|
223e30f2f5 | ||
|
|
1149b9a29c | ||
|
|
417922e556 | ||
|
|
ed08b7e117 | ||
|
|
8f1bbb7047 | ||
|
|
b9590d3289 | ||
|
|
b51ebbf8c5 | ||
|
|
832b8ed57c | ||
|
|
7e7b51cf0a | ||
|
|
91abe61cfc | ||
|
|
0c39f4a0be | ||
|
|
8e7e031576 | ||
|
|
2114f1531e | ||
|
|
d67440eac0 | ||
|
|
48f982864f | ||
|
|
1e7de4a9a8 | ||
|
|
48e0c3b3ea | ||
|
|
8e2dc898f5 | ||
|
|
de5bb3e392 | ||
|
|
6ef9690647 | ||
|
|
b6bdd5b067 | ||
|
|
97263fe7ae | ||
|
|
2ef1d8ab7b | ||
|
|
3e7d92624c | ||
|
|
9dffe4b223 | ||
|
|
6f2db80f50 | ||
|
|
8308644e82 | ||
|
|
7ac0394d2f | ||
|
|
215deda183 | ||
|
|
729bee7f14 | ||
|
|
8146686b48 | ||
|
|
8d133fd1c9 | ||
|
|
101618c156 | ||
|
|
b51293ca3a | ||
|
|
e1eca4b185 | ||
|
|
1c46d49976 | ||
|
|
68cbd39c9d | ||
|
|
4982224a78 | ||
|
|
cbf320711d | ||
|
|
6dfb0a656f | ||
|
|
387ef1eeea | ||
|
|
5a3ae13eb0 | ||
|
|
57dca52171 | ||
|
|
e7e76c187b | ||
|
|
6a85ec7c96 | ||
|
|
b272e1500c | ||
|
|
7c2a54264a | ||
|
|
74327cc371 | ||
|
|
bfb28bb698 | ||
|
|
cc8125cb14 | ||
|
|
329a63a0b9 | ||
|
|
4891b6829d | ||
|
|
eef379f7ed | ||
|
|
ea2d25d177 | ||
|
|
8c49134011 | ||
|
|
d203077364 | ||
|
|
eee9f18561 | ||
|
|
a8681a02f3 | ||
|
|
edbba1eeaa | ||
|
|
0c9355c94f | ||
|
|
b6a42c66cf | ||
|
|
96b36d2cf6 | ||
|
|
19a0804b56 | ||
|
|
a4684811df | ||
|
|
dc18662517 | ||
|
|
c6ba52a6bc | ||
|
|
ee1c92b5fe | ||
|
|
32b6520bfa | ||
|
|
0e9483b4f8 | ||
|
|
b65e0cbeaa | ||
|
|
fbf8a4e2dc | ||
|
|
1bff031596 | ||
|
|
b2deb421bc | ||
|
|
e078ae48a7 | ||
|
|
e2479f626a | ||
|
|
df8512d8f9 | ||
|
|
ed0863c0bf | ||
|
|
4131395159 | ||
|
|
325ebe991c | ||
|
|
179ba7b315 | ||
|
|
714fda3dc8 | ||
|
|
b31d6c65e6 | ||
|
|
0be27e1ef2 | ||
|
|
c77f1e9139 |
126
CHANGELOG.md
126
CHANGELOG.md
@@ -1,5 +1,129 @@
|
||||
# Changelog
|
||||
## Unreleased
|
||||
|
||||
## 1.36.0 (2025-10-03)
|
||||
### Dashboard
|
||||
- Enable ACM/IDM for the dashboard [OP-3674]
|
||||
|
||||
#### QA
|
||||
Configure the environment variables for the QA ACM/IDM environment:
|
||||
|
||||
```yml
|
||||
frontend-dashboard:
|
||||
environment:
|
||||
EMBER_ACMIDM_CLIENT_ID: "03382bf4-4886-4fb6-8602-945ad3080a7a"
|
||||
EMBER_ACMIDM_BASE_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/auth"
|
||||
EMBER_ACMIDM_REDIRECT_URL: "https://dashboard.organisaties.abb.lblod.info/authorization/callback"
|
||||
EMBER_ACMIDM_LOGOUT_URL: "https://authenticatie-ti.vlaanderen.be/op/v1/logout"
|
||||
EMBER_ACMIDM_SCOPE: "openid vo profile abb_organisatieportaal"
|
||||
|
||||
login-dashboard:
|
||||
environment:
|
||||
MU_APPLICATION_AUTH_DISCOVERY_URL: "https://authenticatie-ti.vlaanderen.be/op"
|
||||
MU_APPLICATION_AUTH_CLIENT_ID: "03382bf4-4886-4fb6-8602-945ad3080a7a"
|
||||
MU_APPLICATION_AUTH_REDIRECT_URI: "https://dashboard.organisaties.abb.lblod.info/authorization/callback"
|
||||
MU_APPLICATION_AUTH_CLIENT_SECRET: "snip" # see ticket for secret
|
||||
|
||||
```
|
||||
|
||||
Link the new domain name to QA (and remove from dev)
|
||||
|
||||
#### PROD
|
||||
Configure the environment variables for the PROD ACM/IDM environment once the values are known.
|
||||
|
||||
Link the new domain name to PROD + DNS config to the server
|
||||
|
||||
#### CLI
|
||||
```
|
||||
drc restart migrations
|
||||
drc restart dispatcher database
|
||||
drc up -d --remove-orphans
|
||||
```
|
||||
|
||||
### Frontend
|
||||
- Bump to [v1.34.1](https://github.com/lblod/frontend-organization-portal/releases/tag/v1.34.1) [OP-3638]
|
||||
- Remove province for addresses in the Brussels area [OP-3638] & [OP-3648]
|
||||
|
||||
### Deploy notes
|
||||
```
|
||||
drc pull frontend; drc up -d frontend
|
||||
drc restart migrations-triggering-indexing; drc logs -ft --tail=200 migrations-triggering-indexing
|
||||
```
|
||||
|
||||
## v1.35.1 (2025-09-15)
|
||||
### Backend
|
||||
- Produce memberships and their roles in organizations and public producers [OP-3658] & [OP-3661]
|
||||
### Deploy notes
|
||||
```
|
||||
drc restart delta-producer-publication-graph-maintainer
|
||||
```
|
||||
|
||||
## v1.35.0 (2025-08-04)
|
||||
### Frontend
|
||||
- Bump to [v1.34.0](https://github.com/lblod/frontend-organization-portal/releases/tag/v1.34.0)
|
||||
### Backend
|
||||
- Add a service to manage organisation's their scope of operation [OP-3205]
|
||||
- datamodel: Allow a location to be within multiple other locations [OP-3205]
|
||||
- datafix: set scope of operation for worship administrative units [OP-3626]
|
||||
- Clean addresses linked to both sites and contact points of mandatarissen and addresses that are in the wrong graph (admin unit graph but linked to a contact point in the worship graph) [DL-6701]
|
||||
- datafix: cleanup of general memberships if specific ones exist [OP-3640]
|
||||
- datafix: cleanup of duplicate memberships [OP-3634]
|
||||
- Fix KBO organizations' date formats [OP-3560]
|
||||
|
||||
|
||||
### Deploy notes
|
||||
```
|
||||
drc pull scope-of-operation; drc up -d scope-of-operation
|
||||
drc restart db resource dispatcher
|
||||
drc pull frontend; drc up -d frontend
|
||||
drc restart migrations; drc logs -ft --tail=200 migrations
|
||||
drc up -d kbo-data-sync
|
||||
```
|
||||
|
||||
The labels for new location resources created when setting the scope of operation for worship services are not necessarily alphabetically sorted. To correct this run the `correct-location-labels` project script using [mu-cli](https://github.com/mu-semtech/mu-cli) and restart the migrations service once more to execute the generated local migrations.
|
||||
|
||||
```
|
||||
mu script project-scripts correct-location-labels
|
||||
drc restart migrations; drc logs -ft --tail=200 migrations
|
||||
```
|
||||
|
||||
## v1.34.0 (2025-07-11)
|
||||
### Frontend
|
||||
- Bump to version [v1.33.0](https://github.com/lblod/frontend-organization-portal/releases/tag/v1.33.0)
|
||||
### Backend
|
||||
- Add Brussels Hoofdstedelijk Gewest as province and location, update province of addresses in Brussel's area, update resource config to add `skos:note` on organizations [OP-3624]
|
||||
- Add Brussel as a municipality [OP-3628]
|
||||
- Revert Brussel as province and municipality and update back province of addresses in Brussel's area [OP-3637]
|
||||
- Bump delta-notifier service to most recent version [OP-3190]
|
||||
- Add URI to resource's organization responses
|
||||
- Fix query for organizations report [OP-3636]
|
||||
- Bump report-generation-service to most recent version
|
||||
- Write migration to harmonize date formats of change events [OP-3559]
|
||||
### Deploy notes
|
||||
```
|
||||
drc pull deltanotifier; drc up -d deltanotifier
|
||||
drc restart migrations-triggering-indexing resource
|
||||
drc pull frontend; drc up -d frontend
|
||||
drc pull report-generation; drc up -d report-generation
|
||||
drc restart migrations; drc logs -ft --tail=200 migrations
|
||||
```
|
||||
|
||||
## v1.33.3 (2025-07-04)
|
||||
### Backend
|
||||
- datafix: re-add Havenbedrijf Antwerpen as an AGB [OP-3639]
|
||||
### Deploy notes
|
||||
```
|
||||
drc restart migrations; drc logs -ft --tail=200 migrations
|
||||
drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs
|
||||
```
|
||||
|
||||
## v1.33.2 (2025-06-20)
|
||||
### Backend
|
||||
- datafix: correct name for locations whose municipalities kept their URI in the 2025 mergers [OP-3627]
|
||||
### Deploy notes
|
||||
```
|
||||
drc restart migrations-triggering-indexing && drc logs -ft --tail=200
|
||||
```
|
||||
|
||||
## v1.33.1 (2025-06-16)
|
||||
### Backend
|
||||
- Added Vlaams Parlement as bestuurseenheid. [DL-6686]
|
||||
|
||||
23
README.md
23
README.md
@@ -185,26 +185,3 @@ To make sure the app can share data, producers need to be set up. There is an in
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Configuring the dashboard
|
||||
### Accessing the dashboard from your local machine
|
||||
|
||||
Since we use dispatcher v2, which dispatches on hostname, we'll have to update `/etc/hosts`.
|
||||
Add an entry similar to the following. Ensure the first part of the domain starts with `dashboard`.:
|
||||
|
||||
```
|
||||
127.0.0.1 dashboard.localhost
|
||||
```
|
||||
|
||||
### Creating new users
|
||||
For now, we use specific logins for the dashboard users. Each environment has its own passwords.
|
||||
|
||||
To add a user, make sure to have [mu-cli](https://github.com/mu-semtech/mu-cli) installed first.
|
||||
Then in `docker-compose.override.yml`
|
||||
```
|
||||
dashboard-login:
|
||||
environment:
|
||||
MU_APPLICATION_SALT: 'a_random_string_with_sufficient_entropy_hence_not_this_one'
|
||||
```
|
||||
You can now generate a user by running `mu script project-scripts generate-dashboard-login` and following the steps.
|
||||
Restart `migrations` and it should insert the new user into the database.
|
||||
@@ -53,7 +53,8 @@ defmodule Acl.UserGroups.Config do
|
||||
"http://lblod.data.gift/vocabularies/organisatie/VoorwaardenBedienaarCriterium",
|
||||
"http://lblod.data.gift/vocabularies/organisatie/BedienaarCriteriumBewijsstuk",
|
||||
"http://lblod.data.gift/vocabularies/organisatie/EredienstBeroepen",
|
||||
"http://lblod.data.gift/vocabularies/organisatie/Rechtsvormtype"
|
||||
"http://lblod.data.gift/vocabularies/organisatie/Rechtsvormtype",
|
||||
"http://www.w3.org/ns/prov#Location"
|
||||
]
|
||||
|
||||
@org_type [
|
||||
@@ -80,11 +81,10 @@ defmodule Acl.UserGroups.Config do
|
||||
"http://data.lblod.info/vocabularies/contacthub/AgentInPositie",
|
||||
"http://mu.semte.ch/vocabularies/ext/KboOrganisatie",
|
||||
"http://www.w3.org/ns/org#Membership",
|
||||
"http://www.w3.org/2006/time#ProperInterval"
|
||||
"http://www.w3.org/2006/time#ProperInterval",
|
||||
]
|
||||
|
||||
@shared_protected_type [
|
||||
"http://www.w3.org/ns/prov#Location",
|
||||
"http://xmlns.com/foaf/0.1/Image",
|
||||
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject"
|
||||
]
|
||||
@@ -111,13 +111,11 @@ defmodule Acl.UserGroups.Config do
|
||||
%AccessByQuery{
|
||||
vars: [],
|
||||
query: "PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
SELECT DISTINCT ?account WHERE {
|
||||
<SESSION_ID> <http://mu.semte.ch/vocabularies/session/account> ?account.
|
||||
?account <http://mu.semte.ch/vocabularies/ext/sessionRole> ?session_role.
|
||||
FILTER( ?session_role = \"dashboard-user\" )
|
||||
SELECT DISTINCT ?session WHERE {
|
||||
VALUES ?session { <SESSION_ID> }
|
||||
?session ext:sessionRole \"LoketLB-AdminDashboardOrganisatiePortaalGebruiker\" .
|
||||
}"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def user_groups do
|
||||
@@ -219,10 +217,10 @@ defmodule Acl.UserGroups.Config do
|
||||
}
|
||||
]
|
||||
},
|
||||
# // dashboard users
|
||||
# // Dashboard admin
|
||||
%GroupSpec{
|
||||
name: "dashboard-users",
|
||||
useage: [:read],
|
||||
name: "o-admin-rwf",
|
||||
useage: [:read, :write, :read_for_write],
|
||||
access: can_access_dashboard(),
|
||||
graphs: [
|
||||
%GraphSpec{
|
||||
@@ -256,7 +254,7 @@ defmodule Acl.UserGroups.Config do
|
||||
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject"
|
||||
]
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@@ -512,6 +512,32 @@
|
||||
"properties": [
|
||||
"http://www.w3.org/2004/02/skos/core#prefLabel"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://www.w3.org/ns/org#Membership",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/worship-service",
|
||||
"http://mu.semte.ch/graphs/shared",
|
||||
"http://mu.semte.ch/graphs/administrative-unit"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://www.w3.org/ns/org#organization",
|
||||
"http://www.w3.org/ns/org#member",
|
||||
"http://www.w3.org/ns/org#role"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://www.w3.org/ns/org#Role",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/public"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://www.w3.org/2004/02/skos/core#prefLabel",
|
||||
"http://www.w3.org/2004/02/skos/core#broader",
|
||||
"http://www.w3.org/2004/02/skos/core#topConceptOf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -675,6 +675,32 @@
|
||||
"http://www.w3.org/2004/02/skos/core#prefLabel",
|
||||
"http://www.w3.org/2000/01/rdf-schema#label"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://www.w3.org/ns/org#Membership",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/worship-service",
|
||||
"http://mu.semte.ch/graphs/shared",
|
||||
"http://mu.semte.ch/graphs/administrative-unit"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://www.w3.org/ns/org#organization",
|
||||
"http://www.w3.org/ns/org#member",
|
||||
"http://www.w3.org/ns/org#role"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "http://www.w3.org/ns/org#Role",
|
||||
"graphsFilter": [
|
||||
"http://mu.semte.ch/graphs/public"
|
||||
],
|
||||
"properties": [
|
||||
"http://mu.semte.ch/vocabularies/core/uuid",
|
||||
"http://www.w3.org/2004/02/skos/core#prefLabel",
|
||||
"http://www.w3.org/2004/02/skos/core#broader",
|
||||
"http://www.w3.org/2004/02/skos/core#topConceptOf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ defmodule Dispatcher do
|
||||
end
|
||||
|
||||
match "/sessions/*path", %{ reverse_host: ["dashboard" | _rest] } do
|
||||
Proxy.forward conn, path, "http://dashboard-login/sessions/"
|
||||
Proxy.forward conn, path, "http://login-dashboard/sessions/"
|
||||
end
|
||||
|
||||
match "/sessions/*path", %{accept: [:any], layer: :api} do
|
||||
@@ -393,6 +393,10 @@ defmodule Dispatcher do
|
||||
forward(conn, path, "http://kbo-data-sync/sync-kbo-data/")
|
||||
end
|
||||
|
||||
match "/scope-of-operation/*path", %{layer: api_services, accept: %{json: true}} do
|
||||
forward(conn, path, "http://scope-of-operation/")
|
||||
end
|
||||
|
||||
get "/ldes/*path", %{layer: :api_services} do
|
||||
forward(conn, path, "http://ldes-backend/")
|
||||
end
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?scope rdfs:label ?oldLabel .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?scope rdfs:label ?newLabel .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?scope a prov:Location ;
|
||||
rdfs:label ?oldLabel .
|
||||
VALUES (?scope ?newLabel) {
|
||||
(<http://data.lblod.info/id/werkingsgebieden/1f5dd7043ad54d07751da8689d5b47ad9ae0e52dccce8f00cc8debab35f8e2b2> "Bilzen-Hoeselt")
|
||||
(<http://data.lblod.info/id/werkingsgebieden/fc34bb0a1dbf157ac5e5f8e657dd774210f03d2efa21370dd3b9a6342906c7ab> "Tessenderlo-Ham")
|
||||
(<http://data.lblod.info/id/werkingsgebieden/fabec9e745fc9efa32afadd8b7268938805b9679dcf3b032c9b9a9a3530d6b59> "Tongeren-Borgloon")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?s <http://www.w3.org/ns/locn#adminUnitL2> ?province ;
|
||||
<https://data.vlaanderen.be/ns/adres#adresIsGelegenIn> ?werkingsgebied .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
VALUES ?postCode {
|
||||
"1070"
|
||||
"1000"
|
||||
"1020"
|
||||
"1120"
|
||||
"1130"
|
||||
"1050"
|
||||
"1040"
|
||||
"1140"
|
||||
"1083"
|
||||
"1090"
|
||||
"1081"
|
||||
"1160"
|
||||
"1030"
|
||||
"1082"
|
||||
"1060"
|
||||
"1080"
|
||||
"1210"
|
||||
"1200"
|
||||
"1150"
|
||||
"1180"
|
||||
"1190"
|
||||
"1170"
|
||||
}
|
||||
|
||||
?s a <http://www.w3.org/ns/locn#Address> ;
|
||||
<http://www.w3.org/ns/locn#postCode> ?postCode ;
|
||||
<http://www.w3.org/ns/locn#adminUnitL2> ?province ;
|
||||
<https://data.vlaanderen.be/ns/adres#adresIsGelegenIn> ?werkingsgebied .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
http://mu.semte.ch/graphs/administrative-unit
|
||||
@@ -0,0 +1,129 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix dcterms: <http://purl.org/dc/terms/> .
|
||||
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
|
||||
# Core data
|
||||
<http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuurseenheid> , <http://www.w3.org/ns/org#Organization> , dcterms:Agent ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7" ;
|
||||
skos:prefLabel "Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/regorg#legalName> "Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/org#hasPrimarySite> <http://data.lblod.info/id/vestigingen/6867A955D4D5D97D41D25644> ;
|
||||
<http://www.w3.org/ns/regorg#orgStatus> <http://lblod.data.gift/concepts/63cc561de9188d64ba5840a42ae8f0d6> ;
|
||||
<http://www.w3.org/ns/adms#identifier> <http://data.lblod.info/id/identificatoren/6867A953D4D5D97D41D2563E> , <http://data.lblod.info/id/identificatoren/6867A954D4D5D97D41D25640> , <http://data.lblod.info/id/identificatoren/90a07cc0-58bf-11f0-a83a-cf8f2103999b> ;
|
||||
<http://www.w3.org/ns/org#classification> <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/36a82ba0-7ff1-4697-a9dd-2e94df73b721> .
|
||||
|
||||
## Identifiers
|
||||
### KBO no.
|
||||
<http://data.lblod.info/id/identificatoren/6867A953D4D5D97D41D2563E> rdf:type <http://www.w3.org/ns/adms#Identifier> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A953D4D5D97D41D2563E" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/6867A953D4D5D97D41D2563D> ;
|
||||
skos:notation "KBO nummer" .
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/6867A953D4D5D97D41D2563D> rdf:type <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A953D4D5D97D41D2563D" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> "0248399380" .
|
||||
### SharePoint id
|
||||
<http://data.lblod.info/id/identificatoren/6867A954D4D5D97D41D25640> rdf:type <http://www.w3.org/ns/adms#Identifier> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A954D4D5D97D41D25640" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/6867A954D4D5D97D41D2563F> ;
|
||||
skos:notation "SharePoint identificator" .
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/6867A954D4D5D97D41D2563F> rdf:type <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A954D4D5D97D41D2563F" .
|
||||
### OVO no.
|
||||
<http://data.lblod.info/id/identificatoren/90a07cc0-58bf-11f0-a83a-cf8f2103999b> rdf:type <http://www.w3.org/ns/adms#Identifier> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "90a07cc0-58bf-11f0-a83a-cf8f2103999b" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> <http://data.lblod.info/id/gestructureerdeIdentificatoren/90a07cc1-58bf-11f0-a83a-cf8f2103999b> ;
|
||||
skos:notation "OVO-nummer" .
|
||||
<http://data.lblod.info/id/gestructureerdeIdentificatoren/90a07cc1-58bf-11f0-a83a-cf8f2103999b> rdf:type <https://data.vlaanderen.be/ns/generiek#GestructureerdeIdentificator> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "90a07cc1-58bf-11f0-a83a-cf8f2103999b" .
|
||||
|
||||
# Contact information
|
||||
<http://data.lblod.info/id/vestigingen/6867A955D4D5D97D41D25644> rdf:type <http://www.w3.org/ns/org#Site> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A955D4D5D97D41D25644" ;
|
||||
<http://www.w3.org/ns/org#siteAddress> <http://data.lblod.info/id/contact-punten/6867A954D4D5D97D41D25641> , <http://data.lblod.info/id/contact-punten/6867A954D4D5D97D41D25642> ;
|
||||
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> <http://data.lblod.info/id/adressen/6867A954D4D5D97D41D25643> ;
|
||||
<http://data.lblod.info/vocabularies/erediensten/vestigingstype> <http://lblod.data.gift/concepts/f1381723dec42c0b6ba6492e41d6f5dd> .
|
||||
|
||||
<http://data.lblod.info/id/contact-punten/6867A954D4D5D97D41D25641> rdf:type <http://schema.org/ContactPoint> ;
|
||||
<http://schema.org/contactType> "Primary" ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A954D4D5D97D41D25641" .
|
||||
|
||||
<http://data.lblod.info/id/contact-punten/6867A954D4D5D97D41D25642> rdf:type <http://schema.org/ContactPoint> ;
|
||||
<http://schema.org/contactType> "Secondary" ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A954D4D5D97D41D25642" .
|
||||
|
||||
<http://data.lblod.info/id/adressen/6867A954D4D5D97D41D25643> rdf:type <http://www.w3.org/ns/locn#Address> ;
|
||||
<https://data.vlaanderen.be/ns/adres#verwijstNaar> <https://data.vlaanderen.be/id/adres/3883528> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A954D4D5D97D41D25643" ;
|
||||
dcterms:source <http://lblod.data.gift/concepts/e59c97a9-4e95-4d65-9696-756de47fbc1f> ;
|
||||
<http://www.w3.org/ns/locn#postCode> "2030" ;
|
||||
<https://data.vlaanderen.be/ns/adres#Adresvoorstelling.huisnummer> "1" ;
|
||||
<http://www.w3.org/ns/locn#adminUnitL2> "Antwerpen" ;
|
||||
<http://www.w3.org/ns/locn#fullAddress> "Zaha Hadidplein 1, 2030 Antwerpen, Belgi\u00EB" ;
|
||||
<http://www.w3.org/ns/locn#thoroughfare> "Zaha Hadidplein" ;
|
||||
<https://data.vlaanderen.be/ns/adres#gemeentenaam> "Antwerpen" ;
|
||||
<https://data.vlaanderen.be/ns/adres#land> "Belgi\u00EB" .
|
||||
|
||||
# Governing bodies
|
||||
## Raad van bestuur
|
||||
<http://data.lblod.info/id/bestuursorganen/8ffdfb30-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "8ffdfb30-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
skos:prefLabel "Raad van bestuur Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/org#classification> <http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/013cc838-173a-4657-b1ae-b00c048df943> ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> .
|
||||
|
||||
<http://data.lblod.info/id/bestuursorganen/903007b0-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "903007b0-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> <http://data.lblod.info/id/bestuursorganen/8ffdfb30-58bf-11f0-8a90-dda5d31bcff4> ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00Z"^^xsd:dateTime .
|
||||
|
||||
## Bevoegd beslissingsorgaan
|
||||
<http://data.lblod.info/id/bestuursorganen/900b1a90-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "900b1a90-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
skos:prefLabel "Bevoegd beslissingsorgaan Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/org#classification> <http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/0dbc70ec-6be9-4997-b8e1-11b6c0542382> ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> .
|
||||
|
||||
<http://data.lblod.info/id/bestuursorganen/90384510-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "90384510-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> <http://data.lblod.info/id/bestuursorganen/900b1a90-58bf-11f0-8a90-dda5d31bcff4> ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00Z"^^xsd:dateTime .
|
||||
|
||||
## Algemene vergadering
|
||||
<http://data.lblod.info/id/bestuursorganen/901812e0-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "901812e0-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
skos:prefLabel "Algemene vergadering Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/org#classification> <http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/b52094ff-21a2-4da8-8dbe-f513365d1528> ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> .
|
||||
|
||||
<http://data.lblod.info/id/bestuursorganen/903c3cb0-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "903c3cb0-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> <http://data.lblod.info/id/bestuursorganen/901812e0-58bf-11f0-8a90-dda5d31bcff4> ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00Z"^^xsd:dateTime .
|
||||
|
||||
## Leidend Ambtenaar
|
||||
<http://data.lblod.info/id/bestuursorganen/90230f60-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "90230f60-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
skos:prefLabel "Leidend Ambtenaar Havenbedrijf Antwerpen" ;
|
||||
<http://www.w3.org/ns/org#classification> <http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/41caf7e6-b040-4720-9cc2-a96cfffed5b4> ;
|
||||
<http://data.vlaanderen.be/ns/besluit#bestuurt> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> .
|
||||
|
||||
<http://data.lblod.info/id/bestuursorganen/90427e40-58bf-11f0-8a90-dda5d31bcff4> rdf:type <http://data.vlaanderen.be/ns/besluit#Bestuursorgaan> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "90427e40-58bf-11f0-8a90-dda5d31bcff4" ;
|
||||
<http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie> <http://data.lblod.info/id/bestuursfuncties/904a6d80-58bf-11f0-8a90-dda5d31bcff4> ;
|
||||
<https://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan> <http://data.lblod.info/id/bestuursorganen/90230f60-58bf-11f0-8a90-dda5d31bcff4> ;
|
||||
<http://data.vlaanderen.be/ns/mandaat#bindingStart> "2019-01-01T00:00:00Z"^^xsd:dateTime .
|
||||
|
||||
|
||||
# Related organisations
|
||||
<http://data.lblod.info/id/lidmaatschap/6867A956D4D5D97D41D25646> rdf:type <http://www.w3.org/ns/org#Membership> ;
|
||||
<http://www.w3.org/ns/org#organization> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A956D4D5D97D41D25646" ;
|
||||
<http://www.w3.org/ns/org#member> <http://data.lblod.info/id/bestuurseenheden/670db1d66c0de3b931962e1044033ccfa9d6e3023aa9828a5f252c3bc69bd32c> ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.lblod.info/id/rollen/73d5e1cf250d42fab15926771f07505a> .
|
||||
|
||||
<http://data.lblod.info/id/lidmaatschap/6867A956D4D5D97D41D25647> rdf:type <http://www.w3.org/ns/org#Membership> ;
|
||||
<http://www.w3.org/ns/org#organization> <http://data.lblod.info/id/bestuurseenheden/604d50138929f0e450f629b1caad73733d2a5dc31018edb53e50a5940f4dafe7> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> "6867A956D4D5D97D41D25647" ;
|
||||
<http://www.w3.org/ns/org#member> <http://data.lblod.info/id/bestuurseenheden/bd74ee38a4b1e296821a11729c1f704cf439576c7ab2c910c95b067cf183d923> ;
|
||||
<http://www.w3.org/ns/org#role> <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> .
|
||||
@@ -0,0 +1,112 @@
|
||||
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
|
||||
# This migration extracts the relations between (central) worship services and
|
||||
# their locations according to the rules provided by business. These links are
|
||||
# inserted into a temporary graph for further processing.
|
||||
|
||||
# Worship services
|
||||
## Municipality organised
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws a ere:BestuurVanDeEredienst ;
|
||||
ere:typeEredienst ?worshipType .
|
||||
VALUES ?worshipType {
|
||||
<http://lblod.data.gift/concepts/99536dd6eb0d2ef38a89efafb17e7389> # Anglicaans
|
||||
<http://lblod.data.gift/concepts/1a1abeafc973d27cebcb2d7a15b2d823> # Israëlitisch
|
||||
<http://lblod.data.gift/concepts/e8cba1540b35a32e9cb45126c38c03c6> # Protestants
|
||||
<http://lblod.data.gift/concepts/b13d1d623626bc1ee75c7d20bc60e3c0> # Rooms-Katholiek
|
||||
}
|
||||
|
||||
?involvement a ere:BetrokkenLokaleBesturen ;
|
||||
org:organization ?ws ;
|
||||
ere:typebetrokkenheid ?involvementType .
|
||||
VALUES ?involvementType {
|
||||
<http://lblod.data.gift/concepts/86fcbbbff764f1cba4c7e10dbbae578e> # Mede-financierend
|
||||
<http://lblod.data.gift/concepts/ac400cc9f135ac7873fb3e551ec738c1> # Toezichthoudend
|
||||
}
|
||||
?org ere:betrokkenBestuur ?involvement .
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?org besluit:werkingsgebied ?scope .
|
||||
}
|
||||
}
|
||||
;
|
||||
## Province organised
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws a ere:BestuurVanDeEredienst ;
|
||||
ere:typeEredienst ?worshipType .
|
||||
VALUES ?worshipType {
|
||||
<http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> # Islamitisch
|
||||
<http://lblod.data.gift/concepts/84bcd6896f575bae4857ff8d2764bed8> # Orthodox
|
||||
}
|
||||
|
||||
?involvement a ere:BetrokkenLokaleBesturen ;
|
||||
org:organization ?ws ;
|
||||
ere:typebetrokkenheid ?involvementType .
|
||||
VALUES ?involvementType {
|
||||
<http://lblod.data.gift/concepts/0f845f00ee76099c89518cbaf6a7b77f> # Adviserend
|
||||
}
|
||||
?org ere:betrokkenBestuur ?involvement .
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?org besluit:werkingsgebied ?scope .
|
||||
}
|
||||
}
|
||||
;
|
||||
# Central worship services
|
||||
## Municipality organised
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws a ere:CentraalBestuurVanDeEredienst ;
|
||||
ere:typeEredienst ?worshipType .
|
||||
VALUES ?worshipType {
|
||||
<http://lblod.data.gift/concepts/b13d1d623626bc1ee75c7d20bc60e3c0> # Rooms-Katholiek
|
||||
}
|
||||
|
||||
?involvement a ere:BetrokkenLokaleBesturen ;
|
||||
org:organization ?ws ;
|
||||
ere:typebetrokkenheid ?involvementType .
|
||||
VALUES ?involvementType {
|
||||
<http://lblod.data.gift/concepts/ac400cc9f135ac7873fb3e551ec738c1> # Toezichthoudend
|
||||
}
|
||||
?org ere:betrokkenBestuur ?involvement .
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?org besluit:werkingsgebied ?scope .
|
||||
}
|
||||
}
|
||||
;
|
||||
## Province organised
|
||||
## Note: Business requested to use the location for the municipality of Ghent as
|
||||
## default value. They will update it manually afterwards.
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?locationGhent .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws a ere:CentraalBestuurVanDeEredienst ;
|
||||
ere:typeEredienst ?worshipType .
|
||||
VALUES ?worshipType {
|
||||
<http://lblod.data.gift/concepts/9d8bd472a00bf0a5c7b7186606365a52> # Islamitisch
|
||||
<http://lblod.data.gift/concepts/84bcd6896f575bae4857ff8d2764bed8> # Orthodox
|
||||
}
|
||||
|
||||
BIND(URI("http://data.lblod.info/id/werkingsgebieden/ce94eeae827cdc5c00f3f2f4276ff628580edefb3aa5861e4669b0c5d93adc57") AS ?locationGhent)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
|
||||
# This migration sets the scope of operation for worship organisations that have
|
||||
# single, already existing, location as scope. This migration depends on
|
||||
# `20250707132349-chore--extract-scopes-for-worship-organisations` being
|
||||
# executed first, as it uses the data created by the migration.
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
} WHERE {
|
||||
{
|
||||
SELECT DISTINCT ?ws (count(DISTINCT ?scope) as ?count)
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
}
|
||||
}
|
||||
FILTER (?count = 1)
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
# This migration sets the scope of operation for worship organisations that have
|
||||
# multiple location as scope. It creates new aggregate locations to contain the
|
||||
# already existing municipality/province level ones. This migration depends on
|
||||
# `20250707132349-chore--extract-scopes-for-worship-organisations` being
|
||||
# executed first, as it uses the data created by the migration.
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?location a prov:Location ;
|
||||
mu:uuid ?locationUuid ;
|
||||
rdfs:label ?scopeLabel ;
|
||||
ext:werkingsgebiedNiveau """Samengesteld werkingsgebied""" .
|
||||
?scope geo:sfWithin ?location .
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?ws besluit:werkingsgebied ?location .
|
||||
}
|
||||
} WHERE {
|
||||
{
|
||||
SELECT DISTINCT ?ws (count(DISTINCT ?scope) AS ?count) (GROUP_CONCAT(?uuid," ") AS ?scopeUuids) (GROUP_CONCAT(?label,", ") AS ?scopeLabel)
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?scope mu:uuid ?uuid ;
|
||||
rdfs:label ?label .
|
||||
}
|
||||
}
|
||||
}
|
||||
FILTER (?count > 1)
|
||||
GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope> {
|
||||
?ws besluit:werkingsgebied ?scope .
|
||||
}
|
||||
# NOTE (10/07/2025): The SPARQL specification does not specify any order for
|
||||
# `GROUP_CONCAT`. But virtuoso does seem to concatenate elements always in the
|
||||
# same order. Therefore, this way of generating a UUID is a bit of a hack to
|
||||
# ensure that new locations that contain the same locations will receive the
|
||||
# same UUUID, which results in the same location resource being inserted
|
||||
# twice.
|
||||
BIND (STR(SHA256(?scopeUuids)) AS ?locationUuid)
|
||||
BIND (URI(CONCAT("http://data.lblod.info/id/werkingsgebieden/", ?locationUuid)) AS ?location)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
CLEAR GRAPH <http://mu.semte.ch/graphs/temp-for-worship-organizations-scope>
|
||||
@@ -0,0 +1,26 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX dcterms: <http://purl.org/dc/terms/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?s dcterms:date ?oldDate .
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?s dcterms:date ?newDate .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH ?g {
|
||||
?s a org:ChangeEvent ;
|
||||
dcterms:date ?oldDate .
|
||||
FILTER(DATATYPE(?oldDate) != xsd:date)
|
||||
FILTER(?g IN (
|
||||
<http://mu.semte.ch/graphs/administrative-unit>,
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
))
|
||||
BIND(STRDT(SUBSTR(STR(?oldDate), 1, 10), xsd:date) AS ?newDate)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
DELETE {
|
||||
GRAPH ?h {
|
||||
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH ?g {
|
||||
?newAddressUri a <http://www.w3.org/ns/locn#Address> ;
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ?newAddressUuid ;
|
||||
?p ?o .
|
||||
|
||||
?site <https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?newAddressUri .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH ?g {
|
||||
?oldAddressUri a <http://www.w3.org/ns/locn#Address> ;
|
||||
?p ?o .
|
||||
|
||||
FILTER (?p NOT IN (<http://mu.semte.ch/vocabularies/core/uuid>))
|
||||
}
|
||||
|
||||
?mandatarisContact <http://www.w3.org/ns/locn#address> ?oldAddressUri .
|
||||
|
||||
GRAPH ?h {
|
||||
?site a <http://www.w3.org/ns/org#Site>;
|
||||
<https://data.vlaanderen.be/ns/organisatie#bestaatUit> ?oldAddressUri .
|
||||
}
|
||||
|
||||
BIND(MD5(CONCAT(?oldAddressUri,"NEW_ADDRESS")) AS ?newAddressUuid) .
|
||||
BIND(IRI(CONCAT("http://data.lblod.info/id/adressen/", STR(?newAddressUuid))) AS ?newAddressUri) .
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?membership ?p ?o .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH ?g {
|
||||
# Find memberships that use the general 'gerelateerd' role
|
||||
?membership a org:Membership ;
|
||||
org:role <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> ;
|
||||
org:member ?orgMember ;
|
||||
org:organization ?organization .
|
||||
|
||||
# Only delete if there's a specific role for the inverse membership
|
||||
FILTER EXISTS {
|
||||
?specific_membership a org:Membership ;
|
||||
org:member ?organization ;
|
||||
org:organization ?orgMember ;
|
||||
org:role ?specificRole .
|
||||
|
||||
VALUES ?specificRole {
|
||||
<http://data.lblod.info/id/rollen/2152eb830b1143bfb97a7dd9596d6c63> # participant
|
||||
<http://data.lblod.info/id/rollen/73d5e1cf250d42fab15926771f07505a> # stichtend lid
|
||||
}
|
||||
}
|
||||
|
||||
?membership ?p ?o .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?address ?p ?o .
|
||||
}
|
||||
} INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?address ?p ?o .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/worship-service> {
|
||||
?contactPoint a <http://schema.org/ContactPoint> ;
|
||||
<http://www.w3.org/ns/locn#address> ?address .
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?address ?p ?o .
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?membership org:organization ?ocmw ;
|
||||
org:member ?municipality .
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?membership org:organization ?municipality ;
|
||||
org:member ?ocmw .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?membership a org:Membership ;
|
||||
org:organization ?ocmw ;
|
||||
org:member ?municipality ;
|
||||
org:role <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> .
|
||||
}
|
||||
|
||||
GRAPH ?graphMunicipality {
|
||||
?municipality org:classification <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001> .
|
||||
}
|
||||
|
||||
GRAPH ?graphOCMW {
|
||||
?ocmw org:classification <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002> .
|
||||
}
|
||||
|
||||
FILTER NOT EXISTS {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?correctMembership a org:Membership ;
|
||||
org:organization ?municipality ;
|
||||
org:member ?ocmw ;
|
||||
org:role <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> .
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?duplicateMembership ?p ?o .
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?duplicateMembership a org:Membership ;
|
||||
org:organization ?ocmw ;
|
||||
org:member ?municipality ;
|
||||
org:role <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> ;
|
||||
?p ?o .
|
||||
|
||||
# Find the other memberships with swapped organizations
|
||||
?correctMembership a org:Membership ;
|
||||
org:organization ?municipality ;
|
||||
org:member ?ocmw ;
|
||||
org:role <http://data.lblod.info/id/rollen/4ec7d5c39bdc4e84b4174379b9e22ad8> .
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/shared> {
|
||||
?municipality org:classification ?municipalityClassification .
|
||||
}
|
||||
|
||||
GRAPH <http://mu.semte.ch/graphs/administrative-unit> {
|
||||
?ocmw org:classification ?ocmwClassification .
|
||||
}
|
||||
|
||||
FILTER(?municipalityClassification = <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001>)
|
||||
FILTER(?ocmwClassification = <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002>)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
DELETE {
|
||||
GRAPH ?g {
|
||||
?s ?p ?date .
|
||||
}
|
||||
}
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?s ?p ?dateTime .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?g {
|
||||
<http://mu.semte.ch/graphs/administrative-unit>
|
||||
<http://mu.semte.ch/graphs/worship-service>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?s a <http://mu.semte.ch/vocabularies/ext/KboOrganisatie> ;
|
||||
?p ?date .
|
||||
|
||||
VALUES ?p {
|
||||
<http://purl.org/dc/terms/modified>
|
||||
<http://mu.semte.ch/vocabularies/ext/startDate>
|
||||
}
|
||||
|
||||
BIND(STRDT(CONCAT(STR(?date), "T02:00:00"), xsd:dateTime) AS ?dateTime)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX ext:<http://mu.semte.ch/vocabularies/ext/>
|
||||
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
?account ext:sessionRole "LoketLB-AdminDashboardOrganisatiePortaalGebruiker" .
|
||||
}
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?account {
|
||||
<http://data.lblod.info/id/account/3a91ff60-07c1-4136-ac5e-55cf401e0956>
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?account ext:sessionRole ?role .
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,25 @@
|
||||
import { generateReportFromData, batchedQuery } from '../helpers.js';
|
||||
import { PREFIXES } from './utils'
|
||||
import { generateReportFromData, batchedQuery } from "../helpers.js";
|
||||
import { PREFIXES } from "./utils";
|
||||
|
||||
export default {
|
||||
cronPattern: '0 00 23 * * *',
|
||||
name: 'organizations',
|
||||
cronPattern: "0 00 23 * * *",
|
||||
name: "organizations",
|
||||
execute: async () => {
|
||||
const reportData = {
|
||||
title: 'organizations',
|
||||
description: 'List of the Organizations',
|
||||
filePrefix: 'exports/organizations'
|
||||
title: "organizations",
|
||||
description: "List of the Organizations",
|
||||
filePrefix: "exports/organizations",
|
||||
};
|
||||
|
||||
console.log('Generating organizations report');
|
||||
console.log("Generating organizations report");
|
||||
|
||||
const queryStringPart1 = `
|
||||
${PREFIXES}
|
||||
|
||||
SELECT DISTINCT ?bestuur ?label ?classification ?typeEredienst
|
||||
WHERE {
|
||||
VALUES ?type {
|
||||
org:Organization
|
||||
besluit:Bestuurseenheid
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?bestuur a ?type .
|
||||
?bestuur a org:Organization .
|
||||
OPTIONAL { ?bestuur skos:prefLabel ?label. }
|
||||
}
|
||||
|
||||
@@ -44,12 +39,12 @@ export default {
|
||||
|
||||
const queryResponsePart1 = await batchedQuery(queryStringPart1);
|
||||
|
||||
const dataPart1 = queryResponsePart1.results.bindings.reduce( (acc, row) => {
|
||||
acc[getSafeValue(row, 'bestuur')] = {
|
||||
bestuur: getSafeValue(row, 'bestuur'),
|
||||
label: getSafeValue(row, 'label'),
|
||||
classification: getSafeValue(row, 'classification'),
|
||||
typeEredienst: getSafeValue(row, 'typeEredienst'),
|
||||
const dataPart1 = queryResponsePart1.results.bindings.reduce((acc, row) => {
|
||||
acc[getSafeValue(row, "bestuur")] = {
|
||||
bestuur: getSafeValue(row, "bestuur"),
|
||||
label: getSafeValue(row, "label"),
|
||||
classification: getSafeValue(row, "classification"),
|
||||
typeEredienst: getSafeValue(row, "typeEredienst"),
|
||||
};
|
||||
return acc;
|
||||
}, {});
|
||||
@@ -59,17 +54,12 @@ export default {
|
||||
|
||||
SELECT DISTINCT ?bestuur ?provincie
|
||||
WHERE {
|
||||
VALUES ?type {
|
||||
org:Organization
|
||||
besluit:Bestuurseenheid
|
||||
}
|
||||
|
||||
GRAPH ?g {
|
||||
?bestuur a ?type .
|
||||
?bestuur a org:Organization .
|
||||
}
|
||||
|
||||
GRAPH ?h {
|
||||
OPTIONAL {
|
||||
OPTIONAL {
|
||||
GRAPH ?h {
|
||||
?bestuur org:hasPrimarySite ?primarySite.
|
||||
|
||||
OPTIONAL {
|
||||
@@ -77,35 +67,37 @@ export default {
|
||||
OPTIONAL { ?sa locn:adminUnitL2 ?provincie. }
|
||||
}
|
||||
}
|
||||
FILTER (?h IN ( <http://mu.semte.ch/graphs/administrative-unit>, <http://mu.semte.ch/graphs/worship-service> ))
|
||||
}
|
||||
|
||||
FILTER (?g IN ( <http://mu.semte.ch/graphs/administrative-unit>, <http://mu.semte.ch/graphs/worship-service>, <http://mu.semte.ch/graphs/shared>))
|
||||
FILTER (?h IN ( <http://mu.semte.ch/graphs/administrative-unit>, <http://mu.semte.ch/graphs/worship-service>, <http://mu.semte.ch/graphs/shared>))
|
||||
|
||||
}
|
||||
`;
|
||||
|
||||
const queryResponsePart2 = await batchedQuery(queryStringPart2);
|
||||
const dataPart2 = queryResponsePart2.results.bindings.reduce( (acc, row) => {
|
||||
const dataPart2 = queryResponsePart2.results.bindings.reduce((acc, row) => {
|
||||
let dataPart = {
|
||||
bestuur: getSafeValue(row, 'bestuur'),
|
||||
provincie: getSafeValue(row, 'provincie')
|
||||
bestuur: getSafeValue(row, "bestuur"),
|
||||
provincie: getSafeValue(row, "provincie"),
|
||||
};
|
||||
|
||||
acc[getSafeValue(row, 'bestuur')] = Object.assign(dataPart, dataPart1[getSafeValue(row, 'bestuur')]);
|
||||
acc[getSafeValue(row, "bestuur")] = Object.assign(
|
||||
dataPart,
|
||||
dataPart1[getSafeValue(row, "bestuur")],
|
||||
);
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
await generateReportFromData(Object.values(dataPart2), [
|
||||
'bestuur',
|
||||
'label',
|
||||
'classification',
|
||||
'typeEredienst',
|
||||
'provincie'
|
||||
], reportData);
|
||||
}
|
||||
await generateReportFromData(
|
||||
Object.values(dataPart2),
|
||||
["bestuur", "label", "classification", "typeEredienst", "provincie"],
|
||||
reportData,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
function getSafeValue(entry, property){
|
||||
function getSafeValue(entry, property) {
|
||||
return entry[property] ? wrapInQuote(entry[property].value) : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -469,6 +469,7 @@
|
||||
"inverse": true
|
||||
}
|
||||
},
|
||||
"features": ["include-uri"],
|
||||
"new-resource-base": "http://data.lblod.info/id/organisaties/"
|
||||
},
|
||||
"administrative-units": {
|
||||
@@ -944,7 +945,7 @@
|
||||
"located-within": {
|
||||
"predicate": "geo:sfWithin",
|
||||
"target": "locations",
|
||||
"cardinality": "one"
|
||||
"cardinality": "many"
|
||||
},
|
||||
"locations": {
|
||||
"predicate": "geo:sfWithin",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
https://{$OP_ADDRESS} {
|
||||
https://{$APPLICATION_ADDRESS} {
|
||||
reverse_proxy identifier:80
|
||||
tls internal
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@ services:
|
||||
restart: "no"
|
||||
login:
|
||||
restart: "no"
|
||||
login-dashboard:
|
||||
restart: "no"
|
||||
accountdetail:
|
||||
restart: "no"
|
||||
privacy-unit:
|
||||
@@ -50,6 +52,10 @@ services:
|
||||
restart: "no"
|
||||
frontend:
|
||||
restart: "no"
|
||||
frontend-dashboard:
|
||||
environment:
|
||||
EMBER_LOGIN_ROUTE: "mock-login"
|
||||
restart: "no"
|
||||
uri-info:
|
||||
restart: "no"
|
||||
delta-producer-background-jobs-initiator:
|
||||
@@ -74,6 +80,8 @@ services:
|
||||
restart: "no"
|
||||
construct-organization-relationships:
|
||||
restart: "no"
|
||||
scope-of-operation:
|
||||
restart: "no"
|
||||
mandatarissen-consumer:
|
||||
restart: "no"
|
||||
leidinggevenden-consumer:
|
||||
|
||||
@@ -114,7 +114,7 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
deltanotifier:
|
||||
image: cecemel/delta-notifier:0.2.0-beta.2
|
||||
image: semtech/mu-delta-notifier:0.4.0
|
||||
volumes:
|
||||
- ./config/delta:/config
|
||||
labels:
|
||||
@@ -122,7 +122,7 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
sink:
|
||||
image: nginx:1.15.2
|
||||
image: nginx:1.25.1
|
||||
volumes:
|
||||
- ./config/sink/sink.conf:/etc/nginx/conf.d/default.conf
|
||||
labels:
|
||||
@@ -130,7 +130,7 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
login:
|
||||
image: lblod/acmidm-login-service:0.9.2
|
||||
image: lblod/acmidm-login-service:0.12.0
|
||||
environment:
|
||||
MU_APPLICATION_AUTH_USERID_CLAIM: "vo_id"
|
||||
MU_APPLICATION_GRAPH: "http://mu.semte.ch/graphs/contacthub/accounts"
|
||||
@@ -145,14 +145,22 @@ services:
|
||||
logging: *default-logging
|
||||
links:
|
||||
- db:database
|
||||
dashboard-login:
|
||||
image: semtech/mu-login-service:3.0.0
|
||||
links:
|
||||
- db:database
|
||||
login-dashboard:
|
||||
image: lblod/acmidm-login-service:0.12.0
|
||||
environment:
|
||||
LOG_SINK_URL: "http://sink"
|
||||
MU_APPLICATION_AUTH_ROLE_CLAIM: "abb_organisatieportaal_rol_2d"
|
||||
MU_APPLICATION_AUTH_USERID_CLAIM: "vo_id"
|
||||
MU_APPLICATION_AUTH_DISCOVERY_URL: "<ACM_IDM_AUTH_DISCOVERY_URL>"
|
||||
MU_APPLICATION_AUTH_CLIENT_ID: "<ACM_IDM_AUTH_CLIENT_ID>"
|
||||
MU_APPLICATION_AUTH_REDIRECT_URI: "<ACMIDM_AUTH_REDIRECT_URI>"
|
||||
MU_APPLICATION_AUTH_CLIENT_SECRET: "<ACMIDM_AUTH_CLIENT_SECRET>"
|
||||
labels:
|
||||
- "logging=true"
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
links:
|
||||
- db:database
|
||||
accountdetail:
|
||||
image: lblod/account-detail-service:0.1.0
|
||||
labels:
|
||||
@@ -194,7 +202,7 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
frontend:
|
||||
image: lblod/frontend-organization-portal:1.32.0
|
||||
image: lblod/frontend-organization-portal:1.34.1
|
||||
volumes:
|
||||
- ./config/frontend/add-x-frame-options-header.conf:/config/add-x-frame-options.conf
|
||||
environment:
|
||||
@@ -209,7 +217,15 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
frontend-dashboard:
|
||||
image: lblod/frontend-dashboard:1.7.0
|
||||
image: lblod/frontend-dashboard:1.10.0
|
||||
environment:
|
||||
EMBER_LOGIN_ROUTE: "acmidm-login"
|
||||
EMBER_ACMIDM_CLIENT_ID: "<CLIENT_ID>"
|
||||
EMBER_ACMIDM_BASE_URL: "<BASE_URL>"
|
||||
EMBER_ACMIDM_REDIRECT_URL: "<REDIRECT_URL>"
|
||||
EMBER_ACMIDM_LOGOUT_URL: "<LOGOUT_URL>"
|
||||
EMBER_ACMIDM_SCOPE: "openid vo profile abb_organisatieportaal"
|
||||
EMBER_ENGLISH_ACCOUNTS_MODEL: true
|
||||
labels:
|
||||
- "logging=true"
|
||||
restart: always
|
||||
@@ -285,8 +301,16 @@ services:
|
||||
- "logging=true"
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
scope-of-operation:
|
||||
image: lblod/scope-of-operation-service:0.1.1
|
||||
links:
|
||||
- db:database
|
||||
labels:
|
||||
- "logging=true"
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
report-generation:
|
||||
image: lblod/loket-report-generation-service:0.7.0
|
||||
image: lblod/loket-report-generation-service:0.8.3
|
||||
environment:
|
||||
DEFAULT_GRAPH: "http://mu.semte.ch/graphs/shared"
|
||||
ONLY_KEEP_LATEST_REPORT: "true"
|
||||
@@ -310,7 +334,7 @@ services:
|
||||
restart: always
|
||||
logging: *default-logging
|
||||
kbo-data-sync:
|
||||
image: lblod/sync-wegwijs-organization-service:2.0.3
|
||||
image: lblod/sync-wegwijs-organization-service:2.0.4
|
||||
links:
|
||||
- db:database
|
||||
labels:
|
||||
|
||||
@@ -1,6 +1,38 @@
|
||||
{
|
||||
"version": "0.1",
|
||||
"scripts": [
|
||||
{
|
||||
"documentation": {
|
||||
"command": "create-export",
|
||||
"description": "create export of administrative units and their bodies",
|
||||
"arguments": []
|
||||
},
|
||||
"environment": {
|
||||
"image": "nvdk/ruby-semantic-works-cli",
|
||||
"interactive": true,
|
||||
"script": "export/run.rb",
|
||||
"join_networks": true
|
||||
},
|
||||
"mounts": {
|
||||
"app": "/app/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"documentation": {
|
||||
"command": "correct-location-labels",
|
||||
"description": "generate migrations to correct the labels of aggregated locations",
|
||||
"arguments": []
|
||||
},
|
||||
"environment": {
|
||||
"image": "nvdk/ruby-semantic-works-cli",
|
||||
"interactive": true,
|
||||
"script": "correct-location-labels/run.rb",
|
||||
"join_networks": true
|
||||
},
|
||||
"mounts": {
|
||||
"app": "/app/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"documentation": {
|
||||
"command": "mu-search-delta",
|
||||
@@ -16,21 +48,6 @@
|
||||
"mounts": {
|
||||
"app": "/data/app/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"documentation": {
|
||||
"command": "generate-dashboard-login",
|
||||
"description": "generate a login account for the jobs dashboard",
|
||||
"arguments": []
|
||||
},
|
||||
"environment": {
|
||||
"image": "ruby",
|
||||
"interactive": true,
|
||||
"script": "generate-dashboard-login/run.sh"
|
||||
},
|
||||
"mounts": {
|
||||
"app": "/project/"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
106
scripts/project/correct-location-labels/run.rb
Executable file
106
scripts/project/correct-location-labels/run.rb
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'date'
|
||||
require 'rdf/turtle'
|
||||
require 'fileutils'
|
||||
|
||||
$stdout.sync = true
|
||||
ENV['LOG_SPARQL_ALL']='false'
|
||||
ENV['MU_SPARQL_ENDPOINT']='http://triplestore:8890/sparql'
|
||||
ENV['MU_SPARQL_TIMEOUT']='180'
|
||||
require 'mu/auth-sudo'
|
||||
|
||||
def ensure_dir(path)
|
||||
unless Dir.exist?(path)
|
||||
FileUtils.mkdir_p(path)
|
||||
end
|
||||
end
|
||||
|
||||
def sparql_escape_uri(value)
|
||||
'<' + value.to_s.gsub(/[\\"<>]/) { |s| '\\' + s } + '>'
|
||||
end
|
||||
|
||||
def sparql_escape_string(str)
|
||||
'"""' + str.gsub(/[\\"]/) { |s| '\\' + s } + '"""'
|
||||
end
|
||||
|
||||
def get_locations()
|
||||
query = <<~EOF
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
|
||||
SELECT DISTINCT ?location ?label
|
||||
WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?location a prov:Location ;
|
||||
rdfs:label ?label ;
|
||||
ext:werkingsgebiedNiveau """Samengesteld werkingsgebied""" .
|
||||
}
|
||||
}
|
||||
EOF
|
||||
Mu::AuthSudo.query(query)
|
||||
end
|
||||
|
||||
def sort_literal(literal)
|
||||
literal
|
||||
.humanize
|
||||
.split(", ")
|
||||
.sort
|
||||
.join(", ")
|
||||
end
|
||||
|
||||
# Create output directory
|
||||
timestamp=`date +%Y%0m%0d%0H%0M%0S`.strip.to_i
|
||||
output_dir = "/app/config/migrations/local/2025/#{timestamp}-correct-labels-aggregate-locations/"
|
||||
ensure_dir(output_dir)
|
||||
|
||||
|
||||
# Generate SPARQL migration to remove existing labels
|
||||
path = File.join(output_dir, "#{timestamp}-remove-labels-aggregate-locations.sparql")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write <<EOF
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?location rdfs:label ?label
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?location a prov:Location ;
|
||||
rdfs:label ?label ;
|
||||
ext:werkingsgebiedNiveau """Samengesteld werkingsgebied""" .
|
||||
}
|
||||
}
|
||||
EOF
|
||||
end
|
||||
|
||||
|
||||
# Generate TTL migration to insert alphabetically sorted labels
|
||||
timestamp += 1
|
||||
filename = "#{timestamp}-insert-labels-aggregate-locations"
|
||||
|
||||
path = File.join(output_dir, "#{filename}.graph")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write <<EOF
|
||||
http://mu.semte.ch/graphs/public
|
||||
EOF
|
||||
end
|
||||
|
||||
path = File.join(output_dir, "#{filename}.ttl")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write <<EOF
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
EOF
|
||||
end
|
||||
|
||||
locations = get_locations()
|
||||
locations.each do |location|
|
||||
File.open(path, 'a') do |file|
|
||||
file.write <<EOF
|
||||
#{sparql_escape_uri(location[:location])} rdfs:label "#{(sort_literal(location[:label]))}" .
|
||||
EOF
|
||||
end
|
||||
end
|
||||
22
scripts/project/export/enrichment.owl
Normal file
22
scripts/project/export/enrichment.owl
Normal file
@@ -0,0 +1,22 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
||||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix generiek: <https://data.vlaanderen.be/ns/generiek#> .
|
||||
@prefix mandaat: <http://data.vlaanderen.be/ns/mandaat#> .
|
||||
@prefix org: <http://www.w3.org/ns/org#> .
|
||||
@prefix besluit: <http://data.vlaanderen.be/ns/besluit#> .
|
||||
@prefix ere: <http://data.lblod.info/vocabularies/erediensten/> .
|
||||
|
||||
<http://lblod.data.gift/mappings.owl> a owl:Ontology .
|
||||
|
||||
# Equivalent Properties
|
||||
generiek:isTijdspecialisatieVan owl:equivalentProperty
|
||||
<http://data.vlaanderen.be/ns/generiek#isTijdspecialisatieVan>,
|
||||
mandaat:isTijdspecialisatieVan .
|
||||
org:classification owl:equivalentProperty besluit:classificatie .
|
||||
generiek:gestructureerdeIdentificator owl:equivalentProperty <http://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator>.
|
||||
|
||||
# Subclass mappings
|
||||
ere:BestuurVanDeEredienst rdfs:subClassOf besluit:Bestuurseenheid .
|
||||
ere:CentraalBestuurVanDeEredienst rdfs:subClassOf besluit:Bestuurseenheid .
|
||||
ere:RepresentatiefOrgaan rdfs:subClassOf besluit:Bestuurseenheid.
|
||||
358
scripts/project/export/run.rb
Executable file
358
scripts/project/export/run.rb
Executable file
@@ -0,0 +1,358 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'bundler/inline'
|
||||
require 'yaml'
|
||||
require 'securerandom'
|
||||
require 'date'
|
||||
require 'rdf/vocab'
|
||||
require 'tty-prompt'
|
||||
require 'rdf/turtle'
|
||||
require 'rdf/reasoner'
|
||||
|
||||
$stdout.sync = true
|
||||
ENV['LOG_SPARQL_ALL']='false'
|
||||
ENV['MU_SPARQL_ENDPOINT']='http://triplestore:8890/sparql'
|
||||
ENV['MU_SPARQL_TIMEOUT']='180'
|
||||
require 'mu/auth-sudo'
|
||||
|
||||
|
||||
|
||||
def sparql_escape_uri(value)
|
||||
'<' + value.to_s.gsub(/[\\"<>]/) { |s| '\\' + s } + '>'
|
||||
end
|
||||
|
||||
def sparql_escape_string(str)
|
||||
'"""' + str.gsub(/[\\"]/) { |s| '\\' + s } + '"""'
|
||||
end
|
||||
|
||||
def search_classifications
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
SELECT DISTINCT ?type ?name ?classification WHERE {
|
||||
?org a ?type;
|
||||
org:classification ?classification.
|
||||
?classification skos:prefLabel ?name.
|
||||
VALUES ?type { besluit:Bestuurseenheid }
|
||||
} ORDER BY ?name
|
||||
EOF
|
||||
Mu::AuthSudo.query(query)
|
||||
end
|
||||
|
||||
def get_admin_units(classifications)
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
SELECT DISTINCT ?org ?name WHERE {
|
||||
?org a ?type;
|
||||
skos:prefLabel ?name;
|
||||
org:classification ?classification.
|
||||
VALUES ?type { besluit:Bestuurseenheid }
|
||||
VALUES ?classification { #{classifications.map{ |c| sparql_escape_uri(c) }.join(" ")}}
|
||||
}
|
||||
EOF
|
||||
Mu::AuthSudo.query(query)
|
||||
end
|
||||
|
||||
def export_admin_unit(unit)
|
||||
repository = RDF::Repository.new
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
CONSTRUCT {
|
||||
?org ?p ?o
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?org { #{sparql_escape_uri(unit)}}
|
||||
?org ?p ?o.
|
||||
VALUES ?p {
|
||||
rdf:type
|
||||
org:classification
|
||||
besluit:classificatie
|
||||
skos:prefLabel
|
||||
<http://mu.semte.ch/vocabularies/core/uuid>
|
||||
<http://www.w3.org/ns/regorg#orgStatus>
|
||||
<http://data.lblod.info/vocabularies/erediensten/betrokkenBestuur>
|
||||
}
|
||||
}
|
||||
EOF
|
||||
repository << Mu::AuthSudo.query(query)
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
CONSTRUCT {
|
||||
?org <http://www.w3.org/ns/adms#identifier> ?id.
|
||||
?id ?p ?o.
|
||||
?id skos:notation ?localId.
|
||||
?id <http://www.w3.org/ns/adms#schemaAgency> ?source.
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?org { #{sparql_escape_uri(unit)}}
|
||||
?org <http://www.w3.org/ns/adms#identifier> ?id.
|
||||
?id ?p ?o.
|
||||
FILTER (?p NOT IN(<http://www.w3.org/2004/02/skos/core#notation>, <https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator>))
|
||||
?id <http://www.w3.org/2004/02/skos/core#notation> ?source.
|
||||
FILTER(?source != "SharePoint identificator")
|
||||
?id <https://data.vlaanderen.be/ns/generiek#gestructureerdeIdentificator> ?gestructureerdeIdentificator.
|
||||
?gestructureerdeIdentificator <https://data.vlaanderen.be/ns/generiek#lokaleIdentificator> ?localId
|
||||
}
|
||||
EOF
|
||||
repository << Mu::AuthSudo.query(query)
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
CONSTRUCT {
|
||||
?org besluit:werkingsgebied ?gebied.
|
||||
?gebied ?p ?o.
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?org { #{sparql_escape_uri(unit)}}
|
||||
?org besluit:werkingsgebied ?gebied.
|
||||
?gebied ?p ?o
|
||||
}
|
||||
EOF
|
||||
repository << Mu::AuthSudo.query(query)
|
||||
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX mandaat: <https://data.vlaanderen.be/ns/mandaat#>
|
||||
CONSTRUCT {
|
||||
?bestuursorgaan ?bp ?bo.
|
||||
?bestuursorgaanIntijd generiek:isTijdspecialisatieVan ?bestuursorgaan.
|
||||
?bestuursorgaanIntijd ?bop ?boo.
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?org { #{sparql_escape_uri(unit)}}
|
||||
?bestuursorgaan besluit:bestuurt ?org.
|
||||
?bestuursorgaan ?bp ?bo.
|
||||
values ?tijdspecialisatie {
|
||||
generiek:isTijdspecialisatieVan
|
||||
mandaat:isTijdspecialisatieVan
|
||||
}
|
||||
?bestuursorgaanIntijd ?tijdspecialisatie ?bestuursorgaan.
|
||||
?bestuursorgaanIntijd ?bop ?boo.
|
||||
}
|
||||
|
||||
EOF
|
||||
repository << Mu::AuthSudo.query(query)
|
||||
query = <<~EOF
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
CONSTRUCT {
|
||||
?mandaat ?p ?o.
|
||||
?role ?roleP ?roleO.
|
||||
}
|
||||
WHERE {
|
||||
VALUES ?org { #{sparql_escape_uri(unit)}}
|
||||
?bestuursorgaan besluit:bestuurt ?org.
|
||||
?bestuursorgaanIntijd generiek:isTijdspecialisatieVan ?bestuursorgaan.
|
||||
VALUES ?post { org:hasPost <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie>}
|
||||
?bestuursorgaanIntijd ?post ?mandaat.
|
||||
?mandaat ?p ?o.
|
||||
?mandaat org:role ?role.
|
||||
OPTIONAL {
|
||||
?role ?roleP ?roleO.
|
||||
FILTER(!STRSTARTS(STR(?role), "http://data.vlaanderen.be"))
|
||||
}
|
||||
}
|
||||
EOF
|
||||
repository << Mu::AuthSudo.query(query)
|
||||
repository
|
||||
end
|
||||
|
||||
def ensure_dir(path)
|
||||
unless Dir.exist?(path)
|
||||
Dir.mkdir(path)
|
||||
end
|
||||
end
|
||||
|
||||
def sanitize_unix_path(path)
|
||||
# Regular expression to match characters not allowed in Unix paths
|
||||
sanitized_path = path.gsub(/[^a-zA-Z0-9._\-\/]/, '-')
|
||||
sanitized_path
|
||||
end
|
||||
|
||||
|
||||
def enrich_graph(data)
|
||||
RDF::Reasoner.apply(:owl,:rdfs)
|
||||
graph = RDF::Graph.load("./enrichment.owl")
|
||||
graph << clean_up_dates(data)
|
||||
graph.entail!(:subClassOf)
|
||||
graph.entail!(:equivalentProperty)
|
||||
graph
|
||||
end
|
||||
|
||||
DATE_PREDICATES=[
|
||||
RDF::URI("http://data.vlaanderen.be/ns/mandaat#bindingStart"),
|
||||
RDF::URI("http://data.vlaanderen.be/ns/mandaat#bindingEinde"),
|
||||
RDF::URI("https://data.vlaanderen.be/ns/generiek#bindingStart"),
|
||||
RDF::URI("https://data.vlaanderen.be/ns/generiek#bindingEinde")
|
||||
]
|
||||
|
||||
def convert_date_to_datetime(date_literal)
|
||||
begin
|
||||
date = Date.parse(date_literal.to_s)
|
||||
datetime = DateTime.new(date.year, date.month, date.day)
|
||||
RDF::Literal.new(datetime.strftime("%Y-%m-%dT%T"), datatype: RDF::XSD.dateTime)
|
||||
rescue ArgumentError => e
|
||||
puts "Invalid date format for #{date_literal}: #{e.message}"
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def clean_up_dates(data)
|
||||
clean_data = RDF::Graph.new
|
||||
data.each_statement do |statement|
|
||||
if DATE_PREDICATES.include?(statement.predicate)
|
||||
obj = statement.object
|
||||
if obj.is_a?(RDF::Literal) && obj.datatype == RDF::XSD.date
|
||||
new_object = convert_date_to_datetime(obj)
|
||||
if new_object
|
||||
clean_data << [statement.subject, statement.predicate, new_object] # Add the new statement
|
||||
end
|
||||
elsif obj.is_a?(RDF::Literal) && obj.datatype == RDF::XSD.dateTime
|
||||
clean_data << statement
|
||||
else
|
||||
puts "unexpected value #{obj.inspect}for statement:\n #{statement.inspect}"
|
||||
end
|
||||
else
|
||||
clean_data << statement
|
||||
end
|
||||
end
|
||||
clean_data
|
||||
end
|
||||
|
||||
prompt = TTY::Prompt.new
|
||||
prompt.say("\n\n")
|
||||
prompt.say("This script will help you export administrative units and their respective bodies")
|
||||
options = search_classifications.map do |binding|
|
||||
{name: "#{binding[:name]}", value: binding[:classification]}
|
||||
end
|
||||
|
||||
if options.size > 0
|
||||
classifications = prompt.multi_select("Please select the matching admin unit classifications", options)
|
||||
admin_units = get_admin_units(classifications)
|
||||
prompt.say("found #{admin_units.size} admin units")
|
||||
output_dir = prompt.ask("Provide the directory the exports should be written to?", default: "/app/exports/")
|
||||
ensure_dir(output_dir)
|
||||
admin_units.each do |unit|
|
||||
repo = export_admin_unit(unit[:org])
|
||||
repo = enrich_graph(repo)
|
||||
file_name = sanitize_unix_path(unit[:name].to_s)
|
||||
timestamp=`date +%Y%0m%0d%0H%0M%0S`.strip.to_i
|
||||
path = File.join(output_dir, "#{timestamp}-remove-data-#{file_name}-bestuurseenheid.sparql")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write <<EOF
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?id ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
<#{unit[:org]}> <http://www.w3.org/ns/adms#identifier> ?id.
|
||||
?id ?p ?o.
|
||||
}
|
||||
};
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?gebied ?p ?o.
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
<#{unit[:org]}> besluit:werkingsgebied ?gebied.
|
||||
?gebied ?p ?o.
|
||||
}
|
||||
};
|
||||
DELETE WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
<#{unit[:org]}> ?p ?o
|
||||
}
|
||||
};
|
||||
EOF
|
||||
end
|
||||
path = File.join(output_dir, "#{timestamp}-remove-data-#{file_name}-bestuursorganen.sparql")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write <<EOF
|
||||
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
||||
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
||||
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
||||
PREFIX org: <http://www.w3.org/ns/org#>
|
||||
PREFIX prov: <http://www.w3.org/ns/prov#>
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?mandaat ?p ?o
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaan besluit:bestuurt <#{unit[:org]}> .
|
||||
?bestuursorgaanIntijd mandaat:isTijdspecialisatieVan ?bestuursorgaan.
|
||||
VALUES ?post { org:hasPost <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie>}
|
||||
?bestuursorgaanIntijd ?post ?mandaat.
|
||||
?mandaat ?p ?o.
|
||||
}
|
||||
};
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?mandaat ?p ?o
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaan besluit:bestuurt <#{unit[:org]}> .
|
||||
?bestuursorgaanIntijd mandaat:isTijdspecialisatieVan ?bestuursorgaan.
|
||||
VALUES ?post { org:hasPost <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie>}
|
||||
?bestuursorgaanIntijd ?post ?mandaat.
|
||||
?mandaat ?p ?o.
|
||||
}
|
||||
};
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaanIntijd ?p ?o
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaan besluit:bestuurt <#{unit[:org]}> .
|
||||
?bestuursorgaanIntijd mandaat:isTijdspecialisatieVan ?bestuursorgaan.
|
||||
VALUES ?post { org:hasPost <http://data.lblod.info/vocabularies/leidinggevenden/heeftBestuursfunctie>}
|
||||
?bestuursorgaanIntijd ?p ?o
|
||||
}
|
||||
};
|
||||
DELETE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaan ?p ?o
|
||||
}
|
||||
} WHERE {
|
||||
GRAPH <http://mu.semte.ch/graphs/public> {
|
||||
?bestuursorgaan besluit:bestuurt <#{unit[:org]}>; ?p ?o
|
||||
}
|
||||
}
|
||||
EOF
|
||||
end
|
||||
timestamp+=1
|
||||
path = File.join(output_dir, "#{timestamp}-#{SecureRandom.uuid}-#{file_name}.ttl")
|
||||
File.open(path, 'w') do |file|
|
||||
file.write repo.dump(:ttl)
|
||||
end
|
||||
prompt.say("Exported #{repo.size} statements to #{path}")
|
||||
end
|
||||
else
|
||||
abort("No classifications found?")
|
||||
end
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'bundler/inline'
|
||||
require 'yaml'
|
||||
require 'securerandom'
|
||||
require 'date'
|
||||
|
||||
$stdout.sync = true
|
||||
print "installing dependencies..."
|
||||
gemfile do
|
||||
source 'https://rubygems.org'
|
||||
gem 'bcrypt'
|
||||
end
|
||||
puts "done"
|
||||
|
||||
salt = ""
|
||||
begin
|
||||
File.open("/project/docker-compose.override.yml") do |file|
|
||||
config = YAML.load(file)
|
||||
salt = config.dig("services", "dashboard-login", "environment", "MU_APPLICATION_SALT")
|
||||
throw "invalid salt" unless salt
|
||||
end
|
||||
rescue
|
||||
puts "Tried to locate login salt in docker-compose.override.yml, but couldn't find it."
|
||||
puts "Please make sure a salt is configured:"
|
||||
puts <<EOF
|
||||
login:
|
||||
restart: "no"
|
||||
environment:
|
||||
MU_APPLICATION_SALT: "#{SecureRandom.hex}"
|
||||
EOF
|
||||
end
|
||||
|
||||
puts "this script will generate a new user account"
|
||||
print "username: "
|
||||
STDOUT.flush
|
||||
account_name = STDIN.gets.chomp
|
||||
|
||||
print "password: "
|
||||
STDOUT.flush
|
||||
password = STDIN.gets.chomp
|
||||
|
||||
account_salt = SecureRandom.hex
|
||||
person_uuid = SecureRandom.uuid
|
||||
account_uuid = SecureRandom.uuid
|
||||
domain = "data.gift"
|
||||
hashed_password = BCrypt::Password.create(password + salt + account_salt)
|
||||
now = DateTime.now.xmlschema
|
||||
query = %(
|
||||
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
||||
PREFIX people: <http://#{domain}/people/>
|
||||
PREFIX accounts: <http://#{domain}/accounts/>
|
||||
PREFIX dcterms: <http://purl.org/dc/terms/>
|
||||
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
||||
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
||||
PREFIX account: <http://mu.semte.ch/vocabularies/account/>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
INSERT DATA {
|
||||
GRAPH <http://mu.semte.ch/application> {
|
||||
people:#{person_uuid} a foaf:Person ;
|
||||
foaf:name "#{account_name}";
|
||||
foaf:account accounts:#{account_uuid};
|
||||
mu:uuid "#{person_uuid}";
|
||||
dcterms:created "#{now}"^^xsd:datetime;
|
||||
dcterms:modified "#{now}"^^xsd:datetime.
|
||||
accounts:#{account_uuid} a foaf:OnlineAccount;
|
||||
foaf:accountName "#{account_name}";
|
||||
mu:uuid "#{account_uuid}";
|
||||
account:password """#{hashed_password}""";
|
||||
account:salt "#{account_salt}";
|
||||
account:status <http://mu.semte.ch/vocabularies/account/status/active>;
|
||||
dcterms:created "#{now}"^^xsd:datetime;
|
||||
ext:sessionRole "dashboard-user";
|
||||
dcterms:modified "#{now}"^^xsd:datetime.
|
||||
}}
|
||||
)
|
||||
|
||||
timestamp = DateTime.now.strftime("%Y%m%d%H%M%L")
|
||||
filename = "#{timestamp}-create-user-#{account_name.gsub(" ", "-")}.sparql"
|
||||
File.write("/project/config/migrations/local/#{filename}", query)
|
||||
puts "generated migration ./config/migrations/local/#{filename} for #{account_name.inspect} : #{password.inspect}"
|
||||
Reference in New Issue
Block a user