What is {member of} of {Austrian Empire} that is {end time} is {1866-0-0} ?
Which countries were part of the Austrian Empire until 1866?
Which country was part of the Austrian Empire until 1866?
SELECT ?a WHERE { ?p property:member_of ?a . FILTER ( CONTAINS ( YEAR ( ?l ) , '1866' ) ) . resource:Austrian_Empire property:member_of ?p . ?p property:end_time ?l }
select distinct ?obj  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q131964> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P463> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
?statement <http://www.wikidata.org/entity/P582> <1866-0-0>
} 

SELECT ?obj WHERE { wd:Q131964 p:P463 ?s . ?s ps:P463 ?obj . ?s pq:P582 ?x filter(contains(YEAR(?x),'1866')) }