which is the fictional character who lives in the planet of trek?
Entity Entity
m.012gt9 m.0hp0z
Sarek Tasha Yar
class class entity entity
fictional_universe.fictional_character fictional_universe.fictional_setting m.05qc_ m.06mv6
fictional_universe.fictional_character fictional_universe.fictional_setting fictional_universe.type_of_fictional_setting fictional_universe.fictional_universe
Fictional Character Fictional Setting Planet trek
none none none none
fictional_universe.fictional_character.places_lived fictional_universe.fictional_setting.setting_type fictional_universe.fictional_universe.locations
Places lived Setting type Locations
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 :fictional_universe.fictional_character . 
?x1 :type.object.type :fictional_universe.fictional_setting . 
VALUES ?x2 { :m.05qc_ } 
VALUES ?x3 { :m.06mv6 } 
?x0 :fictional_universe.fictional_character.places_lived ?x1 . 
?x1 :fictional_universe.fictional_setting.setting_type ?x2 . 
?x3 :fictional_universe.fictional_universe.locations ?x1 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x0 != ?x3 && ?x1 != ?x2 && ?x1 != ?x3 && ?x2 != ?x3  )
}
}
(AND fictional_universe.fictional_character (JOIN fictional_universe.fictional_character.places_lived (AND (JOIN fictional_universe.fictional_setting.setting_type m.05qc_) (JOIN (R fictional_universe.fictional_universe.locations) m.06mv6))))