0

I currently have this query that will grab the description and place of death of J.R.R. Tolkien, but I would like to display the city and country of the place of birth. Currently I get a reference to another wikidata item. How can I resolve properties of a linked item to display what I need?

SELECT ?description ?placeOfBirth WHERE {
  VALUES ?item { wd:Q892 } .
  SERVICE wikibase:label {
    ?item schema:description ?description.
    bd:serviceParam wikibase:language "en".
  }
  ?item wdt:P19 ?placeOfBirth  .
}
zkwsk
  • 1,960
  • 4
  • 26
  • 34

1 Answers1

0

I think this is what you need:

SELECT ?description ?placeOfBirthLabel ?countryofBirthLabel WHERE {
  VALUES ?item { wd:Q892 } .
  ?item schema:description ?description .
  FILTER (LANG(?description) = "en")
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  ?item wdt:P19 ?placeOfBirth .
  ?placeOfBirth wdt:P17 ?countryofBirth .
}
logi-kal
  • 7,107
  • 6
  • 31
  • 43