@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:18 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Select the number of UniProtKB entries for each of the EC (Enzyme Commission) top level categories"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX ec: <http://purl.uniprot.org/enzyme/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT ?ecClass (COUNT(?protein) as ?size)
WHERE
{
    VALUES (?ecClass) {(ec:1.-.-.-) (ec:2.-.-.-) (ec:3.-.-.-) (ec:4.-.-.-) (ec:5.-.-.-) (ec:6.-.-.-) (ec:7.-.-.-)} .
    ?protein ( up:enzyme | up:domain/up:enzyme | up:component/up:enzyme ) ?enzyme .
    # Enzyme subclasses are materialized, do not use rdfs:subClassOf+
    ?enzyme rdfs:subClassOf ?ecClass .
}
GROUP BY ?ecClass ORDER BY ?ecClass""" ;
    schema:keywords "ec",
        "enzyme" ;
    schema:keywords "enzyme" , "count" , "enzyme classification" ;
    schema:target <https://sparql.uniprot.org/sparql/> .

