A set of SPARQL examples that are used in different SIB resources
Find UniProtKB entries with a transmembrane region, with an alanine in the 15 amino acid region preceding the transmembrane
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?protein ?from ?interestingRegion
WHERE
{
?protein up:annotation ?annotation .
?annotation a up:Transmembrane_Annotation .
# Get the coordinates of the Transmembrane
?annotation up:range ?range .
?range faldo:begin ?beginI .
?beginI faldo:position ?begin .
?beginI faldo:reference ?sequence .
# The aas will have the specific IUPAC aminoacids
?sequence rdf:value ?aas .
# We calculate the start by substracting 10
BIND(?begin - 10 AS ?tenBeforeBegin)
# Can't start before the sequence starts or we might miss some results
BIND(IF(?tenBeforeBegin < 1, 0, ?tenBeforeBegin) AS ?from)
# Substring the IUPAC aminoacids
BIND(SUBSTR(?aas, ?from, 15) AS ?interestingRegion)
# The interestingRegion needds to contain an Alanine
FILTER(CONTAINS(?interestingRegion, 'A'))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?aas")
v3("?annotation")
v6("?begin")
v5("?beginI")
v10("?from"):::projected
v11("?interestingRegion"):::projected
v2("?protein"):::projected
v4("?range")
v7("?sequence")
v9("?tenBeforeBegin")
c4(["up:Transmembrane_Annotation"]):::iri
f0[["contains(?interestingRegion,'A')"]]
f0 --> v11
v2 --"up:annotation"--> v3
v3 --"a"--> c4
v3 --"up:range"--> v4
v4 --"faldo:begin"--> v5
v5 --"faldo:position"--> v6
v5 --"faldo:reference"--> v7
v7 --"rdf:value"--> v8
bind1[/"?begin - '10^^xsd:integer'"/]
v6 --o bind1
bind1 --as--o v9
bind2[/"if(?tenBeforeBegin < '1^^xsd:integer','0^^xsd:integer',?tenBeforeBegin)"/]
v9 --o bind2
bind2 --as--o v10
bind3[/"substring(?aas,?from,'15^^xsd:integer')"/]
v8 --o bind3
v10 --o bind3
bind3 --as--o v11