Question: How many cities in New Jersey either have the postal code of 07504 or have the capital of Mercer County, with the administrative division of Trenton?
Choices:
0
1
2
3
4
5
6
7
8
9
Answer: 2
SPARQL: SELECT (COUNT(DISTINCT ?e) AS ?count) WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city in New Jersey" .  { ?e <postal_code> ?pv . ?pv <pred:value> "07504" .  } UNION { ?e_1 <capital> ?e . ?e_1 <pred:name> "Mercer County" . ?e_1 <contains_administrative_territorial_entity> ?e_2 . ?e_2 <pred:name> "Trenton" .  } }
Program:
function: FindAll
function: FilterStr
dependencies: 0
inputs: postal code
07504
function: FilterConcept
dependencies: 1
inputs: city in New Jersey
function: Find
inputs: Trenton
function: Relate
dependencies: 3
inputs: contains administrative territorial entity
backward
function: Find
inputs: Mercer County
function: And
dependencies: 4
5
function: Relate
dependencies: 6
inputs: capital
forward
function: FilterConcept
dependencies: 7
inputs: city in New Jersey
function: Or
dependencies: 2
8
function: Count
dependencies: 9