Question: How many administrative territories in Canada shares borders with Ontario or have a water area greater than 5%?
Choices: 0
1
2
3
4
5
6
7
8
9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "administrative territorial entity of Canada" .  { ?e <shares_border_with> ?e_1 . ?e_1 <pred:name> "Ontario" . ?e_1 <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> "13448494"^^xsd:double .  } UNION { ?e <water_as_percent_of_area> ?pv . ?pv <pred:unit> "percentage" . ?pv <pred:value> ?v . FILTER ( ?v > "5"^^xsd:double ) .  } }
Program:
function: Find
inputs: Ontario
function: FilterNum
dependencies: 0
inputs: population
13448494
=
function: Relate
dependencies: 1
inputs: shares border with
backward
function: FilterConcept
dependencies: 2
inputs: administrative territorial entity of Canada
function: FindAll
function: FilterNum
dependencies: 4
inputs: water as percent of area
5 percentage
>
function: FilterConcept
dependencies: 5
inputs: administrative territorial entity of Canada
function: Or
dependencies: 3
6
function: Count
dependencies: 7
Answer: 2