which is the contraindication of the treatment with side effect of head ache?
Entity Entity Entity
m.01xcnj m.05vqh7 m.02z1hl3
Hypersensitivity Pregnancy Driving
class class entity
medicine.contraindication medicine.medical_treatment m.0j5fv
medicine.contraindication medicine.medical_treatment medicine.symptom
Contraindication Medical Treatment head ache
none none none
medicine.medical_treatment.contraindications medicine.symptom.side_effect_of
Contraindications Side effect of
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.contraindication . 
?x1 :type.object.type :medicine.medical_treatment . 
VALUES ?x2 { :m.0j5fv } 
?x1 :medicine.medical_treatment.contraindications ?x0 . 
?x2 :medicine.symptom.side_effect_of ?x1 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(AND medicine.contraindication (JOIN (R medicine.medical_treatment.contraindications) (JOIN (R medicine.symptom.side_effect_of) m.0j5fv)))