Question: Which higher education institution is located in the town that is the headquarters location of Surrey (which contains River Thames)?
Choices: Imperial College London
Pennsylvania State University
Stanford University
McNeese State University
Kingston University
University of Durham
University of Manchester
Southern Illinois University Carbondale
University of California, San Diego
Los Angeles City College
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "higher education institution" . ?e <located_in_the_administrative_territorial_entity> ?e_1 . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "town" . ?e_2 <headquarters_location> ?e_1 . ?e_2 <pred:name> "Surrey" . ?e_3 <located_in_the_administrative_territorial_entity> ?e_2 . ?e_3 <pred:name> "River Thames" .   }
Program:
function: Find
inputs: River Thames
function: Relate
dependencies: 0
inputs: located in the administrative territorial entity
forward
function: Find
inputs: Surrey
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: headquarters location
forward
function: FilterConcept
dependencies: 4
inputs: town
function: Relate
dependencies: 5
inputs: located in the administrative territorial entity
backward
function: FilterConcept
dependencies: 6
inputs: higher education institution
function: What
dependencies: 7
Answer: Kingston University