who was a guest on the better know a district - massachusetts' 4th - barney frank tv segment?
Entity
m.0d0lx0
Barney Frank
class class entity
tv.tv_program_guest tv.tv_segment_guest_appearance m.0107bqmp
tv.tv_program_guest tv.tv_segment_guest_appearance tv.tv_episode_segment
TV program guest TV segment guest appearance Better Know a District - Massachusetts' 4th - Barney Frank
none none none
tv.tv_segment_guest_appearance.person tv.tv_segment_guest_appearance.segment
Person Segment
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 :tv.tv_program_guest . 
?x1 :type.object.type :tv.tv_segment_guest_appearance . 
VALUES ?x2 { :m.0107bqmp } 
?x1 :tv.tv_segment_guest_appearance.person ?x0 . 
?x1 :tv.tv_segment_guest_appearance.segment ?x2 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND tv.tv_program_guest (JOIN (R tv.tv_segment_guest_appearance.person) (JOIN tv.tv_segment_guest_appearance.segment m.0107bqmp)))