SPARQL endpoint

WARNING - new RDF schema has been deployed and documentation is being updated at the monet.

The MolMeDB RDF SPARQL endpoint is provided by the IDSM database and is accessible via URL https://idsm.elixir-czech.cz/sparql/endpoint/molmedb. Endpoint serves mainly for automated querying by programs; however, it can also be used manually. Examples of queries are listed below.

Example query 1

Structural query to identify all substances in MolMeDB that have Aspirin as their substructure using SMILES.

PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>

SELECT * WHERE {
?COMPOUND sachem:substructureSearch [
    sachem:query "CC(=O)Oc1ccccc1C(O)=O" ].
}
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>

SELECT
* WHERE {
?COMPOUND
sachem:substructureSearch [
sachem:query "CC(=O)Oc1ccccc1C(O)=O" ].
}

Try it here!

Example query 2

Structural query to identify all alpha amino acids in MolMeDB using MOL file.

PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>

SELECT DISTINCT * WHERE {
  ?COMPOUND sachem:substructureSearch [
      sachem:query '''
alpha amino acid

  8  7  0  0  0  0  0  0  0  0999 V2000
  233.0000  202.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  260.7128  218.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  205.2872  218.0000    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
  288.4256  202.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  260.7128  250.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  288.4256  266.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  205.2872  250.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  177.5744  202.0000    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  1  3  1  0  0  0  0
  2  4  2  0  0  0  0
  2  5  1  0  0  0  0
  5  6  1  0  0  0  0
  3  7  1  0  0  0  0
  3  8  1  0  0  0  0
M  END''' ].
}
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>

SELECT
DISTINCT * WHERE {
?COMPOUND sachem:substructureSearch [
sachem:query '''
alpha amino acid

8 7 0 0 0 0 0 0 0 0999 V2000
233.0000 202.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
260.7128 218.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
205.2872 218.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
288.4256 202.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
260.7128 250.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
288.4256 266.0000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
205.2872 250.0000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
177.5744 202.0000 0.0000 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 3 1 0 0 0 0
2 4 2 0 0 0 0
2 5 1 0 0 0 0
5 6 1 0 0 0 0
3 7 1 0 0 0 0
3 8 1 0 0 0 0
M END'''
].
}

Try it here!

Example query 3

Query to identify molecules from MolMeDB dataset that are also prodrugs according to ChEBI.

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT * WHERE

  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
  {
  ?prodrug rdfs:subClassOf [ rdf:type owl:Restriction;
      owl:onProperty obo:RO_0000087;
      owl:someValuesFrom obo:CHEBI_50266 ] . 
  }
  ?substance skos:exactMatch ?prodrug;
             rdfs:label ?name
}
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX
obo: <http://purl.obolibrary.org/obo/>
PREFIX
owl: <http://www.w3.org/2002/07/owl#>
PREFIX
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX
rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT
* WHERE
{

SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
{
?prodrug rdfs:subClassOf [ rdf:type owl:Restriction;
owl:onProperty obo:RO_0000087;
owl:someValuesFrom obo:CHEBI_50266 ] .
}
?substance skos:exactMatch ?prodrug;
rdfs:label ?name
}

Try it here!

Example query 4

Query to identify molecules from MolMeDB that are substructures of certain prodrugs and are also classified as drugs according to FDA using PubChem RDF data.

Warning

This query can take longer (around 30 seconds) to resolve.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX vocab: <http://rdf.ncbi.nlm.nih.gov/pubchem/vocabulary#>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX substance: <https://identifiers.org/molmedb/>

SELECT ?FDA_drug ?drug ?drug_name ?prodrug_name WHERE {
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm> 
  {
    ?FDA_drug obo:has-role vocab:FDAApprovedDrugs
  }
  ?drug skos:exactMatch ?FDA_drug ;
        rdfs:label ?drug_name ;
        sio:SIO_000008 [ rdf:type sio:CHEMINF_000018 ;
                         sio:SIO_000300 ?SMILES] .
  VALUES ?prodrug {substance:MM00470 substance:MM00629 
                   substance:MM01437}
  ?prodrug sachem:substructureSearch [
    sachem:query ?SMILES].
  ?prodrug rdfs:label ?prodrug_name
  FILTER (?drug != ?prodrug)
}
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX
sio: <http://semanticscience.org/resource/>
PREFIX
skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX
obo: <http://purl.obolibrary.org/obo/>
PREFIX
vocab: <http://rdf.ncbi.nlm.nih.gov/pubchem/vocabulary#>
PREFIX
sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
PREFIX
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX
substance: <https://identifiers.org/molmedb/>

