what is the {end time} for {Dag Hammarskjöld} has {position held} as {United Nations Secretary-General} ?
When did Dag Hammarskjold quit the UN?
When did Dag Hammarskjold end his term as the United Nations Secretary-General?
SELECT ?w WHERE { ?s property:end_time ?w . resource:Dag_Hammarskjöld property:position_held ?s . ?s property:position_held resource:Secretary-General_of_the_United_Nations }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1267> .
?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/Q81066> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q1267 p:P39 ?s . ?s ps:P39 wd:Q81066 . ?s pq:P582 ?value}