sparql-examples

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

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

2

Select all Rhea reactions annotated with a given Pubmed ID

Use at

PREFIX pubmed: <http://rdf.ncbi.nlm.nih.gov/pubmed/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>

# Query 2 
# Select all Rhea reactions annotated with a given Pubmed identifier (PMID = 29867142)
#
SELECT ?pubmed ?rhea ?accession ?isTransport  ?equation 
WHERE {
  ?rhea rdfs:subClassOf rh:Reaction .
  ?rhea rh:accession ?accession .
  ?rhea rh:citation ?pubmed .
  VALUES (?pubmed) { (pubmed:29867142) }
  ?rhea rh:isTransport ?isTransport .
  ?rhea rh:equation ?equation .
} ORDER BY ?rhea
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?accession"):::projected 
  v5("?equation"):::projected 
  v4("?isTransport"):::projected 
  v4("?pubmed"):::projected 
  v1("?rhea"):::projected 
  c2(["rh:Reaction"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rh:accession"-->  v2
  v1 --"rh:citation"-->  v4
  bind0[/VALUES ?pubmed/]
  bind0-->v4
  bind00(["pubmed:29867142"])
  bind00 --> bind0
  v1 --"rh:isTransport"-->  v4
  v1 --"rh:equation"-->  v5