sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

14

For a given list of LIPID MAPS identifiers return the list of corresponding ChEBI IDs. Output should include LIPID MAPS ID, the corresponding SwissLipids ID and name, plus the ChEBI ID. This query first identifies SwissLipids identifiers for a given list of HMDB identifiers. It then retrieves all children and from them the required LIPID MAPS identifiers. extends ex:9

Use at

PREFIX lipidmaps: <https://www.lipidmaps.org/rdf/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

# Example 14
SELECT ?lipidmaps ?slm ?slmName ?chebi
WHERE {
  #VALUES ?lipidmaps {lipidmaps:LMSP01020001 lipidmaps:LMST01010069 lipidmaps:LMST04030222}
  ?slm rdfs:label ?slmName . 
  # Corresponding SwissLipids entries
  ?slm rdfs:seeAlso ?lipidmaps .
  FILTER regex(str(?lipidmaps), "lipidmaps") .

  # Hierarchical search
  #?children rdfs:subClassOf* ?slm .
  #?children rdfs:label ?name .
  # Corresponding ChEBI entries
  ?slm owl:equivalentClass ?chebi .
}
ORDER BY ?lipidmaps ?slm ?chebi
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?chebi"):::projected 
  v1("?lipidmaps"):::projected 
  v2("?slm"):::projected 
  v4("?slmName"):::projected 
  f0[["regex(str(?lipidmaps),'lipidmaps')"]]
  f0 --> v1
  v2 --"rdfs:label"-->  v4
  v2 --"rdfs:seeAlso"-->  v1
  v2 --"owl:equivalentClass"-->  v3