A set of SPARQL examples that are used in different SIB resources
Number of complete EC numbers described at protein level, at domain levels, at component level
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 ?ecProt) as ?ecNumberInProteinCount)
(count(distinct ?ecDomain) as ?ecNumberInDomainCount)
(count(distinct ?ecComponent) as ?ecNumberInComponentCount)
WHERE
{
?protein up:reviewed true .
OPTIONAL {?protein up:enzyme ?ecProt . } .
OPTIONAL {?protein up:domain/up:enzyme ?ecDomain . } .
OPTIONAL {?protein up:component/up:enzyme ?ecComponent . } .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?ecComponent"):::projected
v3("?ecDomain"):::projected
v7("?ecNumberInComponentCount")
v6("?ecNumberInDomainCount")
v5("?ecNumberInProteinCount")
v2("?ecProt"):::projected
v1("?protein")
a1((" "))
a2((" "))
c2(["true^^xsd:boolean"]):::literal
v1 --"up:reviewed"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."up:enzyme".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."up:domain".-> a1
a1 --"up:enzyme"--> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."up:component".-> a2
a2 --"up:enzyme"--> v4
end
bind3[/"count(?ecProt)"/]
v2 --o bind3
bind3 --as--o v5
bind4[/"count(?ecDomain)"/]
v3 --o bind4
bind4 --as--o v6
bind5[/"count(?ecComponent)"/]
v4 --o bind5
bind5 --as--o v7