A set of SPARQL examples that are used in different SIB resources
Count the number of times a Rhea reaction was experimentally annotated in a PANTHER family
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
?pantherFamily
(COUNT(?rhea) AS ?experimentalRhea)
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> .
} GROUP BY ?pantherFamily ORDER BY DESC(?experimentalRhea)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?ann")
v7("?attr")
v4("?ca")
v9("?experimentalRhea")
v8("?pantherFamily"):::projected
v2("?protein")
v6("?reif")
v5("?rhea"):::projected
c9(["ECO:0000269"]):::iri
c12([http://purl.uniprot.org/database/PANTHER]):::iri
c2(["up:catalyticActivity"]):::iri
v2 --"up:annotation"--> v3
v3 -->c2--> v4
v4 --"up:catalyzedReaction"--> v5
v6 --"rdf:subject"--> v3
v6 --"rdf:predicate"--> c2
v6 --"rdf:object"--> v4
v6 --"up:attribution"--> v7
v7 --"up:evidence"--> c9
v2 --"rdfs:seeAlso"--> v8
v8 --"up:database"--> c12
bind1[/"count(?rhea)"/]
v5 --o bind1
bind1 --as--o v9