What is {spouse} of {Katharine Hepburn} and {end time}
Who was married to Katharine Hepburn and when ended the marriage?
Who was Katharine Hepburn married to and when did the marriage end?
SELECT ?k ?a WHERE { resource:Katharine_Hepburn property:spouse ?e . ?e property:spouse ?a . ?e property:end_time ?k . }
select distinct ?dataprop1 ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q56016> . ?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/P580> ?dataprop1 . } 
SELECT ?value1 ?obj WHERE { wd:Q56016 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P582 ?value1 . }