Paste the SPARQL into http://cheminfov.informatics.indiana.edu:8890/sparql to run it

Three cases in the BMC
advanced queries using in Chem2Bio2OWL

1) Q: find targets of chemicals
Only from Drugbank:
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX drugbank: <http://chem2bio2rdf.org/drugbank/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
SELECT ?compound_cid  ?geneSymbol
FROM <http://chem2bio2rdf.org/pubchem>
FROM <http://chem2bio2rdf.org/drugbank>
FROM <http://chem2bio2rdf.org/uniprot>
WHERE
 {
   ?compound compound:CID ?compound_cid . FILTER
(?compound_cid=123631 or ?compound_cid=84836) .
   ?drug drugbank:CID ?compound .
   ?target drugbank:DBID ?drug .
   ?target drugbank:gene ?gene .
   ?gene  uniprot:geneSymbol  ?geneSymbol .
 
 }
 
From Drugbank and BindingDB, using uniprot as protein identifier instead:
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX bindingdb: <http://chem2bio2rdf.org/bindingdb/resource/>
PREFIX drugbank: <http://chem2bio2rdf.org/drugbank/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
SELECT ?uniprot_id
FROM <http://chem2bio2rdf.org/pubchem>
FROM <http://chem2bio2rdf.org/drugbank>
FROM <http://chem2bio2rdf.org/bindingdb>
FROM <http://chem2bio2rdf.org/uniprot>
 
WHERE {
{?compound compound:CID ?compound_cid . FILTER (?compound_cid= 123631) .
      ?chemical bindingdb:cid ?compound .
      ?target bindingdb:Monomerid ?chemical.
      ?target bindingdb:ic50_value ?ic50  . FILTER (?ic50<10000) .
      ?target bindingdb:uniprot?uniprot.
      ?uniprot uniprot:uniprot ?uniprot_id .
}
UNION
 {?compound compound:CID ?compound_cid . FILTER (?compound_cid= 123631) .
       ?drug drugbank:CID ?compound .
       ?target drugbank:DBID ?drug .
       ?target drugbank:SwissProt_ID ?uniprot.
       ?uniprot uniprot:uniprot ?uniprot_id .
}
}
GROUP BY ?uniprot_id

2) find chemical associated genes
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX chemogenomics: <http://chem2bio2rdf.org/chemogenomics/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
SELECT ?compound_cid ?geneSymbol ?med_interested ?primary_source
FROM <http://chem2bio2rdf.org/pubchem>
FROM <http://chem2bio2rdf.org/chemogenomics>
FROM <http://chem2bio2rdf.org/uniprot>
WHERE
 {
   ?compound compound:CID ?compound_cid . FILTER (?compound_cid=123631 or ?compound_cid=84836) .
   ?chemogenomics chemogenomics:CID ?compound .
   ?chemogenomics chemogenomics:GENE ?gene .
   ?chemogenomics chemogenomics:med_interested ?med_interested.
   ?chemogenomics chemogenomics:primary_source ?primary_source.
   ?gene  uniprot:geneSymbol  ?geneSymbol .
  }
Primary_source: The data sources that have the corresponding association
med_interested: 1 is interested, 0 is not. How to define med_interested (the binding affinity <30um if available)

3) find gene associated chemicals
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX chemogenomics: <http://chem2bio2rdf.org/chemogenomics/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
SELECT ?compound_cid ?geneSymbol ?med_interested ?primary_source
FROM <http://chem2bio2rdf.org/pubchem>
FROM <http://chem2bio2rdf.org/chemogenomics>
FROM <http://chem2bio2rdf.org/uniprot>
WHERE
 {
   ?compound compound:CID ?compound_cid .
   ?chemogenomics chemogenomics:CID ?compound .
   ?chemogenomics chemogenomics:GENE ?gene .
   ?chemogenomics chemogenomics:med_interested ?med_interested. FILTER (?med_interested=1) .
   ?chemogenomics chemogenomics:primary_source ?primary_source.
   ?gene  uniprot:geneSymbol  ?geneSymbol . FILTER (?geneSymbol ="ABCB1") .
  }

4) find disease associated chemicals
Find drugs from OMIM disease which extracted drug disease association from DrugBank
PREFIX omim: <http://chem2bio2rdf.org/omim/resource/>
 
SELECT *
FROM <http://chem2bio2rdf.org/omim>
WHERE
 {
   ?omim_disease omim:drug ?drug .
   ?omim_disease omim:Name ?disease . FILTER regex(?disease,"Alzheimer","i") .
  }

(OMIM disease ---OMIM gene ---chemogenomics compound
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX chemogenomics: <http://chem2bio2rdf.org/chemogenomics/resource/>
PREFIX omim: <http://chem2bio2rdf.org/omim/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
SELECT *
FROM <http://chem2bio2rdf.org/pubchem>
FROM <http://chem2bio2rdf.org/chemogenomics>
FROM <http://chem2bio2rdf.org/omim>
FROM <http://chem2bio2rdf.org/uniprot>
WHERE
 {
   ?compound compound:CID ?compound_cid .
   ?chemogenomics chemogenomics:CID ?compound .
   ?chemogenomics chemogenomics:GENE ?gene .
   ?chemogenomics chemogenomics:med_interested ?med_interested. FILTER (?med_interested=1) .
   ?gene uniprot:geneSymbol ?geneSymbol .
   ?omim_id omim:gene ?geneSymbol .
   ?omim_disease omim:gene ?omim_id .
   ?omim_disease omim:Name ?disease . FILTER regex(?disease,"Alzheimer","i") .
  }

5) find side effect associated chemicals
PREFIX sider: <http://chem2bio2rdf.org/sider/resource/>
 
