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.

3

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

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.