Question: How many Pennsylvania cities are the capital of Lancaster County (the one that shares border with Dauphin County) or have a population of less than 820000?
Choices: 11
12
13
14
15
16
17
18
19
20
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city of Pennsylvania" .  { ?e <capital_of> ?e_1 . ?e_1 <pred:name> "Lancaster County" . ?e_2 <shares_border_with> ?e_1 . ?e_2 <pred:name> "Dauphin County" .  } UNION { ?e <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> ?v . FILTER ( ?v < "820000"^^xsd:double ) .  } }
Program:
function: Find
inputs: Dauphin County
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Lancaster County
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: capital of
backward
function: FilterConcept
dependencies: 4
inputs: city of Pennsylvania
function: FindAll
function: FilterNum
dependencies: 6
inputs: population
820000
<
function: FilterConcept
dependencies: 7
inputs: city of Pennsylvania
function: Or
dependencies: 5
8
function: Count
dependencies: 9
Answer: 17