What is {spouse} of {Ted Kennedy} that is {end time} is {2009-1-1} ?
Who is the spouse of Ted Kennedy at the time of 2009-1-1?
SELECT ?obj WHERE { wd:Q134549 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'2009')) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q134549> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P26> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <2009-1-1>
} 

At the time of 2009-1-1, who was the spouse of Ted Kennedy?