What is the {non-metropolitan county} for {shares border with} of {Hampshire}
[]
What non-metropolitan county shares a border with Hampshire?
SELECT DISTINCT ?r WHERE { ?r rdf:type ontology:non-metropolitan_county . ?r property:shares_border_with resource:Hampshire }
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/Q23204> . ?subj <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q769603> } 
 select distinct ?sbj where { ?sbj wdt:P47 wd:Q23204 . ?sbj wdt:P31 wd:Q769603 } 
Berkshire Surrey West Sussex