1

Using the following query:

SELECT ?item ?itemLabel ?itemDescription ?director WHERE {
  ?item wdt:P31 wd:Q11424 .
  ?item wdt:P161 wd:Q2263 .
  OPTIONAL{?item wdt:P57 ?director .} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

I can get movies with Tom Hanks and QID of director.

But how can I get director's name (label of this QID) in this table.

Query can be seen on Wikidata Query Service page.

1 Answer 1

3

Just add ?directorLabel to the select. The label service seems to work on any declared variable if you suffix it with 'Label'

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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