what is the {end time} for {Friedrich Hayek} has {position held} as {president} ?
When was the last year Friedrich Hayek's being president?
What was Friedrich Hayek's last year as President?
SELECT ?b WHERE { resource:Friedrich_Hayek property:position_held ?i . ?i property:end_time ?b . ?i property:position_held resource:president }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q1325> .
?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/Q30461> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q1325 p:P39 ?s . ?s ps:P39 wd:Q30461 . ?s pq:P582 ?value}