what is the {statement is subject of} for {Paraguay} has {diplomatic relation} as {Peru} ?
does peru had diplomatic relation to paraguay?
what is the {statement is subject of} for {Paraguay} that has {diplomatic relation} as {Peru} ?
SELECT ?b WHERE { ?c property:diplomatic_relation resource:Peru . ?c property:statement_is_subject_of ?b . resource:Paraguay property:diplomatic_relation ?c }
select distinct ?value  where {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q733> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P530> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q419> .
?statement <http://www.wikidata.org/entity/P805> ?value. 
} 

SELECT ?value WHERE { wd:Q733 p:P530 ?s . ?s ps:P530 wd:Q419 . ?s pq:P805 ?value}