@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_00109 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins that have a MS-identified proteotypic peptide that maps partly or fully into a signal sequence"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>

SELECT DISTINCT ?entry ?overlap WHERE {
 ?entry :isoform ?iso.
 #get Signal position (start is always 1)
 ?iso :signalPeptide [:end ?s2] .
 ?iso :peptideMapping ?pm .
 ?pm :proteotypic true .
 #get peptide position
 ?pm :start ?p1 ; :end ?p2 .
 #match positions
 filter ( ?p1 < ?s2 )
 bind ( if(?p2<?s2, ?p2, ?s2) - ?p1 as ?overlap) .
 filter(?overlap > 2)
}""" ;
    schema:keywords "peptide",
        "proteomics",
        "signal sequence",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

