Question: What capital equals the capital of the nation, that has a diplomatic relationship with Algeria (the subject of this statement is Algeria–Cyprus relations)?
Choices:
Moscow
Nairobi
Ottawa
Nicosia
Wellington
Doha
Sarajevo
Lausanne
Riyadh
Minsk
Program:
function: Find
inputs: Algeria
function: Relate
dependencies: 0
inputs: diplomatic relation
forward
function: QFilterStr
dependencies: 1
inputs: statement is subject of
Algeria–Cyprus relations
function: FilterConcept
dependencies: 2
inputs: sovereign state
function: Relate
dependencies: 3
inputs: capital
forward
function: FilterConcept
dependencies: 4
inputs: capital
function: What
dependencies: 5
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "capital" . ?e_1 <capital> ?e . ?e_1 <pred:instance_of> ?c_1 . ?c_1 <pred:name> "sovereign state" . ?e_2 <diplomatic_relation> ?e_1 . ?e_2 <pred:name> "Algeria" . [ <pred:fact_h> ?e_2 ; <pred:fact_r> <diplomatic_relation> ; <pred:fact_t> ?e_1 ] <statement_is_subject_of> ?qpv . ?qpv <pred:value> "Algeria–Cyprus relations" .   }
Answer: Nicosia