What is {spouse} of {Kelsey Grammer} and {end time}
When did Kelsey Grammer get separated, and who was he hitched to?
When did Kelsey Grammer get divorced, and who was he married to?
SELECT ?d ?i WHERE { ?l property:spouse ?i . resource:Kelsey_Grammer property:spouse ?l . ?l property:end_time ?d . }
select distinct ?dataprop1 ?obj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q196560> . ?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:Q196560 p:P26 ?s . ?s ps:P26 ?obj . ?s pq:P582 ?value1 . }