-
Notifications
You must be signed in to change notification settings - Fork 3
02 Competency Questions
We have collected a set of competency questions and the resulting SPARQL queries
Current questions:
-
Select all MassBank records which mention a metabolite for which there is a ChEBI compound
-
Select all Metabolights studies which mention a metabolite for which there is a MassBank record
-
Select all compounds from Metabolights, which are mentioned for Brassicacae species
Future questions:
-
Select all compounds from Metabolights, with has_role insecticide (CHEBI:24852) assertion
-
Select all MassBank records for Molecules that interact with Protein/Enzyme X (using e.g. http://stitch.embl.de/ )? Using the Stitch SPARQL endpoint would allow to connect metabolomics with Proteomics.
-
Select all MassBank records of stuff measured in a certain location e.g. Germany, Europe or Switzerland. This will require annotation of the records with the gazetteer (http://bioportal.bioontology.org/ontologies/GAZ/) ontology terms, and a selection of everything that is "located_in" Germany (http://www.ebi.ac.uk/ontology-lookup/browse.do?ontName=GAZ&termId=GAZ:00002646&termName=Germany) or "located_in" Switzerland (http://www.ebi.ac.uk/ontology-lookup/?termId=GAZ%3A00002941). This is very similar to the NCBI taxonomy query for all brassicacae. Swiss queries could cover multiple locations with samples collected from e.g. different cantons.
Example SPARQL queries
The example queries can be executed in the lodestar interface at: http://msbi.ipb-halle.de/lodestar/
regarding to competency questions
Select all MassBank records about ChEBI compounds:
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
#---- All records with respective chebi links
SELECT ?r ?l
WHERE{
?r a mbco:record.
?r mbco:describes ?a.
?a mbco:has_output ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?l.
}
Select all Metabolights studies which mention a metabolite for which there is a MassBank record:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX metabo: <http://msbi.ipb-halle.de/rdf/ontology/metabolights#>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
SELECT DISTINCT ?r ?lab
WHERE{
?r a mbco:record.
?r mbco:describes ?a.
?a mbco:has_output ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?l.
?l metabo:is_described_in ?maf.
?maf metabo:is_metabolite_assignment_file_of ?ma.
?ma metabo:is_assay_of ?st.
?st metabo:is_study_of ?in.
?in rdfs:label ?lab.
}
further examples
Query for synonyms to a compound in a specific record
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
#-- All synonyms to the chemical entity in the
#-- record with accession EA019908
#-- ?l is in output for control reasons
SELECT ?r ?l ?k
WHERE{
?r a mbco:record.
?r mbco:has_accession "EA019908".
?r mbco:describes ?a.
?a mbco:has_output ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?l.
?l purl:Synonym ?k.
}
MassBank record to chembl
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
#-- Find chembl link of compound within record by using the chebi-
#-- connection
#-- Chembl has chebi as skos:exactMatch
#-- (questionable, should be an abstraction of that predicate)
SELECT ?r ?k
WHERE{
?r a mbco:record.
?r mbco:has_accession "EA019908".
?r mbco:describes ?a.
?a mbco:has_output ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?l.
?k skos:exactMatch ?l.
}
Depictions of all molecules of all records (massbank-chembl-chebi)
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
#-- Find depictions of all molecules of all records (ChEMBL)
SELECT ?r ?d
WHERE{
?r a mbco:record.
?r mbco:describes ?a.
?a mbco:has_output ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?l.
?k skos:exactMatch ?l.
?k foaf:depiction ?d
}
Depicts all records that describe the compound with chembl 22 (chembl-chebi-massbank)
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
#-- All records in massbank that have the compound with chembl-Id 22
SELECT ?k ?r
WHERE{
?k a chembl:SmallMolecule.
?k chembl:chemblId "CHEMBL22".
?k skos:exactMatch ?l.
?c a mbco:chemical_entity.
?c mbco:chebi_link ?l.
?c mbco:identified_by ?s.
?s mbco:is_output_of ?a.
?a mbco:is_described_by ?r
}
All herbicides in chebi dataset
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
#-- All chebi compounds that have role herbicide
SELECT DISTINCT ?l ?n
WHERE{
?l rdfs:subClassOf ?m.
?m owl:onProperty purl:has_role.
?m owl:someValuesFrom ?n.
?n <http://www.w3.org/2000/01/rdf-schema#label> ?o.
FILTER(STR(?o) = "herbicide")
}
All chembl molecules who have a record in massbank with a peak with mz from 100 to 101
PREFIX purl: <http://purl.obolibrary.org/obo#>
PREFIX purldata: <http://purl.obolibrary.org/obo/>
PREFIX mbco: <http://msbi.ipb-halle.de/rdf/ontology/mbco#>
PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
#--All chembl molecules who have a record in massbank with a peak with ##mz from 100 to 101
SELECT DISTINCT ?chembl ?h
WHERE{
#--Find peak with corresponding mz
?p a mbco:peak.
?p mbco:encodes_mz ?mz.
FILTER(xsd:decimal(?mz) >= 100).
FILTER(xsd:decimal(?mz) <= 101).
#--Find chembl compound of peak
?p mbco:constituates ?s.
?s mbco:identifies ?c.
?c mbco:chebi_link ?link.
?chembl skos:exactMatch ?link.
?chembl chembl:chemblId ?ID.
#--Find record of peak
?s mbco:is_output_of ?a.
?a mbco:is_described_by ?r.
?r mbco:hyperlink_record ?h
}
ORDER BY asc(?chembl)