The LIPID MAPS® SPARQL Endpoint, enables federated queries over LIPID MAPS and our partners.
Documentation on how to use SPARQL can be found here.
We gratefully acknowledge members of the ELIXIR 2021 Hackathon “FAIR lipids” for collaborative working on this project, with specific mention of Maksim Kolchin, Jerven Bolleman (SIB), Denise Slenter (WikiPathways) and Egon Willighagen (WikiPathways).
from SPARQLWrapper import SPARQLWrapper, JSON import pandas as pd sparql = SPARQLWrapper( "https://lipidmaps.org/sparql" ) sparql.setReturnFormat(JSON) # For example, retrieve the name, category and formula of the first 5 lipids via a SPARQL endpoint sparql.setQuery(""" PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX chebi: <http://purl.obolibrary.org/obo/chebi/> SELECT ?name ?category ?formula WHERE { SERVICE <https://lipidmaps.org/sparql> { ?lipidmaps rdfs:label ?name . ?lipidmaps rdfs:subClassOf ?category . ?lipidmaps chebi:formula ?formula . } } LIMIT 5 """ ) try: res = sparql.queryAndConvert() for i in res["results"]["bindings"]: print(i) except Exception as e: print(e)
It is possible to query the LIPID MAPS database with the following specifying objects:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX chebi: <http://purl.obolibrary.org/obo/chebi/> SELECT ?name ?category ?formula WHERE { SERVICE <https://lipidmaps.org/sparql> { ?lipidmaps rdfs:label ?name . ?lipidmaps rdfs:subClassOf ?category . ?lipidmaps chebi:formula ?formula . } FILTER(?formula="C18H36O") }
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX chebi: <http://purl.obolibrary.org/obo/chebi/> SELECT ?name ?category ?formula ?externalMolecule WHERE { SERVICE <https://lipidmaps.org/sparql> { ?lipidmaps rdfs:label ?name ; rdfs:subClassOf ?category ; chebi:formula ?formula ; owl:equivalentClass ?externalMolecule . } SERVICE <https://beta.sparql.swisslipids.org/sparql> { ?externalMolecule chebi:smiles ?smileCode ; rdfs:seeAlso ?seeAlso . } FILTER(?formula="C18H36O") }
LIPID MAPS uses cookies to keep the site working, to remember your choices, and — only if you allow it — to understand how the site is used so we can improve it. Choose what you are happy with below. You can change your mind at any time from Manage Cookies in the footer.
A free account takes a minute and lets you:
Citing LIPID MAPS in your publications shows the impact of the resource and helps keep it free for everyone. The citation page lists the papers to cite for each database and tool.