From 28f57ed34462f6f48e91cdad0160ef4f817b1365 Mon Sep 17 00:00:00 2001 From: Elena Poelman Date: Mon, 2 Dec 2024 13:44:15 +0100 Subject: [PATCH] workaround(sparql-queries): replace OPTIONAL by UNION statements to work around virtuoso duplication bug --- .changeset/ninety-tomatoes-swim.md | 5 +++++ app/config/mandatee-table-config.js | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .changeset/ninety-tomatoes-swim.md diff --git a/.changeset/ninety-tomatoes-swim.md b/.changeset/ninety-tomatoes-swim.md new file mode 100644 index 000000000..a7066aabd --- /dev/null +++ b/.changeset/ninety-tomatoes-swim.md @@ -0,0 +1,5 @@ +--- +'frontend-gelinkt-notuleren': patch +--- + +Work around virtuoso optional-nested-select duplication bug by replacing `OPTIONAL` statements by `UNION` statements diff --git a/app/config/mandatee-table-config.js b/app/config/mandatee-table-config.js index 73854794e..e27b5f43a 100644 --- a/app/config/mandatee-table-config.js +++ b/app/config/mandatee-table-config.js @@ -1332,9 +1332,16 @@ export const mandateeTableConfigRMW = (meeting) => { ?mandataris a mandaat:Mandataris. ?mandataris mandaat:isBestuurlijkeAliasVan ?persoon. ?mandataris org:hasMembership/org:organisation ?fractie. - OPTIONAL { + + { ?mandataris mandaat:einde ?persoon_mandaat_einde. } + UNION + { + FILTER NOT EXISTS { + ?mandataris mandaat:einde ?persoon_mandaat_einde. + } + } ?fractie a mandaat:Fractie. ?fractie regorg:legalName ?fractie_naam. @@ -1438,9 +1445,16 @@ export const mandateeTableConfigRMW = (meeting) => { ?mandataris mandaat:isBestuurlijkeAliasVan ?persoon. ?mandataris org:hasMembership/org:organisation ?fractie. ?mandataris mandaat:start ?mandaat_start. - OPTIONAL { + + { ?mandataris mandaat:einde ?mandaat_einde. } + UNION + { + FILTER NOT EXISTS { + ?mandataris mandaat:einde ?mandaat_einde. + } + } ?fractie a mandaat:Fractie. ?fractie regorg:legalName ?fractie_naam.