What is {spouse} of {Paul Keating} that is {end time} is {2008-0-0} ?
Who was Paul Keating's current wife before his divorce in 2008?
Who was Paul Keating's spouse when their marriage ended in 2008?
SELECT ?b WHERE { ?d property:end_time ?o . resource:Paul_Keating property:spouse ?d . ?d property:spouse ?b . FILTER ( CONTAINS ( YEAR ( ?o ) , '2008' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q242654> .
?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> <2008-0-0>
} 

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