sparql-examples

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

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

39

Retrieve entries and catalytic activities in the reviewed (UniProtKB/Swiss-Prot) section that have experimental evidences,

Use at

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT  
  ?protein
  ?rhea 
WHERE {
  # ECO 269 is experimental evidence
  BIND (<http://purl.obolibrary.org/obo/ECO_0000269> as ?evidence)
  GRAPH <http://sparql.uniprot.org/uniprot> {
    ?protein up:reviewed true ;
      up:annotation ?a ;
      up:attribution ?attribution  .

    ?a a up:Catalytic_Activity_Annotation ;
      up:catalyticActivity ?ca .
    ?ca up:catalyzedReaction ?rhea .
  
    [] rdf:subject ?a ;
      rdf:predicate up:catalyticActivity ;
      rdf:object ?ca ;
      up:attribution ?attribution .

    ?attribution up:evidence ?evidence .
  }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?a")
  v4("?attribution")
  v5("?ca")
  v1("?evidence")
  v2("?protein"):::projected 
  v6("?rhea"):::projected 
  a1((" "))
  c2(["true^^xsd:boolean"]):::literal 
  c8(["up:catalyticActivity"]):::iri 
  c7(["up:Catalytic_Activity_Annotation"]):::iri 
  bind0[/"http://purl.obolibrary.org/obo/ECO_0000269"/]
  bind0 --as--o v1
  v2 --"up:reviewed"-->  c2
  v2 --"up:annotation"-->  v3
  v2 --"up:attribution"-->  v4
  v3 --"a"-->  c7
  v3 -->c8--> v5
  v5 --"up:catalyzedReaction"-->  v6
  a1 --"rdf:subject"-->  v3
  a1 --"rdf:predicate"-->  c8
  a1 --"rdf:object"-->  v5
  a1 --"up:attribution"-->  v4
  v4 --"up:evidence"-->  v1