Question: How many ceremonial counties of England border Greater Manchester or have the capital Exeter whose TOID is 4000000074556577?
Choices:
5
6
7
8
9
10
11
12
13
14
Answer: 6
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "ceremonial county of England" .  { ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Greater Manchester" .  } UNION { ?e_1 <capital_of> ?e . ?e_1 <pred:name> "Exeter" . ?e_1 <TOID> ?pv . ?pv <pred:value> "4000000074556577" .  } }
Program:
function: Find
inputs: Greater Manchester
function: Relate
dependencies: 0
inputs: shares border with
forward
function: FilterConcept
dependencies: 1
inputs: ceremonial county of England
function: Find
inputs: Exeter
function: FilterStr
dependencies: 3
inputs: TOID
4000000074556577
function: Relate
dependencies: 4
inputs: capital of
forward
function: FilterConcept
dependencies: 5
inputs: ceremonial county of England
function: Or
dependencies: 2
6
function: Count
dependencies: 7