what is the {end time} for {John F. Kennedy} has {position held} as {United States representative} ?
What date was John F. Kennedy a United States representative?
When was John F. Kennedy the United States representative?
SELECT ?g WHERE { resource:John_F._Kennedy property:position_held ?r . ?r property:position_held resource:United_States_representative . ?r property:end_time ?g }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q9696> .
?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/Q13218630> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q9696 p:P39 ?s . ?s ps:P39 wd:Q13218630 . ?s pq:P582 ?value}