select distinct ?x where { ?x . ?y . ?z . ?x ?z. ?z ?y. ?x ?y. }