what personal appearance role has a episode segment appearances including a tv segment personal appearance with segment martha stewart living: anatomy of a wedding cake?
Entity
m.02nrqjz
Host
class class entity
tv.non_character_role tv.tv_segment_personal_appearance m.0_7fjyb
tv.non_character_role tv.tv_segment_personal_appearance tv.tv_episode_segment
Personal appearance role TV segment personal appearance Martha Stewart Living: Anatomy of a Wedding Cake
none none none
tv.non_character_role.episode_segment_appearances tv.tv_segment_personal_appearance.segment
Episode segment appearances 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.non_character_role . 
?x1 :type.object.type :tv.tv_segment_personal_appearance . 
VALUES ?x2 { :m.0_7fjyb } 
?x0 :tv.non_character_role.episode_segment_appearances ?x1 . 
?x1 :tv.tv_segment_personal_appearance.segment ?x2 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND tv.non_character_role (JOIN tv.non_character_role.episode_segment_appearances (JOIN tv.tv_segment_personal_appearance.segment m.0_7fjyb)))