what is the {end time} for {County of Flanders} has {located in the administrative territorial entity} as {Holy Roman Empire} ?
When was the County of Flanders in the holy roman empire?
In which year County of Flanders was located in the administrative territorial entity of the Holy Roman Empire?
SELECT ?q WHERE { resource:County_of_Flanders property:located_in_the_administrative_territorial_entity ?y . ?y property:end_time ?q . ?y property:located_in_the_administrative_territorial_entity resource:Holy_Roman_Empire }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q157070> .
?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/Q12548> .
?statement <http://www.wikidata.org/entity/P582> ?value. 
} 

SELECT ?value WHERE { wd:Q157070 p:P131 ?s . ?s ps:P131 wd:Q12548 . ?s pq:P582 ?value}