sparql-examples

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

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

10

Retrieve mapping between SwissLipids lipid identifiers and their corresponding HMDB identifiers. Output should include SwissLipids identifier and name plus the HMDB identifier.

Use at

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

# Example 10
SELECT ?slm ?slmName ?hmdb
WHERE {
  ?slm rdfs:label ?slmName . 
  # Corresponding HMDB entries
  ?slm rdfs:seeAlso ?hmdb .
  FILTER regex(str(?hmdb), "hmdb") .
}
ORDER BY ?slm
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?hmdb"):::projected 
  v1("?slm"):::projected 
  v3("?slmName"):::projected 
  f0[["regex(str(?hmdb),'hmdb')"]]
  f0 --> v2
  v1 --"rdfs:label"-->  v3
  v1 --"rdfs:seeAlso"-->  v2