Question: How many New Jersey cities border Staten Island which borders Bayonne or whose area is greater than 7600 square kilometres?
Choices:
1
2
3
4
5
6
7
8
9
10
Program:
function: Find
inputs: Bayonne
function: Relate
dependencies: 0
inputs: shares border with
backward
function: Find
inputs: Staten Island
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: shares border with
forward
function: FilterConcept
dependencies: 4
inputs: city in New Jersey
function: FindAll
function: FilterNum
dependencies: 6
inputs: area
7600 square kilometre
>
function: FilterConcept
dependencies: 7
inputs: city in New Jersey
function: Or
dependencies: 5
8
function: Count
dependencies: 9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city in New Jersey" .  { ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Staten Island" . ?e_1 <shares_border_with> ?e_2 . ?e_2 <pred:name> "Bayonne" .  } UNION { ?e <area> ?pv . ?pv <pred:unit> "square kilometre" . ?pv <pred:value> ?v . FILTER ( ?v > "7600"^^xsd:double ) .  } }
Answer: 3