Question: How many regions of Italy share a border with the region of Italy whose capital is Florence (that is the capital of Italy)?
Choices:
3
4
5
6
7
8
9
10
11
12
Program:
function: Find
inputs: Italy
function: Relate
dependencies: 0
inputs: capital
forward
function: Find
inputs: Florence
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: capital of
forward
function: FilterConcept
dependencies: 4
inputs: region of Italy
function: Relate
dependencies: 5
inputs: shares border with
forward
function: FilterConcept
dependencies: 6
inputs: region of Italy
function: Count
dependencies: 7
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "region of Italy" . ?e_1 <shares_border_with> ?e . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "region of Italy" . ?e_2 <capital_of> ?e_1 . ?e_2 <pred:name> "Florence" . ?e_3 <capital> ?e_2 . ?e_3 <pred:name> "Italy" .   }
Answer: 5