sparql-examples

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

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

7

For a given list of lipid Species, return a list of the corresponding Isomeric subspecies for that particular lipid that are linked to an enzyme as annotated in UniProtKB (UniProt AC and recommended name). This question would allow a user with (a list of) very high level MS identifications to immediately narrow them to the most likely potential lipid structures and protein targets as in this example: SWISSLIPID:000056871 / PC(O-36:4) (target species of interest) -> SWISSLIPID:000028143 / PC(O-16:0/20:4(5Z,8Z,11Z,14Z)) -> LPCAT4, PLA2G4A, PLA2G4C, PLA2G4F (target proteins)

Use at

PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX up: <http://purl.uniprot.org/core/>

# Example 7
SELECT ?startId ?startLabel ?id ?name 
WHERE {
  # Queried lipid species
  VALUES ?startId { SWISSLIPID:000056871 }
  ?startId rdfs:label ?startLabel . 
  # Corresponding Isomeric subspecies
  ?id rdfs:subClassOf+ ?startId .  
  ?id SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecie ;
	  rdfs:label ?name .
  # Mapped ChEBI
  ?id owl:equivalentClass ?chebi .  
  # federated query to Rhea
  SERVICE <https://sparql.rhea-db.org/sparql> {
  	?rhea rh:equation ?rheaEquation .
  	?rhea rh:side/rh:contains/rh:compound/rh:chebi ?chebi .
  }    
  # federated query to UniProt
  SERVICE <https://sparql.uniprot.org/sparql> {
    ?uniprot up:reviewed true .
    ?uniprot up:recommendedName/up:fullName ?uniprotName .
    ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?chebi")
  v3("?id"):::projected 
  v4("?name"):::projected 
  v6("?rhea")
  v7("?rheaEquation")
  v1("?startId"):::projected 
  v2("?startLabel"):::projected 
  v8("?uniprot")
  v9("?uniprotName")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  a6((" "))
  c14(["true^^xsd:boolean"]):::literal 
  c4(["SWISSLIPID:Isomeric_Subspecie"]):::iri 
  bind0[/VALUES ?startId/]
  bind0-->v1
  bind00(["SWISSLIPID:000056871"])
  bind00 --> bind0
  v1 --"rdfs:label"-->  v2
  v3 --"rdfs:subClassOf"-->  v1
  v3 --"SWISSLIPID:rank"-->  c4
  v3 --"rdfs:label"-->  v4
  v3 --"owl:equivalentClass"-->  v5
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v6 --"rh:equation"-->  v7
    v6 --"rh:side"-->  a1
    a1 --"rh:contains"-->  a2
    a2 --"rh:compound"-->  a3
    a3 --"rh:chebi"-->  v5
  end
  subgraph s2["https://sparql.uniprot.org/sparql"]
    style s2 stroke-width:4px;
    v8 --"up:reviewed"-->  c14
    v8 --"up:recommendedName"-->  a4
    a4 --"up:fullName"-->  v9
    v8 --"up:annotation"-->  a5
    a5 --"up:catalyticActivity"-->  a6
    a6 --"up:catalyzedReaction"-->  v6
  end