Question: How many non-metropolitan districts have the capital Waterloo (the one whose country is Canada) or have a population not equal to 78000?
Choices: 10
11
12
13
14
15
16
17
18
19
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "non-metropolitan district" .  { ?e <capital> ?e_1 . ?e_1 <pred:name> "Waterloo" . ?e_1 <country> ?e_2 . ?e_2 <pred:name> "Canada" .  } UNION { ?e <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> ?v . FILTER ( ?v != "78000"^^xsd:double ) .  } }
Program:
function: Find
inputs: Canada
function: Relate
dependencies: 0
inputs: country
backward
function: Find
inputs: Waterloo
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: capital
backward
function: FilterConcept
dependencies: 4
inputs: non-metropolitan district
function: FindAll
function: FilterNum
dependencies: 6
inputs: population
78000
!=
function: FilterConcept
dependencies: 7
inputs: non-metropolitan district
function: Or
dependencies: 5
8
function: Count
dependencies: 9
Answer: 17