query-0a62a6d7cdd882e3dc143cf1f183d5a1

rq turtle/ttl

In the meantime, I think I got it myself. Any remarks?

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?class ?fullQuant (COUNT(distinct ?s) AS ?propQuant)
WHERE {
  ?s wdt:P31 ?class .
  ?s wdt:P610 ?o .
  {
    SELECT ?class (COUNT(?s2) AS ?fullQuant)
    WHERE {
      ?s2 wdt:P31 ?class .
    }
    GROUP BY ?class
  }
}
GROUP BY ?class ?fullQuant

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?class"):::projected v5("?fullQuant"):::projected v3("?o") v6("?propQuant") v1("?s"):::projected v4("?s2") v1 --"wdt:P31"--> v2 v1 --"wdt:P610"--> v3 v4 --"wdt:P31"--> v2 bind1[/"count(?s2)"/] v4 --o bind1 bind1 --as--o v5 bind3[/"count(?s)"/] v1 --o bind3 bind3 --as--o v6