what drug dosage flavor is the flavor of the manufactured drug form with the latest marketing end date?
Entity
m.05s38
Peppermint
class class literal
medicine.drug_dosage_flavor medicine.manufactured_drug_form 0^^http://www.w3.org/2001/XMLSchema#int
medicine.drug_dosage_flavor medicine.manufactured_drug_form type.datetime
Drug dosage flavor Manufactured drug form 0
none none argmax
medicine.manufactured_drug_form.flavor medicine.manufactured_drug_form.marketing_end_date
Flavor Marketing end date
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_dosage_flavor . 
?x1 :type.object.type :medicine.manufactured_drug_form . 
{
SELECT (MAX(?y2) AS ?x2)  WHERE { 
?y0 :type.object.type :medicine.drug_dosage_flavor . 
?y1 :type.object.type :medicine.manufactured_drug_form . 
?y1 :medicine.manufactured_drug_form.flavor ?y0 . 
?y1 :medicine.manufactured_drug_form.marketing_end_date ?y2 . 
FILTER ( ?y0 != ?y1 && ?y0 != ?y2 && ?y1 != ?y2  )
}
}
?x1 :medicine.manufactured_drug_form.flavor ?x0 . 
?x1 :medicine.manufactured_drug_form.marketing_end_date ?x2 . 
FILTER ( ?x0 != ?x1 && ?x0 != ?x2 && ?x1 != ?x2  )
}
}
(ARGMAX medicine.drug_dosage_flavor (JOIN (R medicine.manufactured_drug_form.flavor) medicine.manufactured_drug_form.marketing_end_date))