what is the {country} for {Oscar Niemeyer} has {place of death} as {Rio de Janeiro} ?
The death of Oscar Niemeyer occurred in Rio De Janeiro, in which country?
Oscar Niemeyer died in Rio de Janeiro, which is located in what country?
SELECT ?r WHERE { ?j property:place_of_death resource:Rio_de_Janeiro . resource:Oscar_Niemeyer property:place_of_death ?j . ?j property:country ?r }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q134165> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P20> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q8678> .
?statement <http://www.wikidata.org/entity/P17> ?value. 
} 

SELECT ?value WHERE { wd:Q134165 p:P20 ?s . ?s ps:P20 wd:Q8678 . ?s pq:P17 ?value}