SELECT DISTINCT ?uri WHERE { ?x <http://dbpedia.org/ontology/residence> <http://dbpedia.org/resource/Prime_Minister's_House_(Colombo)> . ?uri <http://dbpedia.org/ontology/leader> ?x . ?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PoliticalParty>}
What are the political parties whose leaders have lived in the Prime Minister's House?
SELECT DISTINCT ?p WHERE { ?i property:residence resource:Prime_Minister's_House_(_Colombo) . ?p rdf:type ontology:Political_Party . ?p property:leader ?i }
United National Party, United National Front (Sri Lanka)
The political parties whose leader's residence was Prime Minister's House are [United National Party, United National Front (Sri Lanka)].
The political parties whose leader lived in the prime minister's house are the [United National Party, United National Front (Sri Lanka)].