A set of SPARQL examples that are used in different SIB resources
Proteins with at least one phosphotyrosine but no phosphoserine or phosphothreonine
PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
SELECT DISTINCT ?entry WHERE {
select ?entry ?iso (count(?ptm) as ?ptmCnt) WHERE {
?entry :isoform ?iso.
?iso :modifiedResidue ?ptm.
?ptm :term nextprot_cv:PTM-0255 #phosphotyrosine.
filter (
not exists { ?iso :modifiedResidue / :term nextprot_cv:PTM-0253. } #phosphoserine
&&
not exists { ?iso :modifiedResidue / :term nextprot_cv:PTM-0254. } #phosphothreonine
)
} group by ?entry ?iso having ( count(?ptm) >= 1 )
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?_anon_aaf95e3c346c4c97af230d5bcfeba8ab1312")
v2("?entry"):::projected
v1("?iso")
v3("?ptm")
v5("?ptmCnt")
a2((" "))
a3((" "))
a1((" "))
c7([":terminology/PTM-0255"]):::iri
c4([":terminology/PTM-0253"]):::iri
c5([":terminology/PTM-0254"]):::iri
f0[[" >= '1^^xsd:integer'"]]
f0 --> a1
f1[["not not "]]
subgraph f1e0["Exists Clause"]
e0v1 --":modifiedResidue"--> e0a1
e0a1 --":term"--> e0c3
e0v1("?iso"):::projected
e0a1((" ")):::projected
e0c3([":terminology/PTM-0253"]):::iri
end
f1--EXISTS--> f1e0
subgraph f1e1["Exists Clause"]
e1v1 --":modifiedResidue"--> e1a1
e1a1 --":term"--> e1c3
e1v1("?iso"):::projected
e1a1((" ")):::projected
e1c3([":terminology/PTM-0254"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c2
f1 --> a2
f1 --> c3
f1 --> c4
f1 --> a3
f1 --> c5
v1 --":modifiedResidue"--> a2
a2 --":term"--> c4
v1 --":modifiedResidue"--> a3
a3 --":term"--> c5
v2 --":isoform"--> v1
v1 --":modifiedResidue"--> v3
v3 --":term"--> c7
bind4[/"count(?ptm)"/]
v3 --o bind4
bind4 --as--o v4
bind5[/"count(?ptm)"/]
v3 --o bind5
bind5 --as--o v5