sparql-examples

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

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

37

Find the human protein which contains an epitope VSTQ, where T is a phosphorylated threonine

Use at

PREFIX faldo: <http://biohackathon.org/resource/faldo#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT 
  ?protein 
  ?comment
  ?begin
  ?end 
WHERE
{
  ?protein a up:Protein ;
    up:organism taxon:9606 ; 
    up:sequence ?sequence ;
    up:annotation ?annotation .
  ?annotation a up:Modified_Residue_Annotation ;
    rdfs:comment ?comment ;
    up:range ?range .
  ?range 
    faldo:begin [ faldo:position ?begin ; faldo:reference ?sequence ] ;
    faldo:end [ faldo:position ?end ; faldo:reference ?sequence ] .
  ?sequence rdf:value ?aaSequence .
  FILTER (SUBSTR(?aaSequence, ?begin -2 , 4) = "VSTQ")     
  FILTER (CONTAINS(?comment, "Phosphothreonine"))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?aaSequence")
  v6("?annotation")
  v3("?begin"):::projected 
  v1("?comment"):::projected 
  v8("?end"):::projected 
  v4("?protein"):::projected 
  v7("?range")
  v5("?sequence")
  a1((" "))
  a2((" "))
  c11(["up:Modified_Residue_Annotation"]):::iri 
  c8(["taxon:9606"]):::iri 
  c6(["up:Protein"]):::iri 
  f0[["contains(?comment,'Phosphothreonine')"]]
  f0 --> v1
  f1[["substring(?aaSequence,?begin + '-2^^xsd:integer','4^^xsd:integer') = 'VSTQ'"]]
  f1 --> v2
  f1 --> v3
  v4 --"a"-->  c6
  v4 --"up:organism"-->  c8
  v4 --"up:sequence"-->  v5
  v4 --"up:annotation"-->  v6
  v6 --"a"-->  c11
  v6 --"rdfs:comment"-->  v1
  v6 --"up:range"-->  v7
  a1 --"faldo:position"-->  v3
  a1 --"faldo:reference"-->  v5
  v7 --"faldo:begin"-->  a1
  a2 --"faldo:position"-->  v8
  a2 --"faldo:reference"-->  v5
  v7 --"faldo:end"-->  a2
  v5 --"rdf:value"-->  v2