sparql-examples

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

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

113_UniProtKB_Swiss-Prot_entries_annotated_with_CC-CA_Rhea_involving_lipids.ttl

rq turtle/ttl

UniProtKB/Swiss-Prot entries annotated with CC-CA/Rhea involving lipids

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# select all pairs (sprot,rhea) where rhea involves a lipid
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX CHEBI:<http://purl.obolibrary.org/obo/CHEBI_>
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX uniprotkb:<http://purl.uniprot.org/uniprot/>

SELECT 
  (COUNT(*) as ?cnt) 
WHERE 
{
  {
    SELECT ?protein ?rhea 
    WHERE {
      SERVICE <https://sparql.rhea-db.org/sparql> {
        SELECT 
          distinct 
           ?rhea 
        WHERE {
          ?rhea rdfs:subClassOf rh:Reaction .
          ?rhea rh:status rh:Approved .
          ?rhea rh:side ?reactionSide .
          ?reactionSide rh:contains ?participant .
          ?participant rh:compound ?compound .
          ?compound rh:chebi ?chebi .
          ?chebi rdfs:subClassOf+ CHEBI:18059 .
        }
      }
    }
  }
  ?protein a up:Protein .
  ?protein up:reviewed true .
  ?protein up:annotation ?a .
  ?a a up:Catalytic_Activity_Annotation .
  ?a up:catalyticActivity ?ca .
  ?ca up:catalyzedReaction ?rhea .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?a")
  v8("?ca")
  v5("?chebi")
  v9("?cnt")
  v4("?compound")
  v3("?participant")
  v6("?protein")
  v2("?reactionSide")
  v1("?rhea")
  c5(["rh:Approved"]):::iri 
  c14(["true^^xsd:boolean"]):::literal 
  c3(["rh:Reaction"]):::iri 
  c10(["CHEBI:18059"]):::iri 
  c16(["up:Catalytic_Activity_Annotation"]):::iri 
  c12(["up:Protein"]):::iri 
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v1 --"rdfs:subClassOf"-->  c3
    v1 --"rh:status"-->  c5
    v1 --"rh:side"-->  v2
    v2 --"rh:contains"-->  v3
    v3 --"rh:compound"-->  v4
    v4 --"rh:chebi"-->  v5
    v5 --"rdfs:subClassOf"-->  c10
  end
  v6 --"a"-->  c12
  v6 --"up:reviewed"-->  c14
  v6 --"up:annotation"-->  v7
  v7 --"a"-->  c16
  v7 --"up:catalyticActivity"-->  v8
  v8 --"up:catalyzedReaction"-->  v1
  bind1[/"count(*)"/]
  bind1 --as--o v9