what is the {end time} for {Rome} has {head of government} as {Walter Veltroni} ?
When did Walter Veltroni end his term as head of Rome's government ?
SELECT ?value WHERE { wd:Q220 p:P6 ?s . ?s ps:P6 wd:Q319547 . ?s pq:P582 ?value}
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q220> .
?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/Q319547> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

What year did Walter Veltroni's term as head of Rome's government end?