query-7c06e8925be9ab2c2ba5dfac176e08f0

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:AreaChart
SELECT ?st ?ct {
  {
   BIND (0 AS ?ct)
   BIND (0 AS ?st)
  }
  UNION {
    SELECT ?st (COUNT(*) as ?ct)
    {
      ?item wdt:P31*/wdt:P279* wd:Q30612 ; wikibase:statements ?st
    }
    GROUP BY ?st
    ORDER BY ?st
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?ct"):::projected v3("?item") v2("?st"):::projected a1((" ")) c3(["wd:Q30612"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v3 --"wikibase:statements"--> v2 bind1[/"count(*)"/] bind1 --as--o v4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; bind2[/"'0^^xsd:integer'"/] bind2 --as--o v4 bind3[/"'0^^xsd:integer'"/] bind3 --as--o v2 end union0r <== or ==> union0l end