sparql-examples

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

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

73_enzymes_related_to_protein

Select Enzyme Classification (EC) classes that have a protein associated to them

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
  DISTINCT ?enzyme
WHERE {
  ?protein a up:Protein .
  {
    ?protein up:enzyme ?enzyme .
  } UNION {
    ?protein up:annotation ?caa .
    ?caa a up:Catalytic_Activity_Annotation .
    ?caa up:catalyticActivity ?ca .
    ?ca up:enzymeClass ?enzyme
  } UNION {
    ?protein up:component/up:enzyme ?enzyme .
  } UNION {
    ?protein up:domain/up:enzyme ?enzyme .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?ca")
  v3("?caa")
  v2("?enzyme"):::projected 
  v1("?protein")
  a1((" "))
  a2((" "))
  c5(["up:Catalytic_Activity_Annotation"]):::iri 
  c2(["up:Protein"]):::iri 
  v1 --"a"-->  c2
  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;
      subgraph union2[" Union "]
      subgraph union2l[" "]
        style union2l fill:#abf,stroke-dasharray: 3 3;
        v1 --"up:domain"-->  a2
        a2 --"up:enzyme"-->  v2
      end
      subgraph union2r[" "]
        style union2r fill:#abf,stroke-dasharray: 3 3;
        v1 --"up:component"-->  a1
        a1 --"up:enzyme"-->  v2
      end
      union2r <== or ==> union2l
      end
    end
    subgraph union1r[" "]
      style union1r fill:#abf,stroke-dasharray: 3 3;
      v1 --"up:annotation"-->  v3
      v3 --"a"-->  c5
      v3 --"up:catalyticActivity"-->  v4
      v4 --"up:enzymeClass"-->  v2
    end
    union1r <== or ==> union1l
    end
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v1 --"up:enzyme"-->  v2
  end
  union0r <== or ==> union0l
  end