sparql-examples

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

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

53

Find mouse homologs in OMABrowser of human enzymes that catalyze reactions involving sterols (CHEBI:15889). Federating with Rhea and OMABrowser.

Use at

PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
  DISTINCT
    ?chebi
    ?reaction
    ?humanProtein
    ?mouseProtein
    ?cluster 
WHERE {
  SERVICE <https://sparql.rhea-db.org/sparql> {
    ?reaction rdfs:subClassOf rh:Reaction .
    ?reaction rh:side/rh:contains/rh:compound ?compound .
    ?compound rh:chebi ?chebi .
    ?chebi rdfs:subClassOf* CHEBI:15889
  }

  ?humanProtein up:organism taxon:9606 .
  ?humanProtein up:annotation ?a .
  ?a a up:Catalytic_Activity_Annotation .
  ?a up:catalyticActivity ?ca .
  ?ca up:catalyzedReaction ?reaction .

  SERVICE  <https://sparql.omabrowser.org/sparql> {
    ?cluster a orth:ParalogsCluster .
    ?cluster orth:hasHomologousMember ?node1 , ?node2 .
    ?node1 orth:hasHomologousMember* ?orthoProtein1 .
    ?node2 orth:hasHomologousMember* ?orthoProtein2 .
    ?orthoProtein1 lscr:xrefUniprot ?mouseProtein .
    ?orthoProtein2 lscr:xrefUniprot ?humanProtein .
    # inTaxon mouse
    ?orthoProtein1 orth:organism/<http://purl.obolibrary.org/obo/RO_0002162> taxon:10090 . 
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?a")
  v6("?ca")
  v3("?chebi"):::projected 
  v7("?cluster"):::projected 
  v2("?compound")
  v4("?humanProtein"):::projected 
  v12("?mouseProtein"):::projected 
  v8("?node1")
  v9("?node2")
  v10("?orthoProtein1")
  v11("?orthoProtein2")
  v1("?reaction"):::projected 
  a1((" "))
  a2((" "))
  a3((" "))
  c22(["taxon:10090"]):::iri 
  c17(["orth:ParalogsCluster"]):::iri 
  c10(["taxon:9606"]):::iri 
  c8(["CHEBI:15889"]):::iri 
  c3(["rh:Reaction"]):::iri 
  c13(["up:Catalytic_Activity_Annotation"]):::iri 
  subgraph s1["https://sparql.rhea-db.org/sparql"]
    style s1 stroke-width:4px;
    v1 --"rdfs:subClassOf"-->  c3
    v1 --"rh:side"-->  a1
    a1 --"rh:contains"-->  a2
    a2 --"rh:compound"-->  v2
    v2 --"rh:chebi"-->  v3
    v3 --"rdfs:subClassOf"-->  c8
  end
  v4 --"up:organism"-->  c10
  v4 --"up:annotation"-->  v5
  v5 --"a"-->  c13
  v5 --"up:catalyticActivity"-->  v6
  v6 --"up:catalyzedReaction"-->  v1
  subgraph s2["https://sparql.omabrowser.org/sparql"]
    style s2 stroke-width:4px;
    v7 --"a"-->  c17
    v7 --"orth:hasHomologousMember"-->  v8
    v7 --"orth:hasHomologousMember"-->  v9
    v8 --"orth:hasHomologousMember"-->  v10
    v9 --"orth:hasHomologousMember"-->  v11
    v10 --"lscr:xrefUniprot"-->  v12
    v11 --"lscr:xrefUniprot"-->  v4
    v10 --"orth:organism"-->  a3
    a3 --http://purl.obolibrary.org/obo/RO_0002162-->  c22
  end