what is the {end time} for {John C. Frémont} has {position held} as {United States senator} ?
When did John C. Fremont retire from the United States Senate?
When did John C. Fremont leave the United States Senate as a Senator?
SELECT ?p WHERE { resource:John_C._Frémont property:position_held ?b . ?b property:end_time ?p . ?b property:position_held resource:United States senator }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q169011> .
?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/Q13217683> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q169011 p:P39 ?s . ?s ps:P39 wd:Q13217683 . ?s pq:P582 ?value}