Question: How many North Carolina counties have an administrative division of North Carolina or an area less than 270 square miles?
Choices:
10
11
12
13
14
15
16
17
18
19
Answer: 11
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "county of North Carolina" .  { ?e_1 <contains_administrative_territorial_entity> ?e . ?e_1 <pred:name> "North Carolina" .  } UNION { ?e <area> ?pv . ?pv <pred:unit> "square mile" . ?pv <pred:value> ?v . FILTER ( ?v < "270"^^xsd:double ) .  } }
Program:
function: Find
inputs: North Carolina
function: Relate
dependencies: 0
inputs: contains administrative territorial entity
forward
function: FilterConcept
dependencies: 1
inputs: county of North Carolina
function: FindAll
function: FilterNum
dependencies: 3
inputs: area
270 square mile
<
function: FilterConcept
dependencies: 4
inputs: county of North Carolina
function: Or
dependencies: 2
5
function: Count
dependencies: 6