what is the {end time} for {Bergamo} has {country} as {Italian Republic} ?
What is the { end time } for { Bergamo } as { Italian Republic }?
SELECT ?value WHERE { wd:Q628 p:P17 ?s . ?s ps:P17 wd:Q723118 . ?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/Q628> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P17> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q723118> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

At what time Bergamo ceased being part of Italian Republic?