Did {Shanghai} {twinned administrative body} {Basel} and {Porto} ?
Is the Shanghai government similar to Basel and Porto?
Is Shanghai twinned administrative body Basel and Porto?
ASK WHERE { resource:Shanghai property:twinned_administrative_body resource:Basel . resource:Shanghai property:twinned_administrative_body resource:Porto }
 ASK { ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q8686> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P190> . ?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q78>. ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <http://wikidata.dbpedia.org/resource/Q8686> . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P190> . ?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q36433>. } 
ASK WHERE { wd:Q8686 wdt:P190 wd:Q78 . wd:Q8686 wdt:P190 wd:Q36433 }