sparql-examples

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

View the Project on GitHub ytirlet/sparql-examples

M75_rhea_to_chebi

rq turtle/ttl

compound to ChEBI

Use at

PREFIX up: <http://purl.uniprot.org/core/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX rh: <http://rdf.rhea-db.org/>
SELECT ?chebi ?compound ?superchebi
WHERE {
	?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?chebi . 
	?chebi (rdfs:subClassOf)+ ?superchebi.
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?chebi"):::projected 
  v1("?compound"):::projected 
  v3("?superchebi"):::projected 
  a1((" "))
  a2((" "))
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    subgraph union1[" Union "]
    subgraph union1l[" "]
      style union1l fill:#abf,stroke-dasharray: 3 3;
      v1 --"rh:underlyingChebi"-->  a2
      a2 --"rh:chebi"-->  v2
    end
    subgraph union1r[" "]
      style union1r fill:#abf,stroke-dasharray: 3 3;
      v1 --"rh:reactivePart"-->  a1
      a1 --"rh:chebi"-->  v2
    end
    union1r <== or ==> union1l
    end
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v1 --"rh:chebi"-->  v2
  end
  union0r <== or ==> union0l
  end
  v2 --"rdfs:subClassOf"-->  v3