SELECT ?type (COUNT(*) AS ?works) WHERE { ?w oc:resourceType ?type . } GROUP BY ?type ORDER BY DESC(?works)
rete playground · documentation · github.com/caviri/rete