#
# example SPARQL query 161
#

@prefix schema: <https://schema.org/> . 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
@prefix sh: <http://www.w3.org/ns/shacl#> . 
@prefix cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/> .


cello:Query_161 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Count of sequence variation annotations by sequence variation type and status"""@en ; 
    schema:keywords "sequence variation" , "stats" ; 
    schema:target <https://sparql.cellosaurus.org/sparql> ; 
    sh:select """
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
select ?seqvar_class ?status ?with_source (count(distinct ?annot) as ?seqvar_count) where {
 ?annot a cello:SequenceVariationInfo .
 optional { ?annot cello:hasTarget ?sv . ?sv a ?seqvar_class  }
 optional { ?annot  cello:variationStatus ?status }
 optional { ?annot  cello:hasSource ?src }
 bind( if (bound(?src), "yes", "no") as ?with_source)
}
group by ?seqvar_class ?status ?with_source
order by ?seqvar_class ?status ?with_source
    """
    .

