Data

Dataset #triples #subjects #predicates #objects#types
omim 8,750,774 1,013,389 101 1,415,36434
pharmgkb 278,049,209 25,325,504 88 25,684,23550
drugbank 3,649,750 316,555 105 369,94791
sider 17,627,864 1,222,429 39 648,55516
kegg 50,197,150 6,533,307 141 6,792,31963

Query

Query #triplePattern #Result
q1 4 5
q2 9 40
q3 7 790
q4 8 9492
q5 8 111962
q3s 7 100
q5s 8 100

Query 1: Find the genes related to diabetes.

 select ?s1 ?o1 ?o2 
where{ 
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:refers-to> ?o1. 
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.
<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-snomedct> ?o2.
}

Query 2: Find out the articles about GPA patients and its drug functions,clinical features.

SELECT *
WHERE {
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/omim_vocabulary:Phenotype> .
?s <http://www.w3.org/2000/01/rdf-schema#label> ?o.
?s <http://bio2rdf.org/omim_vocabulary:clinical-features> ?clinicFeature.
?s <http://bio2rdf.org/omim_vocabulary:article> ?article.
?s <http://bio2rdf.org/omim_vocabulary:x-uniprot> ?protein.
filter(regex(str(?o),"GLUCOCORTICOID-REMEDIABLE ALDOSTERONISM","i"))
?drug  <http://bio2rdf.org/drugbank_vocabulary:gene-name> ?geneName.
 ?drug <http://bio2rdf.org/drugbank_vocabulary:x-uniprot> ?protein.
?drug  <http://bio2rdf.org/drugbank_vocabulary:general-function> ?genFunction.
?drug  <http://bio2rdf.org/drugbank_vocabulary:specific-function> ?speFunction.

}

Query 3: find out all the drugs, which are substrate of some enzyme, their category and reaction.

PREFIX kegg: <http://bio2rdf.org/kegg_vocabulary:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX drugbank: <http://bio2rdf.org/drugbank_vocabulary:>

SELECT * 
WHERE {  
?enzyme kegg:substrate ?cpd.
?enzyme <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/kegg_vocabulary:Enzyme>. 
?reaction kegg:enzyme  ?enzyme. 
?reaction kegg:reaction ?equation. 
?drug    drugbank:category ?category. 
?drug dcterms:description ?desc.
?drug drugbank:x-kegg ?cpd. 
 }

Query 3s:

PREFIX kegg: <http://bio2rdf.org/kegg_vocabulary:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX drugbank: <http://bio2rdf.org/drugbank_vocabulary:>

SELECT * 
WHERE {  
?enzyme kegg::substrate ?cpd.
?enzyme <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/kegg_vocabulary:Enzyme>. 
?reaction kegg:enzyme  ?enzyme. 
?reaction kegg:reaction ?equation. 
?drug    drugbank:category ?category. 
?drug dcterms:description ?desc.
?drug drugbank:x-kegg ?cpd. 
 } limit 100

Query 4:

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX sider:  <http://bio2rdf.org/sider:>
PREFIX sider_vocab: <http://bio2rdf.org/sider_vocabulary:>
PREFIX sider_resource: <http://bio2rdf.org/sider_resource:>
PREFIX drugbank: <http://bio2rdf.org/drugbank_vocabulary:>
PREFIX pubchem: <http://bio2rdf.org/pubchem.compound:>
PREFIX dbowl: <http://dbpedia.org/ontology/>

select *
where{

?drug sider_vocab:generic-name ?generic.
?drug dcterms:title ?drug_name .
?drug sider_vocab:side-effect ?side.
?drug sider_vocab:pubchem-flat-compound-id ?cpd.
?generic dcterms:title ?generic_name.
?side dcterms:title ?side_effect.

 ?drug_drugbank drugbank:category drugbank:Anti-Allergic-Agents.
 ?drug_drugbank drugbank:x-pubchemcompound ?cpd.
#  ?drug_drugbank drugbank:half-life ?halflife.
#   ?drug_drugbank drugbank:brand ?brand.
#  ?drug_drugbank drugbank:product  ?product.

}


Query 5: Find the side effect and pathway of the anticonvulsants

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX sider:  <http://bio2rdf.org/sider:>
PREFIX sider_vocab: <http://bio2rdf.org/sider_vocabulary:>
PREFIX sider_resource: <http://bio2rdf.org/sider_resource:>
PREFIX drugbank: <http://bio2rdf.org/drugbank_vocabulary:>
PREFIX pubchem: <http://bio2rdf.org/pubchem.compound:>
PREFIX dbowl: <http://dbpedia.org/ontology/>
PREFIX kegg: <http://bio2rdf.org/kegg_vocabulary:>

select *
where{

 ?drug_drugbank drugbank:category drugbank:Anticonvulsants.
 ?drug_drugbank drugbank:affected-organism ?affected.
 ?drug_drugbank drugbank:x-pubchemcompound ?cpd.

?drug sider_vocab:side-effect ?side.
?drug sider_vocab:pubchem-flat-compound-id ?cpd.
?side dcterms:title ?side_effect.

?drug_kegg kegg:x-pubchem.compound ?cpd.
 ?drug_kegg kegg:pathway  ?pathway.}

Query 5s:

add "limit 100" clause to Query 5.

Rewritten query with "service" keyword:

Query 1:

Query 1':

select ?s1 ?o1 ?o2 
where{

service<http://cu.pharmgkb.bio2rdf.org/sparql>
{<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-snomedct> ?o2.}


service<http://cu.omim.bio2rdf.org/sparql>
{
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:refers-to> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.}

} 

Query 1":

select ?s1 ?o1 ?o2 
where{
service<http://cu.omim.bio2rdf.org/sparql>
{
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:refers-to> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.}

service<http://cu.pharmgkb.bio2rdf.org/sparql>
{<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-snomedct> ?o2.}

} 

Query 2':

SELECT *
WHERE {
service<http://cu.omim.bio2rdf.org/sparql>{
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/omim_vocabulary:Phenotype> .
?s <http://www.w3.org/2000/01/rdf-schema#label> ?o.
?s <http://bio2rdf.org/omim_vocabulary:clinical-features> ?clinicFeature.
?s <http://bio2rdf.org/omim_vocabulary:article> ?article.
?s <http://bio2rdf.org/omim_vocabulary:x-uniprot> ?protein.
filter(regex(str(?o),"GLUCOCORTICOID-REMEDIABLE ALDOSTERONISM","i"))}

service<http://cu.drugbank.bio2rdf.org/sparql>

 {
?drug  <http://bio2rdf.org/drugbank_vocabulary:gene-name> ?geneName.
 ?drug <http://bio2rdf.org/drugbank_vocabulary:x-uniprot> ?protein.
?drug  <http://bio2rdf.org/drugbank_vocabulary:general-function> ?genFunction.
?drug  <http://bio2rdf.org/drugbank_vocabulary:specific-function> ?speFunction.

}
}

Query 2":

SELECT *
WHERE {


service<http://cu.drugbank.bio2rdf.org/sparql>

 {
?drug  <http://bio2rdf.org/drugbank_vocabulary:gene-name> ?geneName.
 ?drug <http://bio2rdf.org/drugbank_vocabulary:x-uniprot> ?protein.
?drug  <http://bio2rdf.org/drugbank_vocabulary:general-function> ?genFunction.
?drug  <http://bio2rdf.org/drugbank_vocabulary:specific-function> ?speFunction.

}
service<http://cu.omim.bio2rdf.org/sparql>{
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/omim_vocabulary:Phenotype> .
?s <http://www.w3.org/2000/01/rdf-schema#label> ?o.
?s <http://bio2rdf.org/omim_vocabulary:clinical-features> ?clinicFeature.
?s <http://bio2rdf.org/omim_vocabulary:article> ?article.
?s <http://bio2rdf.org/omim_vocabulary:x-uniprot> ?protein.
filter(regex(str(?o),"GLUCOCORTICOID-REMEDIABLE ALDOSTERONISM","i"))}
}

Query 3':

SELECT *
WHERE {
service<http://cu.kegg.bio2rdf.org/sparql>
{
 ?enzyme <http://bio2rdf.org/kegg_vocabulary:substrate> ?cpd.
  ?enzyme rdf:type <http://bio2rdf.org/kegg_vocabulary:Enzyme>.
 ?reaction <http://bio2rdf.org/kegg_vocabulary:enzyme>  ?enzyme. 
  ?reaction <http://bio2rdf.org/kegg_vocabulary:reaction> ?equation.
}
service<http://cu.drugbank.bio2rdf.org/sparql>
{
 ?drug <http://bio2rdf.org/drugbank_vocabulary:category> ?cat.
 ?drug <http://purl.org/dc/terms/description> ?desc.
?drug <http://bio2rdf.org/drugbank_vocabulary:x-kegg> ?cpd
  }
  }

Query 3": exchange the order of two service clauses in the query 3'.

Query 4':

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX sider:  <http://bio2rdf.org/sider:>
PREFIX sider_vocab: <http://bio2rdf.org/sider_vocabulary:>
PREFIX sider_resource: <http://bio2rdf.org/sider_resource:>
PREFIX bio2rdf: <http://bio2rdf.org/bio2rdf_vocabulary:>
PREFIX pubchem: <http://bio2rdf.org/pubchem.compound:>
PREFIX dbowl: <http://dbpedia.org/ontology/>

select *
where { service<http://cu.sider.bio2rdf.org/sparql>

{
?drug sider_vocab:generic-name ?generic;
dcterms:title ?drug_name;
sider_vocab:side-effect ?side.
?drug sider_vocab:pubchem-flat-compound-id ?cpd.
?generic dcterms:title ?generic_name.
?side dcterms:title ?side_effect.}

service<http://cu.drugbank.bio2rdf.org/sparql>
{
 ?drug2 <http://bio2rdf.org/drugbank_vocabulary:category> <http://bio2rdf.org/drugbank_vocabulary:Anti-Allergic-Agents>.
 ?drug2 <http://bio2rdf.org/drugbank_vocabulary:x-pubchemcompound> ?cpd.

}

}

Query 4": exchange the order of two service clauses in the query 4'.

Query 5':

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX sider:  <http://bio2rdf.org/sider:>
PREFIX sider_vocab: <http://bio2rdf.org/sider_vocabulary:>
PREFIX sider_resource: <http://bio2rdf.org/sider_resource:>
PREFIX drugbank: <http://bio2rdf.org/drugbank_vocabulary:>
PREFIX pubchem: <http://bio2rdf.org/pubchem.compound:>
PREFIX dbowl: <http://dbpedia.org/ontology/>
PREFIX kegg: <http://bio2rdf.org/kegg_vocabulary:>

select *
where{
service<http://cu.drugbank.bio2rdf.org/sparql>{
 ?drug_drugbank drugbank:category drugbank:Anticonvulsants.
 ?drug_drugbank drugbank:affected-organism ?affected.
 ?drug_drugbank drugbank:x-pubchemcompound ?cpd.}

service<http://cu.kegg.bio2rdf.org/sparql>
 {?drug_kegg kegg:x-pubchem.compound ?cpd.
 ?drug_kegg kegg:pathway  ?pathway.}

service<http://cu.sider.bio2rdf.org/sparql>
{
?drug sider_vocab:side-effect ?side.
?side dcterms:title ?side_effect.
?drug sider_vocab:pubchem-flat-compound-id ?cpd.}
}

Query 5": Change the order of the first two service clauses in the query 5'.