Question: Which sovereign state (in the subject of Mongolia–Singapore relations) has a diplomatic relation with Singapore (which also has diplomatic relations with Brunei)?
Choices:
Switzerland
Kiribati
Mexico
Bangladesh
Mongolia
Russian Soviet Federative Socialist Republic
Weimar Republic
Cambodia
Japan
North Korea
Answer: Mongolia
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "sovereign state" . ?e <diplomatic_relation> ?e_1 . ?e_1 <pred:name> "Singapore" . ?e_1 <diplomatic_relation> ?e_2 . ?e_2 <pred:name> "Brunei" .  [ <pred:fact_h> ?e ; <pred:fact_r> <diplomatic_relation> ; <pred:fact_t> ?e_1 ] <statement_is_subject_of> ?qpv . ?qpv <pred:value> "Mongolia–Singapore relations" .  }
Program:
function: Find
inputs: Brunei
function: Relate
dependencies: 0
inputs: diplomatic relation
backward
function: Find
inputs: Singapore
function: And
dependencies: 1
2
function: Relate
dependencies: 3
inputs: diplomatic relation
backward
function: QFilterStr
dependencies: 4
inputs: statement is subject of
Mongolia–Singapore relations
function: FilterConcept
dependencies: 5
inputs: sovereign state
function: What
dependencies: 6