What is {located in the administrative territorial entity} of {Semey} that is {start time} is {1838-0-0} ?
Which region in Semey was founded in 1838?
What region of Semey was founded in 1838?
SELECT ?z WHERE { resource:Semey property:located_in_the_administrative_territorial_entity ?n . ?n property:start_time ?b . ?n property:located_in_the_administrative_territorial_entity ?z . FILTER ( CONTAINS ( YEAR ( ?b ) , '1838' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q61944> .
?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> ?obj .
?statement <http://www.wikidata.org/entity/P580> <1838-0-0>
} 

SELECT ?obj WHERE { wd:Q61944 p:P131 ?s . ?s ps:P131 ?obj . ?s pq:P580 ?x filter(contains(YEAR(?x),'1838')) }