SELECT ?type (COUNT(*) AS ?records) WHERE { ?s a ?type . } GROUP BY ?type ORDER BY DESC(?records)
rete playground · documentation · github.com/caviri/rete