Question: How many rivers share a border with Albany (whose postal codes are 12222–12232) or have watershed area that is under 42000 square kilometers?
Choices:
0
1
2
3
4
5
6
7
8
9
Answer: 2
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "river" .  { ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Albany" . ?e_1 <postal_code> ?pv . ?pv <pred:value> "12222–12232" .  } UNION { ?e <watershed_area> ?pv . ?pv <pred:unit> "square kilometre" . ?pv <pred:value> ?v . FILTER ( ?v < "42000"^^xsd:double ) .  } }
Program:
function: Find
inputs: Albany
function: FilterStr
dependencies: 0
inputs: postal code
12222–12232
function: Relate
dependencies: 1
inputs: shares border with
forward
function: FilterConcept
dependencies: 2
inputs: river
function: FindAll
function: FilterNum
dependencies: 4
inputs: watershed area
42000 square kilometre
<
function: FilterConcept
dependencies: 5
inputs: river
function: Or
dependencies: 3
6
function: Count
dependencies: 7