Question: What city is the capital of the sovereign state sharing a border with Gambia?
Choices:
Vienna
Dakar
Kuwait City
Constantinople
Seoul
Cork
Kingston
Cairns
Kagoshima
Kinshasa
Program:
function: Find
inputs: Gambia
function: Relate
dependencies: 0
inputs: shares border with
backward
function: FilterConcept
dependencies: 1
inputs: sovereign state
function: Relate
dependencies: 2
inputs: capital of
backward
function: FilterConcept
dependencies: 3
inputs: city
function: What
dependencies: 4
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "city" . ?e <capital_of> ?e_1 . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "sovereign state" . ?e_1 <shares_border_with> ?e_2 . ?e_2 <pred:name> "Gambia" .   }
Answer: Dakar