query-a0ddbe1de8e46d3a47bc926a9864bd48

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?oc ?ocLabel (sample(?subocLabel) as ?example) (count(?suboc) as ?number_of_subclass) where {
  ?oc wdt:P31 wd:Q28640 
      filter not exists { 
      ?superocc wdt:P31 wd:Q28640 . 
      ?oc wdt:P279 ?superocc .
    }
  ?suboc wdt:P31 wd:Q28640 .
  ?suboc wdt:P279+ ?oc .
  SERVICE wikibase:label {
   bd:serviceParam wikibase:language "en" .
  }
} group by ?oc ?ocLabel  order by desc(?number_of_subclass)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?example") v7("?number_of_subclass") v3("?oc"):::projected v4("?suboc"):::projected v5("?subocLabel"):::projected v2("?superocc") c5(["bd:serviceParam"]):::iri c2(["wd:Q28640"]):::iri c7(["en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0c2 e0v2 --"wdt:P279"--> e0v1 e0v2("?oc"):::projected e0v1("?superocc"):::projected e0c2(["wd:Q28640"]):::iri end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> c2 f0 --> v3 f0 --> c3 v2 --"wdt:P31"--> c2 v3 --"wdt:P279"--> v2 v3 --"wdt:P31"--> c2 v4 --"wdt:P31"--> c2 v4 --"wdt:P279"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind3[/"sample(?subocLabel)"/] v5 --o bind3 bind3 --as--o v6 bind4[/"count(?suboc)"/] v4 --o bind4 bind4 --as--o v7