OP-3835: added columns to administrative units query

This commit is contained in:
Damon
2026-09-02 13:30:54 +02:00
parent c65fb23c0a
commit 20f50f6af4
2 changed files with 42 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { generateReportFromData, batchedQuery } from "../helpers.js";
import { PREFIXES } from "./utils"; import { PREFIXES } from "./utils";
export default { export default {
cronPattern: "0 00 1 * * *", cronPattern: "0 */5 * * * *",
name: "administrativeUnits", name: "administrativeUnits",
execute: async () => { execute: async () => {
const reportData = { const reportData = {
@@ -18,13 +18,18 @@ export default {
SELECT DISTINCT SELECT DISTINCT
?Bestuurseenheid ?Bestuurseenheid
?JuridischeNaam
?AlternatieveNaam
?Classificatie ?Classificatie
?Status ?Status
?KBO_nr ?KBO_nr
?OVO_nr ?OVO_nr
?Sharepoint_id ?Sharepoint_id
?NIS_code ?NIS_code
?JuridischeVorm
?Regio ?Regio
?Werkingsgebied
?GeplandeEinddatum
?Provincie ?Provincie
?Straat ?Straat
?Huisnummer ?Huisnummer
@@ -48,7 +53,31 @@ export default {
a ?type. a ?type.
OPTIONAL { ?BestuurseenheidURI skos:prefLabel ?Bestuurseenheid . } OPTIONAL { ?BestuurseenheidURI skos:prefLabel ?Bestuurseenheid . }
OPTIONAL { ?BestuurseenheidURI org:classification/skos:prefLabel ?Classificatie. } 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 { OPTIONAL {
?BestuurseenheidURI besluit:werkingsgebied ?werkingsgebiedURI. ?BestuurseenheidURI besluit:werkingsgebied ?werkingsgebiedURI.
?werkingsgebiedURI rdfs:label ?werkingsgebied. ?werkingsgebiedURI rdfs:label ?werkingsgebied.
@@ -131,13 +160,18 @@ export default {
const data = queryResponse.results.bindings.map((row) => ({ const data = queryResponse.results.bindings.map((row) => ({
Bestuurseenheid: getSafeValue(row, "Bestuurseenheid"), Bestuurseenheid: getSafeValue(row, "Bestuurseenheid"),
JuridischeNaam: getSafeValue(row, "JuridischeNaam"),
AlternatieveNaam: getSafeValue(row, "AlternatieveNaam"),
Classificatie: getSafeValue(row, "Classificatie"), Classificatie: getSafeValue(row, "Classificatie"),
Status: getSafeValue(row, "Status"), Status: getSafeValue(row, "Status"),
KBO_nr: getSafeValue(row, "KBO_nr"), KBO_nr: getSafeValue(row, "KBO_nr"),
OVO_nr: getSafeValue(row, "OVO_nr"), OVO_nr: getSafeValue(row, "OVO_nr"),
Sharepoint_id: getSafeValue(row, "Sharepoint_id"), Sharepoint_id: getSafeValue(row, "Sharepoint_id"),
NIS_code: getSafeValue(row, "NIS_code"), NIS_code: getSafeValue(row, "NIS_code"),
JuridischeVorm: getSafeValue(row, "JuridischeVorm"),
Regio: getSafeValue(row, "Regio"), Regio: getSafeValue(row, "Regio"),
Werkingsgebied: getSafeValue(row, "Werkingsgebied"),
GeplandeEinddatum: getSafeValue(row, "GeplandeEinddatum"),
Provincie: getSafeValue(row, "Provincie"), Provincie: getSafeValue(row, "Provincie"),
Straat: getSafeValue(row, "Straat"), Straat: getSafeValue(row, "Straat"),
Huisnummer: getSafeValue(row, "Huisnummer"), Huisnummer: getSafeValue(row, "Huisnummer"),
@@ -154,13 +188,18 @@ export default {
data, data,
[ [
"Bestuurseenheid", "Bestuurseenheid",
"JuridischeNaam",
"AlternatieveNaam",
"Classificatie", "Classificatie",
"Status", "Status",
"KBO_nr", "KBO_nr",
"OVO_nr", "OVO_nr",
"Sharepoint_id", "Sharepoint_id",
"NIS_code", "NIS_code",
"JuridischeVorm",
"Regio", "Regio",
"Werkingsgebied",
"GeplandeEinddatum",
"Provincie", "Provincie",
"Straat", "Straat",
"Huisnummer", "Huisnummer",

View File

@@ -12,6 +12,7 @@ export const PREFIXES = `
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/> PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#> 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 lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
PREFIX locn: <http://www.w3.org/ns/locn#> PREFIX locn: <http://www.w3.org/ns/locn#>
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#> PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>