A set of SPARQL examples that are used in different SIB resources
Count of sequence variation annotations by sequence variation type and status
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
select ?seqvar_class ?status ?with_source (count(distinct ?annot) as ?seqvar_count) where {
?annot a cello:SequenceVariationInfo .
optional { ?annot cello:hasTarget ?sv . ?sv a ?seqvar_class }
optional { ?annot cello:variationStatus ?status }
optional { ?annot cello:hasSource ?src }
bind( if (bound(?src), "yes", "no") as ?with_source)
}
group by ?seqvar_class ?status ?with_source
order by ?seqvar_class ?status ?with_source
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?annot"):::projected
v1("?seqvar_class"):::projected
v7("?seqvar_count")
v6("?src")
v2("?status"):::projected
v5("?sv")
v7("?with_source"):::projected
c2(["cello:SequenceVariationInfo"]):::iri
v4 --"a"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."cello:hasTarget".-> v5
v5 --"a"--> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."cello:variationStatus".-> v2
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."cello:hasSource".-> v6
end
bind0[/"if(bound(?src),'yes','no')"/]
v6 --o bind0
bind0 --as--o v7
bind2[/"count(?annot)"/]
v4 --o bind2
bind2 --as--o v7