Skip to content
Michel Dumontier edited this page Apr 25, 2023 · 36 revisions

Get phenotypes for psoriasis using OMIM

[run query]

data sources: OMIM

 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX owl: <http://www.w3.org/2002/07/owl#>
 PREFIX ov: <http://bio2rdf.org/omim_vocabulary:>
 PREFIX dct: <http://purl.org/dc/terms/>
 SELECT distinct ?o ?pc
 { 
  ?disease ?a ?type .
  ?disease dct:title ?c .
  ?c <bif:contains> "psoriasis" .
  FILTER (?type = <http://bio2rdf.org/omim_vocabulary:Phenotype>)
  ?disease ov:clinical-synopsis ?cs .
  ?cs ov:feature ?f .
  ?f ov:x-hp|ov:x-umls|ov:x-snomed ?o .
  OPTIONAL {
    ?o rdfs:label ?pc
  } 
} 

Get genes and phenotypes associated with OMIM diseases

[run query]

data sources: OMIM

 PREFIX om: <http://bio2rdf.org/omim_vocabulary:>
 PREFIX dct: <http://purl.org/dc/terms/>
 PREFIX b: <http://bio2rdf.org/bio2rdf_vocabulary:>

 SELECT (?s AS ?disease) (str(?name) As ?label) 
  (group_concat(distinct ?hp; separator=", ") as ?hp)   
  (group_concat(distinct ?umls; separator=", ") as ?umls)  
  (group_concat(distinct ?gs; separator=", ") AS ?genes)
 {
  ?s a om:Phenotype .
  ?s dct:title ?name .
  ?s om:clinical-synopsis ?cs .
  ?cs om:feature ?f .
  ?f om:x-umls/b:identifier ?umls .
  ?f om:x-hp/dct:identifier ?hp .
  ?s om:phenotype-map ?pm .
  ?pm om:gene-symbol/b:identifier ?gs .
 } GROUP BY ?s ?name
 LIMIT 100

Get drug-metabolizing enzymes and their substrates

[run query]

data sources: DrugBank

 PREFIX dv: <http://bio2rdf.org/drugbank_vocabulary:>
 PREFIX dct: <http://purl.org/dc/terms/>

 SELECT distinct ?enzyme_name ?drug_name 
 {
  ?s a dv:Enzyme-Relation .
  ?s dv:enzyme/dct:title ?enzyme_name .
  ?s dv:drug/dct:title ?drug_name .
 } 
 LIMIT 100

###Get the cardiovascular phenotypes of knock-out mouse models for the targets of a selected drug (Imatinib) [run query]

data sources: DrugBank, HGNC, MGI, BioPortal

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT distinct ?phenotype_label
{
SERVICE <http://drugbank.bio2rdf.org/sparql> {
    ?drug <http://bio2rdf.org/drugbank_vocabulary:target> ?target .
    FILTER(?drug = <http://bio2rdf.org/drugbank:DB00619>) #imatinib
    ?target <http://bio2rdf.org/drugbank_vocabulary:x-hgnc> ?hgnc .
   }
  SERVICE <http://hgnc.bio2rdf.org/sparql> {
    ?hgnc <http://bio2rdf.org/hgnc_vocabulary:x-mgi> ?marker .
   }    
  SERVICE <http://mgi.bio2rdf.org/sparql> {
    ?model <http://bio2rdf.org/mgi_vocabulary:marker> ?marker .
    ?model <http://bio2rdf.org/mgi_vocabulary:allele> ?all .
    ?all <http://bio2rdf.org/mgi_vocabulary:allele-attribute> ?allele_type .
    ?model <http://bio2rdf.org/mgi_vocabulary:phenotype> ?phenotypes .
    FILTER (str(?allele_type) = "Null/knockout") 
   }

    SERVICE <http://bioportal.bio2rdf.org/sparql> {
    ?mp owl:sameAs ?phenotypes .  # map from bio2rdf to MP URIs
    ?mp rdfs:label ?phenotype_label .
    ?mp rdfs:subClassOf* mp:0005385 # cardiovascular phenotypes
   }
 }

