Question: How many independent cities share a border with Portsmouth  (the one that shares border with Newport News) or are the birthplace of Mike Watt (the one that is famous for hard rock)?
Choices:
4
5
6
7
8
9
10
11
12
13
Answer: 6
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "independent city" .  { ?e_1 <shares_border_with> ?e . ?e_1 <pred:name> "Portsmouth" . ?e_2 <shares_border_with> ?e_1 . ?e_2 <pred:name> "Newport News" .  } UNION { ?e_1 <place_of_birth> ?e . ?e_1 <pred:name> "Mike Watt" . ?e_2 <famous_people> ?e_1 . ?e_2 <pred:name> "hard rock" .  } }
Program:
function: Find
inputs: Newport News
function: Relate
dependencies: 0
inputs: shares border with
forward
function: Find
inputs: Portsmouth
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: shares border with
forward
function: FilterConcept
dependencies: 4
inputs: independent city
function: Find
inputs: hard rock
function: Relate
dependencies: 6
inputs: famous people
forward
function: Find
inputs: Mike Watt
function: And
dependencies: 7
8
function: Relate
dependencies: 9
inputs: place of birth
forward
function: FilterConcept
dependencies: 10
inputs: independent city
function: Or
dependencies: 5
11
function: Count
dependencies: 12