SPARQL endpoint
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" ].
}
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''' ].
}
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:closeMatch ?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:closeMatch ?prodrug;
rdfs:label ?name
}
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:closeMatch ?FDA_drug;
rdfs:label ?drug_name;
sio:SIO_000008 [ rdf:type sio:CHEMINF_000018;
sio:SIO_000300 ?SMILES] .
VALUES ?prodrug {substance:MM495919.1 substance:MM478575.1
substance:MM17534}
?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:closeMatch ?FDA_drug;
rdfs:label ?drug_name;
sio:SIO_000008 [ rdf:type sio:CHEMINF_000018;
sio:SIO_000300 ?SMILES] .
VALUES ?prodrug {substance:MM495919.1 substance:MM478575.1
substance:MM17534}
?prodrug sachem:substructureSearch [
sachem:query ?SMILES].
?prodrug rdfs:label ?prodrug_name
FILTER (?drug != ?prodrug)
}
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.
PREFIX sio: <http://semanticscience.org/resource/>
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 ?substance ?drug_name WHERE {
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
{
?drug cco:highestDevelopmentPhase "3.0"^^xsd:float
}
?substance skos:closeMatch ?drug ;
rdfs:label ?drug_name .
?assay bao:BAO_0090012 ?substance ;
bao:BAO_0090012 [skos:exactMatch uniprot:Q9UNQ0];
bao:BAO_0000208 ?ep .
?sbep sio:SIO_000300 repr:PositiveResult ;
bao:BAO_0095000 ?ep
}
PREFIX sio: <http://semanticscience.org/resource/>
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 ?substance ?drug_name WHERE {
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>
{
?drug cco:highestDevelopmentPhase "3.0"^^xsd:float
}
?substance skos:closeMatch ?drug ;
rdfs:label ?drug_name .
?assay bao:BAO_0090012 ?substance ;
bao:BAO_0090012 [skos:exactMatch uniprot:Q9UNQ0];
bao:BAO_0000208 ?ep .
?sbep sio:SIO_000300 repr:PositiveResult ;
bao:BAO_0095000 ?ep
}
Example query 6
Query asking for pIC50 values of Verapamil drug on all human transporters inhibited by it.
PREFIX sio: <http://semanticscience.org/resource/>
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 ?UPid ?pIC50 WHERE {
?transporter rdf:type bao:BAO_0000283 ;
skos:exactMatch ?UPtransporter ;
sio:SIO_000008 [sio:SIO_000300 ?UPid] .
?assay bao:BAO_0090012 ?transporter ;
bao:BAO_0090012 <https://identifiers.org/molmedb/MM00585> ;
bao:BAO_0000208 [ rdf:type bao:BAO_0000199 ;
sio:SIO_000300 ?pIC50;
^bao:BAO_0095000 [sio:SIO_000300 repr:PositiveResult]]
SERVICE <https://sparql.uniprot.org/sparql>
{
?UPtransporter up:organism taxon:9606
}
}
PREFIX sio: <http://semanticscience.org/resource/>
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 ?UPid ?pIC50 WHERE {
?transporter rdf:type bao:BAO_0000283 ;
skos:exactMatch ?UPtransporter ;
sio:SIO_000008 [sio:SIO_000300 ?UPid] .
?assay bao:BAO_0090012 ?transporter ;
bao:BAO_0090012 <https://identifiers.org/molmedb/MM00585> ;
bao:BAO_0000208 [ rdf:type bao:BAO_0000199 ;
sio:SIO_000300 ?pIC50;
^bao:BAO_0095000 [sio:SIO_000300 repr:PositiveResult]]
SERVICE <https://sparql.uniprot.org/sparql>
{
?UPtransporter up:organism taxon:9606
}
}
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
}
}
Example query 8
Query for permeability or partition assays obtained by methods of different types.
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
SELECT DISTINCT * WHERE {
?assay bao:BAO_0000208 ?endpoint ;
bao:BAO_0000212 ?method .
#method type
#bao:BAO_0002202 - assay design method (experimental)
#bao:BAO_0002094 - computational method
#bao:BAO_0002301 - simulation method
?method a bao:BAO_0002202 .
#endpoint type
#mmdbvoc:LogPerm
#mmdbvoc:LogK
?endpoint a mmdbvoc:LogK
}
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX sachem: <http://bioinfo.uochb.cas.cz/rdf/v1.0/sachem#>
SELECT DISTINCT * WHERE {
?assay bao:BAO_0000208 ?endpoint ;
bao:BAO_0000212 ?method .
#method type
#bao:BAO_0002202 - assay design method (experimental)
#bao:BAO_0002094 - computational method
#bao:BAO_0002301 - simulation method
?method a bao:BAO_0002202 .
#endpoint type
#mmdbvoc:LogPerm
#mmdbvoc:LogK
?endpoint a mmdbvoc:LogK
}
Example query 9
Federated query for permeabilities of drugs acting as human ABC transporters inhibitors. Transproters belonging to ABC transporte group are identified in UniProt and compounds acting as drugs from ChEBI. The rest of data is obtained from MolMeDB.
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX ebi: <http://rdf.ebi.ac.uk/dataset/>
PREFIX GO: <http://purl.obolibrary.org/obo/GO_>
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
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#>
PREFIX repr: <https://w3id.org/reproduceme#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT DISTINCT ?prot ?ChEBI_mol ?membrane ?LogPerm WHERE {
# Human ABC transporters
SERVICE <https://sparql.uniprot.org/sparql> {
?prot up:classifiedWith GO:0140359 ;
up:organism/up:scientificName "Homo sapiens" }
# inhibitors of human ABC transporters with ChEBI match
?assay bao:BAO_0090012 [ a bao:BAO_0000283 ;
skos:exactMatch ?prot ] ;
bao:BAO_0090012 ?mol ;
bao:BAO_0000208/^bao:BAO_0095000 [a mmdbvoc:InhibitionAssay ;
sio:SIO_000300 repr:PositiveResult ] .
?mol a bao:BAO_0000076 ;
rdfs:label ?name ;
skos:closeMatch ?ChEBI_mol .
# ChEBI molecules classified as drugs
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm> { GRAPH ebi:chebi {
?ChEBI_mol rdfs:subClassOf
[ owl:someValuesFrom/rdfs:subClassOf* obo:CHEBI_23888 ;
rdf:type owl:Restriction ;
owl:onProperty obo:RO_0000087 ] ; }}
?perm_assay bao:BAO_0090012 ?mol ;
bao:BAO_0090012 [a mmdbvoc:MembraneModel ;
rdfs:label ?membrane ];
bao:BAO_0000208 [ a mmdbvoc:LogPerm ;
sio:SIO_000300 ?LogPerm ] .
}
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX ebi: <http://rdf.ebi.ac.uk/dataset/>
PREFIX GO: <http://purl.obolibrary.org/obo/GO_>
PREFIX mmdbvoc: <https://rdf.molmedb.upol.cz/vocabulary#>
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#>
PREFIX repr: <https://w3id.org/reproduceme#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT DISTINCT ?prot ?ChEBI_mol ?membrane ?LogPerm WHERE {
# Human ABC transporters
SERVICE <https://sparql.uniprot.org/sparql> {
?prot up:classifiedWith GO:0140359 ;
up:organism/up:scientificName "Homo sapiens" }
# inhibitors of human ABC transporters with ChEBI match
?assay bao:BAO_0090012 [ a bao:BAO_0000283 ;
skos:exactMatch ?prot ] ;
bao:BAO_0090012 ?mol ;
bao:BAO_0000208/^bao:BAO_0095000 [a mmdbvoc:InhibitionAssay ;
sio:SIO_000300 repr:PositiveResult ] .
?mol a bao:BAO_0000076 ;
rdfs:label ?name ;
skos:closeMatch ?ChEBI_mol .
# ChEBI molecules classified as drugs
SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm> { GRAPH ebi:chebi {
?ChEBI_mol rdfs:subClassOf
[ owl:someValuesFrom/rdfs:subClassOf* obo:CHEBI_23888 ;
rdf:type owl:Restriction ;
owl:onProperty obo:RO_0000087 ] ; }}
?perm_assay bao:BAO_0090012 ?mol ;
bao:BAO_0090012 [a mmdbvoc:MembraneModel ;
rdfs:label ?membrane ];
bao:BAO_0000208 [ a mmdbvoc:LogPerm ;
sio:SIO_000300 ?LogPerm ] .
}