query-e535a0073150ab71b7dfe942354cf295

rq turtle/ttl

Filtering string equalityI tried to find minerals with ca labels ending in "a". My first approach didn't work and I would like to know why:

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?label_ca WHERE {
  ?item wdt:P279* wd:Q7946.
  ?item rdfs:label ?label_ca.
  FILTER((LANG(?label_ca)) = "ca")
  #This doesn't work:
  FILTER(SUBSTR(?label_ca, STRLEN(?label_ca)) = "a")
}
LIMIT 1000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?label_ca"):::projected c4(["wd:Q7946"]):::iri f0[["substring(?label_ca,string-length(?label_ca)) = 'a'"]] f0 --> v1 f1[["?label_ca = 'ca'"]] f1 --> v1 v2 --"wdt:P279"--> c4 v2 --"rdfs:label"--> v1