what is the {end time} for {Ashdod} has {head of government} as {Zvi Zilker} ?
In which year did Zvi Zilker replace Ashdod as the head of government?
When was Ashdod replaced by Zvi Zilker as the head of government?
SELECT ?j WHERE { ?z property:end_time ?j . resource:Ashdod property:head_of_government ?z . ?z property:head_of_government resource:Zvi_Zilker }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q171639> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P6> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q8075553> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q171639 p:P6 ?s . ?s ps:P6 wd:Q8075553 . ?s pq:P582 ?value}