Question: How many New Jersey counties border Somerset County, population 330585, or have a population exceeding 4600?
Choices:
12
13
14
15
16
17
18
19
20
21
Answer: 20
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "county of New Jersey" .  { ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Somerset County" . ?e_1 <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> "330585"^^xsd:double .  } UNION { ?e <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> ?v . FILTER ( ?v > "4600"^^xsd:double ) .  } }
Program:
function: Find
inputs: Somerset County
function: FilterNum
dependencies: 0
inputs: population
330585
=
function: Relate
dependencies: 1
inputs: shares border with
forward
function: FilterConcept
dependencies: 2
inputs: county of New Jersey
function: FindAll
function: FilterNum
dependencies: 4
inputs: population
4600
>
function: FilterConcept
dependencies: 5
inputs: county of New Jersey
function: Or
dependencies: 3
6
function: Count
dependencies: 7