SELECT *
FROM <http://chem2bio2rdf.org/sider>
WHERE
 {
 ?sider sider:cid ?cid .
 ?sider sider:side_effect ?side_effect .  FILTER regex(?side_effect,"hypertension","i") .
 }
 
6) PXR study
7) cases for cytoscape
8) chemogenomics

9) what can we learn about compound:123631 from Chem2Bio2RDF
select *
where
{
{ <http://chem2bio2rdf.org/pubchem/resource/pubchem_compound/123631> ?p ?o }
union
{ ?s ?p <http://chem2bio2rdf.org/pubchem/resource/pubchem_compound/123631>  }
}
 
10) what can we lean about target: NR1I2 from Chem2Bio2RDF
select ?s, ?p,?o
where
{
{ <http://chem2bio2rdf.org/uniprot/resource/gene/NR1I2> ?p ?o }
union
{ ?s ?p <http://chem2bio2rdf.org/uniprot/resource/gene/NR1I2>  }
}
11) Give the literatures talking about pathway (eg.Calcium signaling pathway) and side effect (eg: cancer)
PREFIX medline: <http://chem2bio2rdf.org/medline/resource/>
PREFIX kegg: <http://chem2bio2rdf.org/kegg/resource/>
PREFIX sider: <http://chem2bio2rdf.org/sider/resource/>
 
select distinct ?pmid
from <http://chem2bio2rdf.org/medline>
from <http://chem2bio2rdf.org/kegg>
from <http://chem2bio2rdf.org/sider>
 
where
{
 ?kegg_id kegg:Pathway_name ?pathway_name . FILTER regex(?pathway_name,"Calcium signaling pathway","i") .
 ?pmid medline:pathway ?kegg_id .
 ?pmid  medline:side_effect ?sider .
 ?sider sider:side_effect ?side_effect .  FILTER regex(?side_effect,"cancer","i") .
}
12) find carcinogen
PREFIX carcinogen: <http://chem2bio2rdf.org/carcinogen/resource/>
PREFIX compound: <http://chem2bio2rdf.org/pubchem/resource/>
 
select ?cid,?histopathology
from <http://chem2bio2rdf.org/carcinogen>
from <http://chem2bio2rdf.org/pubchem>
where
{?compound compound:CID ?cid . FILTER (?cid=7002) .
?tumor carcinogen:cid ?compound .
?tumor carcinogen:histopathology ?histopathology .
}

13) find tissue expression

PREFIX hprd: <http://chem2bio2rdf.org/hprd/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
select ?geneSymbol,?tissue
from <http://chem2bio2rdf.org/hprd>
from <http://chem2bio2rdf.org/uniprot>
where
{?gene  uniprot:geneSymbol  ?geneSymbol . FILTER (?geneSymbol ="SAA4")
?expression hprd:geneSymbol  ?gene .
?expression hprd:tissue ?tissue.
}

14) find protein protein interaction in BioGrid
PREFIX ppi: <http://chem2bio2rdf.org/biogrid/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
 
select *
from <http://chem2bio2rdf.org/biogrid>
from <http://chem2bio2rdf.org/uniprot>
where
{?gene_A  uniprot:geneSymbol  ?geneSymbol . FILTER (?geneSymbol ="F2")
?ppi ppi:official_symbol_a ?gene_A .
?ppi ppi:official_symbol_b ?gene_B .
}

15) find the assay details of compound 5591 against ppar.
PREFIX pubchem: <http://chem2bio2rdf.org/pubchem/resource/>
PREFIX chembl: <http://chem2bio2rdf.org/chembl/resource/>
PREFIX uniprot: <http://chem2bio2rdf.org/uniprot/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 
select ?pre_name ?standard_value  ?standard_units ?pubmed_id
from <http://chem2bio2rdf.org/pubchem>
from <http://chem2bio2rdf.org/chembl>
from <http://chem2bio2rdf.org/uniprot>
 
where{
?pubchem_compound rdfs:label '5591' .
 
?compound chembl:cid ?pubchem_compound .
 
?activities chembl:molregno ?compound ;
    chembl:standard_value ?standard_value ;
    chembl:standard_units ?standard_units ;
    chembl:assay_id ?assay_id .
 
?assay2target chembl:assay_id ?assay_id .
?assay2target chembl:tid ?target .
 
?target chembl:pref_name ?pre_name .
 
FILTER regex(?pre_name,"Peroxisome proliferator","i") .
optional {?activities chembl:doc_id [chembl:pubmed_id ?pubmed_id]}
}
 
16) Integrate with ChEMBL




We suggest to taking a look at the structure of individual souces before writing SPARQL, please contact us (binchen@indiana.edu) for help.