SPARQL+cases

Run SPARQL at [|Virtuoso Endpoint] Go to Chem2Bio2RDF SPARQL cases.

For Drug/Chemical
comments: SPARQL: code PREFIX c2b2r:  PREFIX bp:  PREFIX rdfs: 
 * find drug targets

select distinct ?target from  where { ?chemical rdfs:label ?drugName ; c2b2r:hasInteraction ?interaction. ?interaction c2b2r:hasTarget [bp:name ?target]; c2b2r:drugTarget true.

FILTER (str(?drugName)="Troglitazone") } code

result: comments: SPARQL: code PREFIX c2b2r:  PREFIX bp:  PREFIX rdfs:  PREFIX rdf: 
 * find chemical associated genes/proteins along with their interaction types

select distinct ?target ?target_name ?interactionType from  where { ?chemical rdfs:label "Troglitazone"^^xsd:string; c2b2r:hasInteraction ?interaction. ?interaction c2b2r:hasTarget [bp:name ?target_name;rdfs:label ?target] ; rdf:type ?interactionType. ?interactionType rdfs:subClassOf c2b2r:ChemicalGeneInteraction.

} code
 * 1) uncomment next line to specify the interaction (e.g., Binding, Activation, Expression, Reaction, etc.)
 * 2) FILTER (?interactionType=c2b2r:Binding).


 * find target PPARG inhibitors and remove compounds with weight >500d

comments: SPARQL: code PREFIX c2b2r:  PREFIX bp:  PREFIX rdfs:  PREFIX rdf: 

select distinct ?structureData ?weight from  where { ?target rdfs:label "PPARG"^^xsd:string; c2b2r:hasInteraction ?interaction. ?interaction rdf:type c2b2r:Inhibition ; c2b2r:hasCompound ?chemical. ?chemical c2b2r:hasPhysicalProperty [c2b2r:molecularWeight ?weight] ; bp:structure [bp:structureFormat "openeye_can_smiles"^^xsd:string;bp:structureData ?structureData].

FILTER(?weight<500). } code comment: it's assumed the neighbors of chemical are likely to cause the same disease. SPARQL: code PREFIX c2b2r:  PREFIX bp:  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 * find chemicals that are likely to cause disease (toxicity)

select distinct ?chemical from <http://chem2bio2rdf.org/owl#> where { {?chemical c2b2r:causeDisease [bp:name "oral submucous fibrosis"^^xsd:string ]. } union {?chemical1 c2b2r:causeDisease [bp:name "oral submucous fibrosis"^^xsd:string ] ;c2b2r:hasNeighbor ?chemical. } } code comment: SPARQL: code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * which pathways will be affected by the chemical (e.g., Troglitazone) ? give the pathway data sources?

select distinct ?pathwayName ?datasource from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string; c2b2r:hasInteraction ?interaction. ?interaction c2b2r:hasTarget ?target ; c2b2r:biologicalInterest true. ?pathway c2b2r:isPathwayOf ?target ; bp:name ?pathwayName ; bp:xref [c2b2r:identifierType ?datasource]. } code code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * What assays test the activity of troglitazone against PPARG ? preferably give the literature.

select ?bioAssayDescription ?measurement ?relation ?value ?unit ?title from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string; c2b2r:hasInteraction ?interaction. ?interaction c2b2r:hasBioAssay ?bioAssay. ?bioAssay c2b2r:description ?bioAssayDescription ; c2b2r:hasOutcome [c2b2r:measurement ?measurement; c2b2r:relation ?relation; c2b2r:value ?value; c2b2r:unit ?unit ].

optional {?bioAssay c2b2r:hasReference [c2b2r:title ?title]} } code code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what's the neighbor of troglitazone? (structural similar)

select * from <http://chem2bio2rdf.org/owl_lite#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string ; c2b2r:hasNeighbor [rdfs:label ?compound] } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what are the side effects of troglitazone?

select * from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string ; c2b2r:causeSideEffect [bp:name ?side_effect]. } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what are the diseases treated by troglitazone?

