What is {spouse} of {Simon Rattle} that is {end time} is {2004-1-1} ?
Who was Simon Rattle married to until 2004?
Who was Simon Rattle's spouse until the year 2004?
SELECT ?n WHERE { FILTER ( CONTAINS ( YEAR ( ?i ) , '2004' ) ) . ?z property:spouse ?n . resource:Simon_Rattle property:spouse ?z . ?z property:end_time ?i }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q157814> .
?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> <2004-1-1>
} 

SELECT ?obj WHERE { wd:Q157814 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'2004')) }