SELECT ?p (COUNT(*) AS ?n) WHERE { ?s ?p ?o . } GROUP BY ?p ORDER BY DESC(?n) LIMIT 20
rete playground · documentation · github.com/caviri/rete