What is {subitem of} of {history of Quebec}, that has {border} is {Maine} ?
What is the state that borders Maine?
What is the state that borders Maine?
SELECT ?r WHERE { resource:history_of_Quebec property:facet_of ?r . ?r property:shares_border_with resource:Maine }
SELECT ?answer WHERE { ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q375513> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P1269>. ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?answer . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?answer. ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P47> . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q724> . }
SELECT ?answer WHERE { wd:Q375513 wdt:P1269 ?answer . ?answer wdt:P47 wd:Q724}