what is the {end time} for {C. Everett Koop} has {position held} as {Surgeon General of the United States} ?
Until when was C. Everett Koop the Surgeon General of the U.S.?
When did C. Everett Koop stop being the Surgeon General of the United States?
SELECT ?o WHERE { resource:C._Everett_Koop property:position_held ?x . ?x property:position_held resource:Surgeon_General_of_the_United_States . ?x property:end_time ?o }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q3306168> .
?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/Q1434880> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q3306168 p:P39 ?s . ?s ps:P39 wd:Q1434880 . ?s pq:P582 ?value}