What is {end time} and {start time} of {{Barnaul} has {located in the administrative territorial entity} as {Altai Krai}}
When did Barnaul grew to become an administrative territorial entity of Altai Krai and when did it end?
When did Barnaul became an administrative territorial entity of Altai Krai and when did it end?
SELECT ?r ?q WHERE { ?x property:end_time ?r . ?x property:located_in_the_administrative_territorial_entity resource:Altai_Krai . resource:Barnaul property:located_in_the_administrative_territorial_entity ?x . ?x property:start_time ?q }
select distinct ?value1 ?value2 where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q6014> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P131> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q5942>. ?statement <http://www.wikidata.org/entity/P580> ?value1 . ?statement <http://www.wikidata.org/entity/P2842> ?value2 } 
SELECT ?value1 ?value2 WHERE { wd:Q6014 p:P131 ?s . ?s ps:P131 wd:Q5942 . ?s pq:P582 ?value1 . ?s pq:P580 ?value2 }