select * from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string ; c2b2r:treatDisease [bp:name ?disease]. } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what drugs are able to interact with troglitazone? what are their effects?

select * from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label "Troglitazone"^^xsd:string ; c2b2r:hasDrugDrugInteraction [c2b2r:hasPart [bp:name ?name]; c2b2r:description ?description]. FILTER (str(?name)!="Troglitazone"). } code comment: This sparql will give all the info related to trogalitazone, you have to modify it to get your desired information. code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 * what can we learn from troglitazone?

select * from <http://chem2bio2rdf.org/owl#> where { ?chemical rdfs:label ?drugName. ?chemical ?p ?s. #include all predicates optional {?chemical bp:structure [bp:structureFormat ?structureFormat; bp:structureData ?structureData]}. optional {?chemical c2b2r:hasPhysicalProperty [?propertyName ?property] }.

FILTER (str(?drugName)="Troglitazone") } code

For Protein/Gene/Target
code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what proteins are able to interact with protein PPARG //in vivo//?

select ?protein from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:hasProteinProteinInteraction [c2b2r:hasPart [rdfs:label ?protein]; c2b2r:experimentType "in vivo"^^xsd:string]. FILTER (str(?protein)!="PPARG") } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what diseases are caused by PPARG ?

select ?disease from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:causeDisease [bp:name ?disease] } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * what pathways include PPARG? from what database?

select * from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:hasPathway [bp:name ?pathway; bp:xref [c2b2r:identifierType ?database]] } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * What are the go terms for PPARG?

select ?GO from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:gOID ?GO } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * Where are PPARG expressed?

select ?tissue from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:tissue ?tissue } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * What's the gene family of PPARG?

select ?geneFamily from <http://chem2bio2rdf.org/owl#> where { ?target rdfs:label "PPARG"^^xsd:string ; c2b2r:geneFamily ?geneFamily } code

For Disease/SideEffect
code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * What drugs are used to treat diabetes but withdrawn from market?

select distinct ?drug from <http://chem2bio2rdf.org/owl#> where { ?disease bp:name ?disease_name ; c2b2r:treatedBy [c2b2r:group "withdrawn"^^xsd:string; bp:name ?drug]. FILTER regex(?disease_name,"diabetes","i"). } code

code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * What diseases are heart disease?

select ?name from <http://chem2bio2rdf.org/owl#> where { ?childDisease bp:name ?name. ?childDisease c2b2r:iSA ?disease. ?disease bp:name "heart disease"^^xsd:string. } code comments: First, search for drugs causing side effect (e.g., heart failure), then retrieve targets associated with these drugs. The targets shared by higher number of drugs are likely the side effect related targets. code PREFIX c2b2r: <http://chem2bio2rdf.org/chem2bio2rdf.owl#> PREFIX bp: <http://www.biopax.org/release/biopax-level3.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 * Side effect related targets

select ?target (count(?target) as ?count) from <http://chem2bio2rdf.org/owl#> where { ?sideEffect bp:name "heart failure"^^xsd:string ; c2b2r:causedByDrug ?drug. ?drug c2b2r:hasInteraction ?interaction. ?interaction   c2b2r:biologicalInterest true ; c2b2r:hasTarget [rdfs:label ?target] ; rdf:type [rdfs:subClassOf c2b2r:ChemicalGeneInteraction ]. } group by ?target order by desc(?count)

code

For more complex queries

 * find disease associated chemicals
 * what can we lean about target: NR1I2 from Chem2Bio2RDF
 * Give the literatures talking about pathway (eg.Calcium signaling pathway) and side effect (eg: cancer)
 * Linking KEGG / Reactome Pathways and PubChem to identify potential multiple pathway inhibitors for MAPK
 * find KEGG pathways containing at least two of the targets associated with a given side effect (i.e. hepatomegaly)
 * Find gene expression tissue.
 * Find gene associated disease
 * how we synchronize the two or many different experiment results containing quantitative values in a same target.
 * find all the common/unique genes or protein or drugs between/among two or many nodes.
 * find structural commonalities between diabetes related drugs