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

ex:NXQ_00251 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins with at least one proteotypic peptide 9aa+ not mapping on canonical isoform"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>

select ?entry (sample(?isopos) as ?samplematch) WHERE {
 ?entry :isoform ?iso1, ?isononcano.
 ?iso1 :swissprotDisplayed true .
 ?isononcano :swissprotDisplayed false .
 ?isononcano :peptideMapping ?pm.
 ?pm :peptideName ?pepname.
 ?pm :proteotypic true.
 ?pm :start ?pos ; :end ?pos2 .
 filter(?pos2 - ?pos >= 8) # peptide length >= 9
 bind(strafter(str(?isononcano),"-") as ?isostr)
 bind(concat(concat(?isostr,"-"),?pos) as ?isopos)
 filter not exists {?iso1 :peptideMapping/ :peptideName ?pepname.}
 }
group by ?entry""" ;
    schema:keywords "isoforms",
        "peptide",
        "proteomics",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

