@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_00271 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Polymorphisms located on ACE2 and TMPRSS2 and affecting proteins’ activity, structure, PTM..."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot: <http://nextprot.org/rdf/entry/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT (str(?gn) as ?gene) ?pos (str(?snpac) as ?varid) (str(?orgaa) as ?orgAA) ?annot_type (str(?txt) as ?note) (str(?varaa) as ?varAA) ?freq where
{
 values ?entry {nextprot:NX_Q9BYF1 nextprot:NX_O15393} # proteins of interest (ACE2, TMPRSS2)
 ?entry :gene /:recommendedName / rdfs:label ?gn.
 ?entry :isoform ?iso .
 ?iso :swissprotDisplayed true; :variant ?var .
 ?var :start ?pos ; :original ?orgaa; :variation ?varaa .
 optional {?var :evidence / :alleleFrequency ?freq .}
 ?var :evidence / :reference ?xref .
 ?iso :positionalAnnotation ?annot .
 optional {?annot rdfs:comment ?txt .}
 ?annot a ?annot_type .
 {
 ?annot :start ?pos; :end ?pos.
 filter not exists {?annot a :Variant. }
 filter not exists {?annot a :SequenceConflict. }
 }
 union
 {
 ?annot a :DisulfideBond.
 {?annot :start ?pos. }
 union
 {?annot :end ?pos. }
 }
 } order by ?entry ?pos""" ;
    schema:keywords "tutorial",
        "variant" ;
    schema:target <https://sparql.nextprot.org/sparql> .

