A set of SPARQL examples that are used in different SIB resources
Number of EC numbers described at protein, domain and component levels
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX ec:<http://purl.uniprot.org/enzyme/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT
(count(distinct ?protein) as ?proteinCount)
WHERE
{
?protein up:reviewed true .
OPTIONAL{?protein up:enzyme ?ecNumber}
OPTIONAL{?protein up:domain/up:enzyme ?ecNumber}
OPTIONAL{?protein up:component/up:enzyme ?ecNumber}
FILTER (BOUND(?ecNumber))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?ecNumber")
v2("?protein"):::projected
v3("?proteinCount")
a1((" "))
a2((" "))
c2(["true^^xsd:boolean"]):::literal
f0[["bound(?ecNumber)"]]
f0 --> v1
v2 --"up:reviewed"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."up:enzyme".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."up:domain".-> a1
a1 --"up:enzyme"--> v1
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."up:component".-> a2
a2 --"up:enzyme"--> v1
end
bind2[/"count(?protein)"/]
v2 --o bind2
bind2 --as--o v3