Open lvaudor opened 5 months ago
OK the problem here seems to be that there should be nested OPTIONAL statements (just like what Maëlle did for spq_label on an optional variable)
This would work:
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?coords ?coordsloc ?country ?deathtoll ?flood ?loc
WHERE {
?flood wdt:P31/wdt:P279* wd:Q8068.
OPTIONAL {?flood wdt:P625 ?coords.}
OPTIONAL {?flood wdt:P17 ?country.}
OPTIONAL {?flood wdt:P1120 ?deathtoll.}
OPTIONAL {?flood wdt:P276 ?loc.
OPTIONAL{?loc wdt:P17 ?country_loc.}
}
}
A weird thing is happening here:
When adding the last triplet (?loc wdt:P17 ?country_loc") the formerly partially empty loc column is filled with (wrong) values...