A set of SPARQL examples that are used in different SIB resources
Glycosylation sites and cross links positions on SwissProt canonical isoforms
PREFIX : <http://nextprot.org/rdf/>
SELECT DISTINCT ?entry ?iso ?ptmtype ?pos ?modres WHERE {
?entry :isoform ?iso.
?iso :swissprotDisplayed true .
?iso :sequence / :chain ?seq .
?iso :ptm ?ptm.
?ptm :term ?modterm.
?ptm :start ?pos.
bind (substr(?seq,?pos,1) as ?modres) .
{
?ptm a :GlycosylationSite .
bind("glyco" as ?ptmtype)
}
union
{
?ptm a :CrossLink .
bind("cross-link" as ?ptmtype)
}
}
order by ?iso
#limit 100
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?entry"):::projected
v1("?iso"):::projected
v7("?modres"):::projected
v5("?modterm")
v6("?pos"):::projected
v4("?ptm")
v9("?ptmtype"):::projected
v3("?seq")
a1((" "))
c3(["true^^xsd:boolean"]):::literal
c11([":CrossLink"]):::iri
c10([":GlycosylationSite"]):::iri
v2 --":isoform"--> v1
v1 --":swissprotDisplayed"--> c3
v1 --":sequence"--> a1
a1 --":chain"--> v3
v1 --":ptm"--> v4
v4 --":term"--> v5
v4 --":start"--> v6
bind0[/"substring(?seq,?pos,'1^^xsd:integer')"/]
v3 --o bind0
v6 --o bind0
bind0 --as--o v7
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"a"--> c11
bind1[/"'cross-link'"/]
bind1 --as--o v9
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"a"--> c10
bind2[/"'glyco'"/]
bind2 --as--o v9
end
union0r <== or ==> union0l
end