Question: What form of government has a diplomatic relationship with Malaysia (the subject of this statement is Malaysia–Tanzania relations) and has a diplomatic relationship with North Korea?
Choices:
Tunisia
Italy
Bolivia
Namibia
Indonesia
Tanzania
Zimbabwe
Sierra Leone
Germany
Colombia
Program:
function: Find
inputs: Malaysia
function: Relate
dependencies: 0
inputs: diplomatic relation
forward
function: QFilterStr
dependencies: 1
inputs: statement is subject of
Malaysia–Tanzania relations
function: FilterConcept
dependencies: 2
inputs: form of government
function: Find
inputs: North Korea
function: Relate
dependencies: 4
inputs: diplomatic relation
backward
function: FilterConcept
dependencies: 5
inputs: form of government
function: And
dependencies: 3
6
function: What
dependencies: 7
SPARQL: SELECT DISTINCT ?e WHERE { ?e <pred:instance_of> ?c . ?c <pred:name> "form of government" . ?e_1 <diplomatic_relation> ?e . ?e_1 <pred:name> "Malaysia" .  [ <pred:fact_h> ?e_1 ; <pred:fact_r> <diplomatic_relation> ; <pred:fact_t> ?e ] <statement_is_subject_of> ?qpv . ?qpv <pred:value> "Malaysia–Tanzania relations" . ?e <diplomatic_relation> ?e_2 . ?e_2 <pred:name> "North Korea" .  }
Answer: Tanzania