sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

neXtProt/NXQ_00052

Proteins with a sequence that does not contain a lysine in the mature region

Use at

PREFIX : <http://nextprot.org/rdf/>

SELECT DISTINCT ?entry WHERE {
 ?entry :isoform ?iso .
 ?iso :sequence / :chain ?seq.
 ?iso :matureProtein [ :start ?mstart ; :end ?mend]
 bind(?mend - ?mstart + 1 as ?mlen)
 bind(substr(?seq, ?mstart, ?mlen) as ?mseq)
 filter (!regex (?mseq,'K'))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?entry"):::projected 
  v3("?iso")
  v6("?mend")
  v7("?mlen")
  v8("?mseq")
  v5("?mstart")
  v4("?seq")
  a1((" "))
  a2((" "))
  f0[["not regex(?mseq,'K')"]]
  f0 --> v8
  v2 --":isoform"-->  v3
  v3 --":sequence"-->  a1
  a1 --":chain"-->  v4
  a2 --":start"-->  v5
  a2 --":end"-->  v6
  v3 --":matureProtein"-->  a2
  bind1[/"?mend - ?mstart + '1^^xsd:integer'"/]
  v6 --o bind1
  v5 --o bind1
  bind1 --as--o v7
  bind2[/"substring(?seq,?mstart,?mlen)"/]
  v4 --o bind2
  v5 --o bind2
  v7 --o bind2
  bind2 --as--o v8