which drug has the legal status of class b?
Entity Entity
m.0256v m.0_0j
Codeine Amphetamine
class entity
medicine.drug m.04d1km4
medicine.drug medicine.drug_legal_status
Drug Class B
none none
medicine.drug.legal_status
Legal status
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.04d1km4 } 
?x0 :medicine.drug.legal_status ?x1 . 
FILTER ( ?x0 != ?x1  )
}
}
(AND medicine.drug (JOIN medicine.drug.legal_status m.04d1km4))