sparql-examples

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

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

51

rq turtle/ttl

Find all proteins linked to arachidonate (CHEBI:32395)

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX up: <http://purl.uniprot.org/core/>


SELECT 
    DISTINCT
        ?uniprot
        ?uniprotID
        ?recname
        ?gene
        ?chebi
        ?uniprotName
WHERE {
  SERVICE <https://sparql.rhea-db.org/sparql> {
     VALUES (?chebi) { (CHEBI:32395) }
     ?rhea rh:side/rh:contains/rh:compound ?compound .
     ?compound rh:chebi ?chebi .
     ?chebi up:name ?uniprotName .
  }
  ?uniprot up:annotation/up:catalyticActivity/up:catalyzedReaction ?rhea .
  ?uniprot up:mnemonic ?uniprotID .
  ?uniprot up:recommendedName/up:fullName ?recname .
  OPTIONAL {?uniprot up:encodedBy/skos:prefLabel ?gene .}
}
(optional)
https://sparql.rhea-db.org/sparql
rh:side
rh:contains
rh:compound
rh:chebi
up:name
up:annotation
up:catalyticActivity
up:catalyzedReaction
up:mnemonic
up:recommendedName
up:fullName
up:encodedBy
skos:prefLabel
?uniprot
?gene
VALUES ?chebi
?chebi
CHEBI:32395
?rhea
?compound
?uniprotName
?recname
?uniprotID