sparql-examples

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

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

131_count_panther_experimental_rhea

rq turtle/ttl

Count the number of PANTHER families that have an experimentally confirmed catalytic activity Count the number of PANTHER families that have an experimentally confirmed catalytic activity

Use at

PREFIX ECO: <http://purl.obolibrary.org/obo/ECO_>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX up:  <http://purl.uniprot.org/core/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>

SELECT
(COUNT(DISTINCT ?pantherFamily) AS ?pantherFamiliesWithExperimentalCatalyticActivity)
WHERE {
  # Protein has a catalytic activity annotation with a Rhea reaction
  ?protein up:annotation ?ann .
  ?ann up:catalyticActivity ?ca .
  ?ca up:catalyzedReaction ?rhea .

  # The catalyticActivity statement has experimental evidence and a citation
  ?reif rdf:subject   ?ann ;
        rdf:predicate up:catalyticActivity ;
        rdf:object    ?ca ;
        up:attribution ?attr .
  ?attr up:evidence ECO:0000269 .

  # Protein is linked to a PANTHER family cross-reference
  ?protein rdfs:seeAlso ?pantherFamily .
  ?pantherFamily up:database <http://purl.uniprot.org/database/PANTHER> .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?ann")
  v6("?attr")
  v3("?ca")
  v8("?pantherFamiliesWithExperimentalCatalyticActivity")
  v7("?pantherFamily"):::projected 
  v1("?protein")
  v5("?reif")
  v4("?rhea")
  c9(["ECO:0000269"]):::iri 
  c12([http://purl.uniprot.org/database/PANTHER]):::iri 
  c2(["up:catalyticActivity"]):::iri 
  v1 --"up:annotation"-->  v2
  v2 -->c2--> v3
  v3 --"up:catalyzedReaction"-->  v4
  v5 --"rdf:subject"-->  v2
  v5 --"rdf:predicate"-->  c2
  v5 --"rdf:object"-->  v3
  v5 --"up:attribution"-->  v6
  v6 --"up:evidence"-->  c9
  v1 --"rdfs:seeAlso"-->  v7
  v7 --"up:database"-->  c12
  bind1[/"count(?pantherFamily)"/]
  v7 --o bind1
  bind1 --as--o v8