Question: How many non-metropolitan counties contains the River Thames or claim as its country the United Kingdom?
Choices:
7
8
9
10
11
12
13
14
15
16
Answer: 9
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "non-metropolitan county" .  { ?e_1 <located_in_the_administrative_territorial_entity> ?e . ?e_1 <pred:name> "River Thames" .  } UNION { ?e <country> ?e_1 . ?e_1 <pred:name> "United Kingdom" .  } }
Program:
function: Find
inputs: River Thames
function: Relate
dependencies: 0
inputs: located in the administrative territorial entity
forward
function: FilterConcept
dependencies: 1
inputs: non-metropolitan county
function: Find
inputs: United Kingdom
function: Relate
dependencies: 3
inputs: country
backward
function: FilterConcept
dependencies: 4
inputs: non-metropolitan county
function: Or
dependencies: 2
5
function: Count
dependencies: 6