what is the {end time} for {Alexandria} has {located in the administrative territorial entity} as {Diocese of Egypt} ?
When did Alexdandria stop being the diocese of Egypt?
When Alexandria, Diocese of Egypt, ended?
SELECT ?c WHERE { ?s property:end_time ?c . ?s property:located_in_the_administrative_territorial_entity resource:Diocese_of_Egypt . resource:Alexandria property:located_in_the_administrative_territorial_entity ?s }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q87> .
?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/Q1018761> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q87 p:P131 ?s . ?s ps:P131 wd:Q1018761 . ?s pq:P582 ?value}