what is the {end time} for {Edward Smith-Stanley, 14th Earl of Derby} has {position held} as {Prime Minister of the United Kingdom} ?
In which year did Edward Smith-Stanley leave his post of Prime Minister for the united Kingdom?
What year was Edward Smith-Stanley's last year as Prime Minister of the United Kingdom?
SELECT ?c WHERE { ?u property:position_held resource:Prime_Minister_of_the_United_Kingdom . resource:Edward_Smith-Stanley,_14th_Earl_of_Derby property:position_held ?u . ?u property:end_time ?c }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q237829> .
?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/Q14211> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q237829 p:P39 ?s . ?s ps:P39 wd:Q14211 . ?s pq:P582 ?value}