Question: How many cities are the place of publication of Hamlet (which publicates in Leipzig) or have a population greater than 5900000?
Choices:
38
39
40
41
42
43
44
45
46
47
Answer: 38
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city" .  { ?e_1 <place_of_publication> ?e . ?e_1 <pred:name> "Hamlet" . ?e_1 <place_of_publication> ?e_2 . ?e_2 <pred:name> "Leipzig" .  } UNION { ?e <population> ?pv . ?pv <pred:unit> "1" . ?pv <pred:value> ?v . FILTER ( ?v > "5900000"^^xsd:double ) .  } }
Program:
function: Find
inputs: Leipzig
function: Relate
dependencies: 0
inputs: place of publication
backward
function: Find
inputs: Hamlet
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: place of publication
forward
function: FilterConcept
dependencies: 4
inputs: city
function: FindAll
function: FilterNum
dependencies: 6
inputs: population
5900000
>
function: FilterConcept
dependencies: 7
inputs: city
function: Or
dependencies: 5
8
function: Count
dependencies: 9