what was the tennis tournament in which r nadal beat federer?
Entity Entity Entity Entity
m.0p58j m.012xcl m.062ptd m.0mmmt
Australian Open Tennis Tournament French Open Monte-Carlo Masters Wimbledon
class class entity entity
tennis.tennis_tournament tennis.tennis_match m.051q39 m.01my95
tennis.tennis_tournament tennis.tennis_match tennis.tennis_tournament_champion tennis.tennis_player
Tennis Tournament Tennis Match r nadal federer
none none none none
tennis.tennis_match.event tennis.tennis_player.matches_won tennis.tennis_player.matches_lost
Event Matches Won Matches Lost
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 :tennis.tennis_tournament . 
?x1 :type.object.type :tennis.tennis_match . 
VALUES ?x2 { :m.051q39 } 
VALUES ?x3 { :m.01my95 } 
?x1 :tennis.tennis_match.event ?x0 . 
?x2 :tennis.tennis_player.matches_won ?x1 . 
?x3 :tennis.tennis_player.matches_lost ?x1 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x0 != ?x3 && ?x1 != ?x2 && ?x1 != ?x3 && ?x2 != ?x3  )
}
}
(AND tennis.tennis_tournament (JOIN (R tennis.tennis_match.event) (AND (JOIN (R tennis.tennis_player.matches_won) m.051q39) (JOIN (R tennis.tennis_player.matches_lost) m.01my95))))