What is {military branch} of {Ted Stevens} and {end time}
Ted Stevens was in what department of the military until when?
Ted Stevens was in what branch of the military until when?
SELECT ?j ?q WHERE { ?e property:military_branch ?q . ?e property:end_time ?j . . resource:Ted_Stevens property:military_branch ?e }
select distinct ?dataprop1 ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q50599> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P241> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj . ?statement <http://www.wikidata.org/entity/P580> ?dataprop1 . } 
SELECT ?value1 ?obj WHERE { wd:Q50599 p:P241 ?s . ?s ps:P241 ?obj . ?s pq:P582 ?value1 . }