From 96b36d2cf699d8eac55201e29f9f9ddbbb9d732f Mon Sep 17 00:00:00 2001 From: mirdono Date: Wed, 2 Jul 2025 13:54:41 +0200 Subject: [PATCH] fix: reorder `graph` and `optional` clauses Putting the optional clause within the graph clause causes to query causes, using DEV data, some organisations to be missed by the query. Turning the order around resolves this without losing any organisations, tested with DEV and PROD data. --- config/reports/organizations-report.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/reports/organizations-report.js b/config/reports/organizations-report.js index 837c3f8..2011077 100644 --- a/config/reports/organizations-report.js +++ b/config/reports/organizations-report.js @@ -58,8 +58,8 @@ export default { ?bestuur a org:Organization . } - GRAPH ?h { - OPTIONAL { + OPTIONAL { + GRAPH ?h { ?bestuur org:hasPrimarySite ?primarySite. OPTIONAL { @@ -67,10 +67,11 @@ export default { OPTIONAL { ?sa locn:adminUnitL2 ?provincie. } } } + FILTER (?h IN ( , )) } FILTER (?g IN ( , , )) - FILTER (?h IN ( , )) + } `;