Question: What historic county in England is the source of the name Middlesex County (whose capital is Middletown) and shares a border with Buckinghamshire?
Choices:
Fayette County
The Pink Panther 2
Middlesex
Cambridgeshire
Marc Shaiman
Sussex
Chrysler
Yorkshire
Hawaiian Islands
Idaho
Program:
function: Find
inputs: Middletown
function: Relate
dependencies: 0
inputs: capital
backward
function: Find
inputs: Middlesex County
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: named after
forward
function: FilterConcept
dependencies: 4
inputs: historic county of England
function: Find
inputs: Buckinghamshire
function: Relate
dependencies: 6
inputs: shares border with
backward
function: FilterConcept
dependencies: 7
inputs: historic county of England
function: And
dependencies: 5
8
function: What
dependencies: 9
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "historic county of England" . ?e_1 <named_after> ?e . ?e_1 <pred:name> "Middlesex County" . ?e_1 <capital> ?e_2 . ?e_2 <pred:name> "Middletown" .  ?e <shares_border_with> ?e_3 . ?e_3 <pred:name> "Buckinghamshire" .  }
Answer: Middlesex