Question: How many of Italy's provinces encompass Naples (the twin city of Marseille) or are located in Piedmont (the area is 25402 km2)?
Choices:
0
1
2
3
4
5
6
7
8
9
Answer: 3
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "province of Italy" .  { ?e_1 <located_in_the_administrative_territorial_entity> ?e . ?e_1 <pred:name> "Naples" . ?e_2 <twinned_administrative_body> ?e_1 . ?e_2 <pred:name> "Marseille" .  } UNION { ?e <located_in_the_administrative_territorial_entity> ?e_1 . ?e_1 <pred:name> "Piedmont" . ?e_1 <area> ?pv . ?pv <pred:unit> "square kilometre" . ?pv <pred:value> "25402"^^xsd:double .  } }
Program:
function: Find
inputs: Marseille
function: Relate
dependencies: 0
inputs: twinned administrative body
forward
function: Find
inputs: Naples
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: located in the administrative territorial entity
forward
function: FilterConcept
dependencies: 4
inputs: province of Italy
function: Find
inputs: Piedmont
function: FilterNum
dependencies: 6
inputs: area
25402 square kilometre
=
function: Relate
dependencies: 7
inputs: located in the administrative territorial entity
backward
function: FilterConcept
dependencies: 8
inputs: province of Italy
function: Or
dependencies: 5
9
function: Count
dependencies: 10