diff --git a/config/reports/administrative-units-report.js b/config/reports/administrative-units-report.js index e0dfd77..7dd7761 100644 --- a/config/reports/administrative-units-report.js +++ b/config/reports/administrative-units-report.js @@ -2,7 +2,7 @@ import { generateReportFromData, batchedQuery } from "../helpers.js"; import { PREFIXES } from "./utils"; export default { - cronPattern: "0 00 1 * * *", + cronPattern: "0 */5 * * * *", name: "administrativeUnits", execute: async () => { const reportData = { @@ -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", diff --git a/config/reports/utils.js b/config/reports/utils.js index f997873..2dcf353 100644 --- a/config/reports/utils.js +++ b/config/reports/utils.js @@ -12,6 +12,7 @@ export const PREFIXES = ` PREFIX ext: PREFIX foaf: PREFIX generiek: + PREFIX lblodgeneriek: PREFIX lblodlg: PREFIX locn: PREFIX mandaat: