Since the server is moved, the cases below do not work, Please GO to sparlql examples in cheminfov virtuoso to run cheminfov!!!

To run the SPARQL, go to http://chem2bio2rdf.org/rdf/snorql/. It will take for a while since the data involved is very big.
Case 1. find all the drug-like compounds in PubChem BioAssay that share at least two targets with a drug in DrugBank
SELECT ?compound_cid (count(?compound_cid) as ?active_assays) WHERE {
 ?compound pubchem_bioassay:CID ?compound_cid .
?compound pubchem_bioassay:SMILES ?compound_smiles .  FILTER (ruleofFive(? compound_smiles)>0).
 ?compound pubchem_bioassay:outcome ?activity . FILTER (?activity=2) .
 ?compound pubchem_bioassay:Score ?score . FILTER (?score>50) .
 ?compound pubchem_bioassay:gi ?gi .
 
 ?uniprot uniprot:gi ?gi .
 ?uniprot uniprot:geneSymbol ?gene .
 
 ?drugbank_interaction drugbank_interaction:geneSymbol ?gene .
 ?drugbank_interaction drugbank_interaction:DBID ?drug .
 ?drug drugbank_drug:Generic_Name ?drug_name .
 FILTER (?drug_name="Dexamethasone") .
 
 } GROUP BY ?compound_cid  HAVING (count(*)>1)

For this case, since the D2R SPARQL endpoint does not support the extension function, you have to delete the sentence
?compound pubchem_bioassay:SMILES ?compound_smiles . FILTER (ruleofFive(? compound_smiles)>0).
while run the query. Please contact us for the codes if you need to run this query under Jena package.
Case 2. Linking KEGG / Reactome Pathways and PubChem to identify potential multiple pathway inhibitors for MAPK
[rule1: ?compound pubchem_bioassay:gi  ?gi .
        ?gi2uniprot gi2uniprot:gi  ?gi .
        ?gi2uniprot gi2uniprot:uniprot ?uniprot .
 
    ?kegg_pathway kegg_pathway_protein:Uniprot ?uniprot .
    ?kegg_pathway kegg_pathway_protein:PathwayID ?pathway .
 
    ?pathway kegg_pathway:pathwayname ?pathway_name .
 
->(?compound http://chem2bio2rdf.org/rdf/resource/CompoundPathway ?pathway_name)]
 
SELECT ?compound_cid (count(?compound_cid) as ?active_assay)
WHERE {
?compound pubchem_bioassay:CID ?compound_cid .
?compound pubchem_bioassay:outcome ?activity . FILTER (?activity=2) .
 
?compound vocab:CompoundPathway ?pathway_name .
 
FILTER regex(?pathway_name,"MAPK signaling pathway","i") .
} GROUP BY ?compound_cid HAVING (count(*)>1)
 
You have to use Jena package to run this query above. or run the alternative on in the sparql endpoint.
 SELECT ?compound_cid (count(?compound_cid) as ?active_assay) WHERE {
 ?compound pubchem_bioassay:CID ?compound_cid .
 ?compound pubchem_bioassay:outcome ?activity . FILTER (?activity=2) .
 ?compound pubchem_bioassay:Score ?score . FILTER (?score>50) .
 ?compound pubchem_bioassay:gi ?gi .
 
 ?uniprot uniprot:gi ?gi .
 
 ?kegg_pathway kegg_pathway_protein:Uniprot ?uniprot .
 ?kegg_pathway kegg_pathway_protein:PathwayID ?pathway .
 
 ?pathway kegg_pathway:pathwayname ?pathway_name .
 
 FILTER regex(?pathway_name,"MAPK signaling pathway","i") .
 } GROUP BY ?compound_cid HAVING (count(*)>1)


Case 3. find KEGG pathways containing at least two of the targets associated with a given side effect (i.e. hepatomegaly)

SELECT ?pathway_id (count(?pathway_id) as ?count) WHERE {
 ?sider2compound sider:side_effect ?side_effect .  FILTER regex(?side_effect,"hepatomegaly","i") .
 ?sider2compound sider:cid ?compound .
 
 ?drug drugbank_drug:CID ?compound .
 ?drug2target drugbank_interaction:DBID ?drug .
 ?drug2target drugbank_interaction:SwissProt_ID ?uniprot .
 
 ?kegg_pathway kegg_pathway_protein:Uniprot ?uniprot .
 ?kegg_pathway kegg_pathway_protein:PathwayID ?pathway_id .
 
 } GROUP BY ?pathway_id ORDER BY ?count