query-0d6bf2c4c8e28169a05589545543e303

rq turtle/ttl

PropertiesOCLC control number (P243)instance 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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?type ?typeLabel ?itemCount 
WHERE {
  {
    SELECT ?type (COUNT(DISTINCT ?item) AS ?itemCount)
    WHERE {
      ?item wdt:P243 ?ocn ;
            wdt:P31 ?type .
    }
    GROUP BY ?type
    ORDER BY DESC(?itemCount)  
  }
  MINUS {
    ?type wdt:P279* wd:Q386724.

  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?itemCount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item") v5("?itemCount"):::projected v3("?ocn") v4("?type"):::projected c6(["bd:serviceParam"]):::iri c4(["wd:Q386724"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"wdt:P243"--> v3 v2 --"wdt:P31"--> v4 bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v5 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v4 --"wdt:P279"--> c4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end