find drugs whose active moieties is tetracaine.
Entity Entity Entity Entity
m.0hqvl88 m.0hqvgjl m.0hqxm1n m.0hqvth6
Lidocaine/Tetracaine Benzocaine/Tetracaine Tetracaine hydrochloride Benzocaine/Butamben/Tetracaine
class entity
medicine.drug m.02vkd84
medicine.drug medicine.drug_ingredient
Drug Tetracaine
none none
medicine.drug.active_moieties
Active moieties
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 :medicine.drug . 
VALUES ?x1 { :m.02vkd84 } 
?x0 :medicine.drug.active_moieties ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND medicine.drug (JOIN medicine.drug.active_moieties m.02vkd84))