What is {located in the administrative territorial entity} of {Luoyang} that is {end time} is {907-0-0} ?
In 907, what moved out of Luoyang?
What stopped being located in the administrative territorial entity of Luoyang in the year 907?
SELECT ?o WHERE { ?b property:located_in_the_administrative_territorial_entity ?o . ?b property:end_time ?t . resource:Luoyang property:located_in_the_administrative_territorial_entity ?b . FILTER ( CONTAINS ( ?t , '907-0-0' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q187136> .
?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/P582> <907-0-0>
} 

SELECT ?obj WHERE { wd:Q187136 p:P131 ?s . ?s ps:P131 ?obj . ?s pq:P582 ?x filter(contains(?x , '907-0-0')) }