I've this query but I can't understand why doesn't return any result. I try different versions (with link, with only code, with wd:code) but nothing seems to work. What I need is this query but searching by code (like the eg., Q6015113)

              SELECT ?item ?itemLabel WHERE {

 ?item wdt:P31 wd:Q5.
  FILTER (?item = "http://www.wikidata.org/entity/Q6015113")
 SERVICE wikibase:label { bd:serviceParam wikibase:language "es,en,fr" . }
} ORDER BY ASC(?num)

In short, URIs are "things, not strings". The filtering condition should be:

  • ?item = <http://www.wikidata.org/entity/Q6015113>, or
  • ?item = wd:Q6015113, or
  • ?item = URI("http://www.wikidata.org/entity/Q6015113").

There also exists the VALUES keyword for providing inline data.

  • mmm actually i don't wanna try to search for url, but for id (Q6015113). Tried with your example is not a valid query :( Mar 25 '18 at 1:20
  • sorry, it works now. FILTER (?item = wd:Q6015113) Mar 25 '18 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.