What is {spouse} of {Karlheinz Stockhausen} that is {end time} is {1972-0-0} ?
Who was Karlheinz Stockhausen married to until 1972?
For Karlheinz Stockhausen was spoused was in the end time in the year 1972?
SELECT ?g WHERE { resource:Karlheinz_Stockhausen property:spouse ?z . ?z property:end_time ?a . FILTER ( CONTAINS ( YEAR ( ?a ) , '1972' ) ) . ?z property:spouse ?g }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q154556> .
?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> <1972-0-0>
} 

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