@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_00294 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Variants in MECP2 causing Rett Syndrome"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot: <http://nextprot.org/rdf/entry/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>

SELECT DISTINCT ?start ?stop ?original ?modified WHERE {
 nextprot:NX_P51608 :isoform ?iso. #MECP2 entry
 ?iso :swissprotDisplayed true. #Swissprot canonical isoform
 {
 ?iso :variant ?v.
 ?v :disease nextprot_cv:DI-00999. #UniProtKB term for Rett Syndrome
 ?v :start ?start.
 ?v :end ?stop.
 filter((?stop - ?start) = 0) #single amino acid variants (SAAVs)
 ?v :original ?original.
 ?v :variation ?modified.
 }
 union
 {
 ?iso :proteoform ?pf.
 ?pf :diseaseRelatedVariant ?ann.
 filter not exists {?ann :negativeEvidence ?negev} # No negative disease evidence
 ?ann :impactedObject /:term nextprot_cv:C75488. #NCI Thesaurus term for Rett Syndrome
 ?pf :difference ?v.
 ?v :start ?start.
 ?v :end ?stop.
 filter((?stop - ?start) = 0)
 ?v :original ?original.
 ?v :variation ?modified.
 }
}
order by asc(?start)""" ;
    schema:keywords "disease",
        "tutorial",
        "variant" ;
    schema:target <https://sparql.nextprot.org/sparql> .

