Merge pull request #628 from lblod/OP-3835-add-columns-to-existing-administrative-units-query

OP-3835: add columns to existing administrative units query
This commit is contained in:
Damon Kennes
2026-09-03 14:40:02 +02:00
committed by GitHub
3 changed files with 43 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
- fix duplicate van rechtswege/grote helft mandates [OP-3851]
- IMPORTANT NOTE: Make sure first the loket migration has completed + data has flown from loket to OP
- Add missing headers to identifier calls
- Add columns to administrative units report [OP-3835]
### Deploy notes
```
@@ -80,7 +81,7 @@ drc restart migrations mandatarissen-consumer
```
```
drc restart migrations
drc restart migrations report-generation
drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/public/healing-jobs
drc up -d construct-organization-relationships
```

View File

@@ -18,13 +18,18 @@ export default {
SELECT DISTINCT
?Bestuurseenheid
?JuridischeNaam
?AlternatieveNaam
?Classificatie
?Status
?KBO_nr
?OVO_nr
?Sharepoint_id
?NIS_code
?JuridischeVorm
?Regio
?Werkingsgebied
?GeplandeEinddatum
?Provincie
?Straat
?Huisnummer
@@ -48,7 +53,31 @@ export default {
a ?type.
OPTIONAL { ?BestuurseenheidURI skos:prefLabel ?Bestuurseenheid . }
OPTIONAL { ?BestuurseenheidURI org:classification/skos:prefLabel ?Classificatie. }
OPTIONAL { ?BestuurseenheidURI regorg:legalName ?JuridischeNaam. }
OPTIONAL { ?BestuurseenheidURI organisatie:rechtsvorm/skos:prefLabel ?JuridischeVorm. }
OPTIONAL { ?BestuurseenheidURI lblodgeneriek:geplandeEindDatum ?GeplandeEinddatum. }
OPTIONAL {
SELECT ?BestuurseenheidURI (GROUP_CONCAT(DISTINCT ?altLabelValue; separator=", ") AS ?AlternatieveNaam)
WHERE {
?BestuurseenheidURI skos:altLabel ?altLabelValue .
}
GROUP BY ?BestuurseenheidURI
}
OPTIONAL {
SELECT ?BestuurseenheidURI (GROUP_CONCAT(DISTINCT ?scopeLabel; separator=", ") AS ?Werkingsgebied)
WHERE {
{
?BestuurseenheidURI besluit:werkingsgebied ?scopeURI .
} UNION {
?BestuurseenheidURI dc_terms:spatial ?scopeURI .
}
?scopeURI rdfs:label ?scopeLabel .
}
GROUP BY ?BestuurseenheidURI
}
OPTIONAL {
?BestuurseenheidURI besluit:werkingsgebied ?werkingsgebiedURI.
?werkingsgebiedURI rdfs:label ?werkingsgebied.
@@ -131,13 +160,18 @@ export default {
const data = queryResponse.results.bindings.map((row) => ({
Bestuurseenheid: getSafeValue(row, "Bestuurseenheid"),
JuridischeNaam: getSafeValue(row, "JuridischeNaam"),
AlternatieveNaam: getSafeValue(row, "AlternatieveNaam"),
Classificatie: getSafeValue(row, "Classificatie"),
Status: getSafeValue(row, "Status"),
KBO_nr: getSafeValue(row, "KBO_nr"),
OVO_nr: getSafeValue(row, "OVO_nr"),
Sharepoint_id: getSafeValue(row, "Sharepoint_id"),
NIS_code: getSafeValue(row, "NIS_code"),
JuridischeVorm: getSafeValue(row, "JuridischeVorm"),
Regio: getSafeValue(row, "Regio"),
Werkingsgebied: getSafeValue(row, "Werkingsgebied"),
GeplandeEinddatum: getSafeValue(row, "GeplandeEinddatum"),
Provincie: getSafeValue(row, "Provincie"),
Straat: getSafeValue(row, "Straat"),
Huisnummer: getSafeValue(row, "Huisnummer"),
@@ -154,13 +188,18 @@ export default {
data,
[
"Bestuurseenheid",
"JuridischeNaam",
"AlternatieveNaam",
"Classificatie",
"Status",
"KBO_nr",
"OVO_nr",
"Sharepoint_id",
"NIS_code",
"JuridischeVorm",
"Regio",
"Werkingsgebied",
"GeplandeEinddatum",
"Provincie",
"Straat",
"Huisnummer",

View File

@@ -12,6 +12,7 @@ export const PREFIXES = `
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 lblodgeneriek: <https://data.lblod.info/vocabularies/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#>