Question: How many Massachusetts counties are there that are administrative divisions of Massachusetts (nicknamed The Bay State) or whose population is more than 8700000?
Choices: 12
13
14
15
16
17
18
19
20
21
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "county of Massachusetts" .  { ?e_1 <contains_administrative_territorial_entity> ?e . ?e_1 <pred:name> "Massachusetts" . ?e_1 <nickname> ?pv . ?pv <pred:value> "The Bay State" .  } UNION { ?e <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> ?v . FILTER ( ?v > "8700000"^^xsd:double ) .  } }
Program:
function: Find
inputs: Massachusetts
function: FilterStr
dependencies: 0
inputs: nickname
The Bay State
function: Relate
dependencies: 1
inputs: contains administrative territorial entity
forward
function: FilterConcept
dependencies: 2
inputs: county of Massachusetts
function: FindAll
function: FilterNum
dependencies: 4
inputs: population
8700000
>
function: FilterConcept
dependencies: 5
inputs: county of Massachusetts
function: Or
dependencies: 3
6
function: Count
dependencies: 7
Answer: 12