What is {located in the administrative territorial entity} of {The Hague} that is {end time} is {1801-0-0} ?
Until 1801,The Hague was contained on which nation's borders?
What nation's borders contained The Hague until 1801?
SELECT ?g WHERE { ?r property:located_in_the_administrative_territorial_entity ?g . resource:The_Hague property:located_in_the_administrative_territorial_entity ?r . ?r property:end_time ?u . FILTER ( CONTAINS ( YEAR ( ?u ) , '1801' ) ) }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q36600> .
?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> <1801-0-0>
} 

SELECT ?obj WHERE { wd:Q36600 p:P131 ?s . ?s ps:P131 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1801')) }