what is the {end time} for {Donetsk} has {named after} as {Joseph Stalin} ?
Donetsk was once called Joseph Stalin, when was it?
When did Donetsk stop being named after Joseph Stalin?
SELECT ?v WHERE { ?b property:end_time ?v . ?b property:named_after resource:Joseph_Stalin . resource:Donetsk property:named_after ?b }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q43070> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P138> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q855> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q43070 p:P138 ?s . ?s ps:P138 wd:Q855 . ?s pq:P582 ?value}