which countries have participated the olympic games held at cape town?
Entity Entity Entity Entity
m.07ssc m.09c7w0 m.0chghy m.035qy
United Kingdom United States of America Australia Greece
class class class entity
olympics.olympic_participating_country olympics.olympic_games olympics.olympic_city_bid m.01yj2
olympics.olympic_participating_country olympics.olympic_games olympics.olympic_city_bid olympics.olympic_bidding_city
Olympic participating country Olympic games Olympic city bid Cape Town
none none none none
olympics.olympic_games.participating_countries olympics.olympic_games.bidding_cities olympics.olympic_bidding_city.olympics_bid_on
Participating countries Bidding cities Olympics bid on
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX : <http://rdf.freebase.com/ns/> 
SELECT (?x0 AS ?value) WHERE {
SELECT DISTINCT ?x0  WHERE { 
?x0 :type.object.type :olympics.olympic_participating_country . 
?x1 :type.object.type :olympics.olympic_games . 
?x2 :type.object.type :olympics.olympic_city_bid . 
VALUES ?x3 { :m.01yj2 } 
?x1 :olympics.olympic_games.participating_countries ?x0 . 
?x1 :olympics.olympic_games.bidding_cities ?x2 . 
?x3 :olympics.olympic_bidding_city.olympics_bid_on ?x2 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x0 != ?x3 && ?x1 != ?x2 && ?x1 != ?x3 && ?x2 != ?x3  )
}
}
(AND olympics.olympic_participating_country (JOIN (R olympics.olympic_games.participating_countries) (JOIN olympics.olympic_games.bidding_cities (JOIN (R olympics.olympic_bidding_city.olympics_bid_on) m.01yj2))))