SELECT
?FDA_drug ?drug ?drug_name ?prodrug_name WHERE {
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
{
?FDA_drug obo:has-role vocab:FDAApprovedDrugs
}
?drug skos:exactMatch ?FDA_drug ;
rdfs:label ?drug_name ;
sio:SIO_000008 [ rdf:type sio:CHEMINF_000018 ;
sio:SIO_000300 ?SMILES] .
VALUES ?prodrug {substance:MM00470 substance:MM00629
substance:MM01437}
?prodrug sachem:substructureSearch [
sachem:query ?SMILES].
?prodrug rdfs:label ?prodrug_name
FILTER (?drug != ?prodrug)
}

Try it here!

Example query 5

Query to identify Q9UNQ0 transporter inhibitors in MolMeDB dataset that are in the phase 3 of clinical testing according to ChEMBL RDF.

Warning

This query can take longer (around 3 minutes) to resolve.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX repr: <https://w3id.org/reproduceme#>
PREFIX uniprot: <http://purl.uniprot.org/uniprot/>

SELECT DISTINCT ?drug ?drug_name WHERE {
  SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
  {
    ?drug cco:highestDevelopmentPhase "3"^^xsd:int
  }
  ?substance skos:exactMatch ?drug ;
             rdfs:label ?drug_name .
  ?assay bao:BAO_0090012 ?substance ;
    bao:BAO_0090012 uniprot:Q9UNQ0 ;
    bao:BAO_0000208 [ rdf:type mmdbvoc:SubstrateBindingAssay ;
                      bao:BAO_0095007 repr:PositiveResult ].
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX
xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX
cco: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX
bao: <http://www.bioassayontology.org/bao#>
PREFIX
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX
skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX
mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX
repr: <https://w3id.org/reproduceme#>
PREFIX
uniprot: <http://purl.uniprot.org/uniprot/>

SELECT
DISTINCT ?drug ?drug_name WHERE {
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
{
?drug cco:highestDevelopmentPhase "3"^^xsd:int
}
?substance skos:exactMatch ?drug ;
rdfs:label ?drug_name .
?assay bao:BAO_0090012 ?substance ;
bao:BAO_0090012 uniprot:Q9UNQ0 ;
bao:BAO_0000208 [ rdf:type mmdbvoc:SubstrateBindingAssay ;
bao:BAO_0095007 repr:PositiveResult ].

Try it here!

Example query 6

Query asking for pIC50 values of Verapamil drug on all human transporters inhibited by it.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX repr: <https://w3id.org/reproduceme#>

SELECT ?transporter ?pIC50 WHERE {
  ?transporter rdf:type bao:BAO_0000283 .
  SERVICE <https://sparql.uniprot.org/sparql>
  {
    ?transporter up:organism taxon:9606
  }
  ?assay bao:BAO_0090012 ?transporter ;
    bao:BAO_0090012 <https://identifiers.org/molmedb/MM00585> ;
    bao:BAO_0000208 [ rdf:type mmdbvoc:InhibitionAssay ;
                      bao:BAO_0095007 repr:PositiveResult ] ;
    bao:BAO_0000208 [ rdf:type bao:BAO_0000199 ;
                      bao:BAO_0002666 ?pIC50 ]
}
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX
skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX
bao: <http://www.bioassayontology.org/bao#>
PREFIX
up: <http://purl.uniprot.org/core/>
PREFIX
taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX
mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX
repr: <https://w3id.org/reproduceme#>

SELECT
?transporter ?pIC50 WHERE {
?transporter rdf:type bao:BAO_0000283 .
SERVICE <https://sparql.uniprot.org/sparql>
{
?transporter up:organism taxon:9606
}
?assay bao:BAO_0090012 ?transporter ;
bao:BAO_0090012 <https://identifiers.org/molmedb/MM00585> ;
bao:BAO_0000208 [ rdf:type mmdbvoc:InhibitionAssay ;
bao:BAO_0095007 repr:PositiveResult ] ;
bao:BAO_0000208 [ rdf:type bao:BAO_0000199 ;
bao:BAO_0002666 ?pIC50 ]
}

Try it here!

Example query 7

Query to identify records of lipids in LIPID MAPS database that are components in membrane models in MolMeDB.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?membrane_name ?component ?lipid_name WHERE {
  ?membrane bao:BAO_0090004 ?component ;
            rdfs:label ?membrane_name
  SERVICE <https://www.lipidmaps.org/sparql> 
  {
    ?lipid owl:equivalentClass ?component ;
           rdfs:label ?lipid_name
  }
}
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX
bao: <http://www.bioassayontology.org/bao#>
PREFIX
rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX
owl: <http://www.w3.org/2002/07/owl#>

SELECT
?membrane_name ?component ?lipid_name WHERE {
?membrane bao:BAO_0090004 ?component ;
rdfs:label ?membrane_name
SERVICE <https://www.lipidmaps.org/sparql>
{
?lipid owl:equivalentClass ?component ;
rdfs:label ?lipid_name
}
}

Try it here!