The query below works when I include the line that uses CONTAINS for the filter, but fails if I simply check if the value (LCASE) is equal to "donald trump" (it is).
Use this line, and it works:
FILTER(CONTAINS(LCASE(?idLabel), "donald trump") ).
Use this line, and it fails:
FILTER(LCASE(?idLabel) = "donald trump") .
The output for the query that WORKS has idLabel = "Donald Trump"
SPARQL Query:
SELECT DISTINCT ?id ?idLabel ?PV WHERE {
?id wdt:P106 ?V0. VALUES ?V0 { wd:Q39631 } .
OPTIONAL {
?id rdfs:label ?idLabel .
FILTER(LANG(?idLabel) = 'en') .
} .
# Filter on Label
# WORKS:
FILTER(CONTAINS(LCASE(?idLabel), "donald trump") ).
# DOES NOT WORK
#FILTER(LCASE(?idLabel) = "donald trump") .
# subselect on instance type
{
SELECT ?id WHERE {
?id wdt:P31/wdt:P279* ?PV . VALUES(?PV) {(wd:Q5) } .
}
} .
}
My question is WHY the second option does NOT work ?
(And yes, I'm looking for the surgeon Donald Trump, not that other guy)