sparql-examples

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

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

37

rq turtle/ttl

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"))
}
a
up:organism
up:sequence
up:annotation
a
rdfs:comment
up:range
faldo:position
faldo:reference
faldo:begin
faldo:position
faldo:reference
faldo:end
rdf:value
?aaSequence
?annotation
?begin
?comment
?end
?protein
?range
?sequence
up:Modified_Residue_Annotation
taxon:9606
up:Protein
contains(?comment,'Phosphothreonine')
substring(?aaSequence,?begin + '-2^^xsd:integer','4^^xsd:integer') = 'VSTQ'