@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ex: <https://sparql.rhea-db.org/.well-known/sparql-examples/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:46_Number_of_IsA_relationships a sh:SPARQLExecutable, sh:SPARQLSelectExecutable;
  rdfs:comment "Number of IsA relationships, distinct child reactions and distinct parent reactions"@en;
  sh:select """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>

SELECT 
    (COUNT(?reactionChild) AS ?isARelationCount) 
    (COUNT(distinct ?reactionChild) AS ?uniqueReactionChildCount)
    (COUNT(distinct ?reactionParent) AS ?uniqueReactionParentCount)
WHERE {
    ?reactionChild rdfs:subClassOf rh:Reaction .
    ?reactionChild rh:status rh:Approved .
    ?reactionParent rdfs:subClassOf rh:Reaction .
    ?reactionParent rh:status rh:Approved .
    ?reactionChild rdfs:subClassOf ?reactionParent .
}""";
  schema:target <https://sparql.rhea-db.org/sparql> .
