Question: How many rivers shorter than 250 metres or with a watershed area not 300000 square kilometres?
Choices:
5
6
7
8
9
10
11
12
13
14
Answer: 9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "river" .  { ?e <length> ?pv . ?pv <pred:unit> "metre" . ?pv <pred:value> ?v . FILTER ( ?v < "250"^^xsd:double ) .  } UNION { ?e <watershed_area> ?pv . ?pv <pred:unit> "square kilometre" . ?pv <pred:value> ?v . FILTER ( ?v != "300000"^^xsd:double ) .  } }
Program:
function: FindAll
function: FilterNum
dependencies: 0
inputs: length
250 metre
<
function: FilterConcept
dependencies: 1
inputs: river
function: FindAll
function: FilterNum
dependencies: 3
inputs: watershed area
300000 square kilometre
!=
function: FilterConcept
dependencies: 4
inputs: river
function: Or
dependencies: 2
5
function: Count
dependencies: 6