A set of SPARQL examples that are used in different SIB resources
Proteins with one SH2 and two SH3 domains
PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
SELECT DISTINCT ?entry WHERE {
?entry :isoform ?iso.
#with 1 SH3
{select ?iso where{?iso :region ?stat1. ?stat1 :term nextprot_cv:DO-00614
} group by ?iso having(count( ?stat1)=1)}
#with 2 SH2
{select ?iso where{?iso :region ?stat2. ?stat2 :term nextprot_cv:DO-00615
} group by ?iso having(count( ?stat2)=2)}
} group by ?entry
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?_anon_524857e97b124dceaa8a4ecc8d1a18273384")
v6("?_anon_524857e97b124dceaa8a4ecc8d1a18273387")
v1("?entry"):::projected
v2("?iso")
v3("?stat1")
v5("?stat2")
a1((" "))
a2((" "))
c7([":terminology/DO-00615"]):::iri
c5([":terminology/DO-00614"]):::iri
v1 --":isoform"--> v2
f0[[" = '1^^xsd:integer'"]]
f0 --> a1
v2 --":region"--> v3
v3 --":term"--> c5
bind2[/"count(?stat1)"/]
v3 --o bind2
bind2 --as--o v4
f3[[" = '2^^xsd:integer'"]]
f3 --> a2
v2 --":region"--> v5
v5 --":term"--> c7
bind5[/"count(?stat2)"/]
v5 --o bind5
bind5 --as--o v6