sparql-examples

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

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

11

For a given list of HMDB identifiers return the list of corresponding SwissLipids identifiers. Output should include SwissLipids identifier and name plus the HMDB identifier. This query considers only the cross references in the SwissLipids entry – it does not attempt to query other levels to find links between parents or children. Recapitulates one ID mapping function on the website.

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

# Example 11
prefix HMDB:<http://identifiers.org/hmdb/>
SELECT ?hmdb ?slm ?slmName 
WHERE {
  VALUES ?hmdb {HMDB:HMDB00269 HMDB:HMDB00032 HMDB:HMDB01383}
  ?slm rdfs:label ?slmName . 
  # Corresponding SwissLipids entries
  ?slm rdfs:seeAlso ?hmdb .
}
ORDER BY ?hmdb
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?hmdb"):::projected 
  v2("?slm"):::projected 
  v3("?slmName"):::projected 
  bind0[/VALUES ?hmdb/]
  bind0-->v2
  bind00([http://identifiers.org/hmdb/HMDB00269])
  bind00 --> bind0
  bind01([http://identifiers.org/hmdb/HMDB00032])
  bind01 --> bind0
  bind02([http://identifiers.org/hmdb/HMDB01383])
  bind02 --> bind0
  v2 --"rdfs:label"-->  v3
  v2 --"rdfs:seeAlso"-->  v2