@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_00149 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "BRCA1 variants with at least 5 different Severe phenotypes"@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
?pfname
(count(?pvlabel) as ?severe_count)
(group_concat(?pvlabel;separator=", and ") as ?severe_list)
WHERE {
 nextprot:NX_P38398 :isoform / :proteoform ?pf .
 ?pf rdfs:label ?pfname .
 ?pf :phenotypicVariation ?pv1 .
 ?pv1 rdfs:comment ?pvlabel .
 ?pv1 :evidence / :severity :Severe .
 }
group by ?pfname having (count(?pvlabel)>=5)
order by desc(count(?pvlabel)) ?pfname""" ;
    schema:keywords "phenotype",
        "tutorial",
        "variant" ;
    schema:target <https://sparql.nextprot.org/sparql> .

