what is the {end time} for {Mohammad Reza Pahlavi} has {position held} as {Shah} ?
In what year di Mohammad Reza Pahlavi give up his throne.
When did Mohammad Reza Pahlavi step down as Shah?
SELECT ?o WHERE { ?j property:end_time ?o . ?j property:position_held resource:Shah . resource:Mohammad_Reza_Pahlavi property:position_held ?j }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q128245> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P39> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q184299> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q128245 p:P39 ?s . ?s ps:P39 wd:Q184299 . ?s pq:P582 ?value}