What is the {kingdom} for {shares border with} of {Austrian Empire}
Which country does Austria share a border with?
What country shares the same border as Austria
SELECT DISTINCT ?q WHERE { ?q property:shares_border_with resource:Austrian_Empire . ?q rdf:type ontology:kingdom }
select distinct ?subj where { ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?subj . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P47> . ?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q131964> . ?subj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q417175> } 
 select distinct ?sbj where { ?sbj wdt:P47 wd:Q131964 . ?sbj wdt:P31 wd:Q417175 } 
Kingdom of Saxony