Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SPARQL Queries from drug --> disease, mechanism
prefix rxnorm: <http://purl.bioontology.org/ontology/RXNORM/> 
prefix skos: <http://www.w3.org/2004/02/skos/core#> 
prefix umls: <http://bioportal.bioontology.org/ontologies/umls/> 
prefix ndfrt: <http://purl.bioontology.org/ontology/NDFRT/> 
SELECT distinct ?d ?label 
WHERE { 
 FILTER (?d = rxnorm:153843 ||
         ?d = rxnorm:312961 ||
         ?d = rxnorm:866514 ||
         ?d = rxnorm:762675 ||
         ?d = rxnorm:866511 ||
         ?d = rxnorm:381056 ||
         ?d = rxnorm:197589)
   ?d rxnorm:consists_of ?c.
   ?c rxnorm:has_ingredient ?i.
   ?i umls:cui ?cui.
   ?i skos:prefLabel ?label.
   ?ndfrtdrug umls:cui ?cui.
   ?ndfrtdrug ndfrt:has_mechanism_of_action ndfrt:N0000000121.
}

Run at sparql.bioontology.org

prefix skos: <http://www.w3.org/2004/02/skos/core#> 
prefix rxnorm: <http://purl.bioontology.org/ontology/RXNORM/>
prefix umls: <http://bioportal.bioontology.org/ontologies/umls/>
prefix ndfrt: <http://purl.bioontology.org/ontology/NDFRT/>
SELECT distinct ?d ?drugLabel
WHERE { 
 FILTER (?d = rxnorm:153843 ||
         ?d = rxnorm:312961 ||
         ?d = rxnorm:866514 ||
         ?d = rxnorm:762675 ||
         ?d = rxnorm:866511 ||
         ?d = rxnorm:381056 ||
         ?d = rxnorm:197589)
 ?d rxnorm:consists_of ?c.
 ?c rxnorm:has_ingredient ?i.
 ?d skos:prefLabel ?drugLabel.
 ?i umls:cui ?cui.
 ?ndfrtdrug umls:cui ?cui.
 ?ndfrtdrug ndfrt:may_treat ndfrt:N0000000954.
}

Run at sparql.bioontology.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.