Skip to content

Ashwini607/ChEMBL-RDF-Queries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

144 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository contains a list of queries illustrating how to use the ChEMBL SPARQL enpoint. If you are new to the semantic web, you can follow a tutorial. If you have some knowledge about SQL and relational database already, the transition to SPARQL should be easy, first read the introduction below and you can directly get started!

RDF

RDF stands for Resource Description Framework. Briefly, it is a conceptual way of representing data as a graph, as opposite to relational databases, focusing on relations. Within RDF, the information is encoded as triples, and identifiers are Universal Resource Identifiers (URI or web addresses). Representing data as a graph is interesting because it simplifies the integration of information from different sources. URIs guarantees the uniqueness of resources and allow you to simply explore them with your web browser.

SPARQL

SPARQL is a language used to query RDF data. It is fairly similar to SQL, yet better standardised and more flexible to query multiple data sources or services in the same time. A SPARQL endpoint is a web address you use to access the RDF data and run SPARQL queries. The ChEMBL SPARQL enpoint is located at http://www.ebi.ac.uk/rdf/services/chembl/sparql

What should I consider using the SPARQL endpoint?

Semantic web technologies provide two main advantages. First, they remove the need to maintain, update, download, parse and handle flat files or databases. You can query the ChEMBL data directly from the web, in a fully automated way. RDF helps you to focus entirely on the query, where the real scientific value is.

Secondly, it becomes easier to integrate the data from another provider. For instance, when you analyse ChEMBL data, you may realise that it would be interesting to combine your current results with gene expression or pathway information. SPARQL allows you to do this very easily, as illustrated in the example queries.

How do I run the ChEMBL queries?

You can directly copy and paste the queries from the files in the web form on the SPARQL endpoint. Do not include the commented (starting with the symbol #) in the very first line of a query, the endpoint does not support them yet. You can put the comment from 2nd line onwards.

It is also possible to run the queries from R or with command lines. More examples will come to demonstrate this feature. Finally, you can also check the ChEMBL endpoint documentation or contact us if you are facing problems.

SPARQL queries to execute on ChEMBL SPARQL endpoint

A. Simple queries

  1. Retrieve trade name of ChEMBL molecule having ChEMBL-id "CHEMBL192". file or see it live
  2. Retrieve molecular formula of ChEMBL molecule having ChEMBL-id "CHEMBL192". file or see it live
  3. Retrieve rotational bond of ChEMBL molecule having ChEMBL-id "CHEMBL192". file or see it live
  4. Retrieve ChEMBL molecule using the trade name, here trade name is "sildenafil". file or see it live
  5. Retrieve the ChEMBL molecules having molecular formula is combination of “C22H30N6O4S”. file or see it live
  6. Retrieve ChEMBL molecules having molecular weight between 500 and 900. file or see it live
  7. Retrieve molecular weight and molecular formula of ChEMBL molecules. file or see it live
  8. Retrieve kinds of source molecule present in ChEMBL RDF triple store. file or see it live
  9. Retrieve kinds of standard activity type present in ChEMBL RDF triple store. file or see it live
  10. Retrieve organisms covered in ChEMBL RDF triple store. file or see it live

B. Moderate queries

  1. Retrieve Compounds whose source is PubChem. file or see it live
  • Retrieve journal and published date for ChEMBL molecule, here molecule is "CHEMBL282282". file or see it live
  • Retrieve ChEMBL molecules and their associated assay for all targets having confidence score more than 6. file or see it live
  • Retrieve ChEMBL molecules having activity stndard type "IC50" and standard unit "nM". file or see it live
  • Retrieve target types available in ChEMBL rdf triple store. file or see it live
  • Retrieve substance types having target type "cell-line". file or see it live
  • Retrieve ChEMBL molecules activity details for all target. file or see it live
  • Retrieve ChEMBL molecules activity details for a target, and target is Human PDE5 (CHEMBL1827). file or see it live
  • Retrieve ChEMBL molecules targeting "Bacteria". file or see it live
  • Retrieve ChEMBL molecules targeting “Firefly Luciferase”. file or see it live
  • Retrieve target details, uniprot_reference and sequences for proteins target. file or see it live
  • Retrieve ChEMBL molecules activity details for all targets containing a protein of interest, and protein of interest is human M2 muscarinic receptor (P08172). file or see it live
  • Retrieve approved drug for Mycobacterium tuberculosis target. file or see it live

C. Difficult queries

  1. Retrieve ChEMBL molecules which are selective for Human CDK2 (ChEMBL301) over Human CDK5 (CHEMBL4036). file or see it live But what if will consider the confidence score too. file or see it live

Note: Try to avoid the use of FILTER construct in SPARQL query, because it takes more time in execution. See more about it in a blog post Tuning SPARQL Queries for Performance

ChEMBL federated or others endpoint service related SPARQL queries

Execute on ChEMBL SPARQL endpoint

  1. Retrieve location of Mycobacterium tuberculosis proteins which is targeted by ChEMBL molecules. file or see it live
  2. Retrieve pathway of Mycobacterium tuberculosis proteins which is targeted by ChEMBL molecules. file or see it live
  3. Retrieve respective location of proteins targted by same compound in Mycobacterium tuberculosis and Homo sapiens. file or see it live
  4. Retrieve the proteins and their sequence involved in Alzheimer disease. file or see it live
  5. Retrieve activities of proteins involved in Alzheimer disease. file or see it live
  6. Retrieve active pathway of proteins involved in Alzheimer disease. file or see it live
  7. Retrieve Alzheimer disease proteins involved in another diseases. file or see it live

Execute on UniProt SPARQL endpoint

  1. Retrieve known diseases from uniprot. file or see it live
  2. Retrieve total number of known diseases in uniprot. file or see it live
  3. Retrieve the proteins and their sequence involved in Alzheimer disease. file or see it live
  4. Retrieve molecular function and biological process associated with Alzheimer disease proteins. file or see it live

SPARQL queries for metadata

If you are new for a RDF triple store then you can start with these metadata queries. Because these queries work on any SPARQL endpoint. It will help you to explore the unfamiliar triple store.

  1. Retrieve all available triples from triple store

About

for understanding the ChEMBL RDF triple store and others triple store

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors