@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:37 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find the human protein which contains an epitope VSTQ, where T is a phosphorylated threonine"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """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"))
}""" ;
    schema:keywords "PTM" , "phosphorylation" , "search within sequence" ;
    schema:target <https://sparql.uniprot.org/sparql/> .

