0

I want to find all the reruns of a specific production using a string in the query. I do not get any results. This is the query I am trying:

SELECT ?item ?label
WHERE {
  ?item wdt:P5935 ?id;
        rdfs:label ?label.
  FILTER(LANG(?label) = "[AUTO_LANGUAGE]").
  FILTER(STRSTARTS(?label, "Der Ring des Nibelungen: Die Walküre")).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en". }
}

Does anyone know how to form queries using a string from the label?

1 Answers1

0

On the Wikidata Query Service website, AUTO_LANGUAGE is replaced by the language of your user inteface.

If your user interface is Dutch, you will get a result: Q47471674. Otherwise, you don't get a result because no other language has an item with the label "Der Ring des Nibelungen: Die Walküre".

I recommend you to either replace in the FILTER expression AUTO_LANGUAGE by a specific language code or if you want a language independent search, omit the expression altogether.

SELECT ?item ?label
WHERE {
  ?item wdt:P5935 ?id;
        rdfs:label ?label.
  # FILTER(LANG(?label) = "nl").  
  FILTER(STRSTARTS(?label, "Der Ring des Nibelungen: Die Walküre")).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,en". }
}
Pascalco
  • 2,481
  • 2
  • 15
  • 31