Obsolete Queries

###Reasoning over the Gene Ontology with the Biomodels database

the following query will count all the biochemical reactions in the biomodels database that are involved in "protein catabolic process". It works first by getting all the biochemical reactions labelled with that GO term (using the bioportal endpoint), and joining these results with all the biochemical reactions that are annotated with GO terms that are more specific than "protein catabolic process"

SELECT ?go ?label count(distinct ?x)
WHERE {
   { 
    # get all the biochemical reactions specifically labelled with protein catabolic process
    ?go rdfs:label ?label .
    FILTER regex(?label, "^protein catabolic process")
    service <http://biomodels.bio2rdf.org/sparql> {
     ?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go . 
     ?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
    } # end service

   } UNION {
    # get all the biochemical reactions that are more specific than "protein catabolic process"
    ?go rdfs:label ?label .
    ?go rdfs:subClassOf ?tgo OPTION (TRANSITIVE) . # get all the subclasses of the target to term
    ?tgo rdfs:label ?tlabel .
    FILTER regex(?tlabel, "^protein catabolic process")
    service <http://biomodels.bio2rdf.org/sparql> {
     ?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go . 
     ?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
    } # end service
   } # end union
} # end where

The following is an alternative version of the previous query that does not make use of rdfs:label to find go terms that share the "protein catabolic process" (GO:0030163) term.

SELECT ?go ?label count(distinct ?x)
WHERE {
   { 
    ?go rdfs:label ?label .
    FILTER (?go = <http://bio2rdf.org/go:0030163>)
    service <http://biomodels.bio2rdf.org/sparql> {
     ?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go . 
     ?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
    } 
} UNION {
    ?go rdfs:label ?label .
    ?go rdfs:subClassOf ?tgo OPTION (TRANSITIVE) . 
    FILTER (?tgo = <http://bio2rdf.org/go:0030163>)
    service <http://biomodels.bio2rdf.org/sparql> {
     ?x <http://bio2rdf.org/biopax_vocabulary:identical-to> ?go . 
     ?x a <http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction> .
    } 
   }
} 

Evaluating the disparity between the amount of research and burden of disease

This SPARQL query utilizes 3 datasets: PubMed, GHO and LinkedCT (only PubMed belonging to Bio2RDF). This SPARQL query can be executed on this endpoint: http://db0.aksw.org:8895/sparql

This query counts the number of distinct publications and number of distinct deaths due to the disease Tuberculosis in the country India.

PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX att: <http://purl.org/linked-data/sdmx/2009/attribute#>
PREFIX eg: <http://example.com/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ct: <http://data.linkedct.org/resource/linkedct/>
PREFIX gho: <http://ghodata/>
PREFIX redd: <http://redd.aksw.org/>
SELECT count(distinct(?publication)) AS ?no_of_publications count(?deaths) AS ?no_of_deaths
WHERE {
    ?item a qb:Observation ;
    gho:Country ?country .
    ?country rdfs:label "India" .
    ?item gho:Disease ?disease .
    ?disease rdfs:label "Tuberculosis".
    ?item att:unitMeasure gho:Measure .
    ?item eg:incidence ?deaths .
    ?trial a ct:trials .
    ?trial ct:condition ?condition .
    ?condition owl:sameAs ?disease .
    ?trial ct:location ?location .
    ?location redd:locatedIn ?country .
    ?trial ct:reference ?publication.
    ?publication ct:citation ?citation.
}

Get articles associated with a particular named author

PubMed no longer in build of Bio2RDF

data sources: PubMed

 PREFIX v: <http://bio2rdf.org/pubmed_vocabulary:>
 SELECT ?article ?article_title
 {
  ?article ?p ?author .
  ?article rdfs:label ?article_title .
  ?article a v:PubMedRecord .
  ?author a v:Author .
  ?author v:last_name ?ln .
  ?author v:initials ?in .
  ?ln bif:contains "dumontier" .
  ?in bif:contains "m" .
 } LIMIT 50