@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_00225 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins with high proline content"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry ?AAcnt ?seqlen ?AAdensity WHERE {
 ?entry :isoform ?iso.
 ?iso :swissprotDisplayed true .
 ?iso :sequence / :chain ?seq .
 ?iso :sequence / :length ?seqlen .
 bind( strlen( replace( str(?seq), "[^P]", "")) as ?AAcnt) # replace all non-Proline by empty string
 bind(xsd:float(?AAcnt)/xsd:float(?seqlen) as ?AAdensity)
 filter(?AAcnt > 10)
}
order by desc(?AAdensity)
limit 100 # will bring-up the 100 most relevant cases""" ;
    schema:keywords "sequence",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

