query-358039ef8d9e54b96e52a283191ac8fc

rq turtle/ttl

Classes

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wbt: <https://wikifcd.wikibase.cloud/prop/direct/>
PREFIX wb: <https://wikifcd.wikibase.cloud/entity/>
PREFIX p: <https://wikifcd.wikibase.cloud/prop/>
PREFIX prov: <http://www.w3.org/ns/prov#>

SELECT
  ?instances
  ?class ?classLabel
  ?instance_example ?instance_exampleLabel
WHERE {
   {
  SELECT 
    (COUNT(?instance) AS ?instances)
    ?class 
    (SAMPLE(?instance) AS ?instance_example)
  WHERE {
    ?instance wbt:P1 ?class . 
  }
  GROUP BY ?class
} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?instances)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?class"):::projected v2("?instance") v4("?instance_example"):::projected v4("?instances"):::projected c3(["bd:serviceParam"]):::iri c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --https://wikifcd.wikibase.cloud/prop/direct/P1--> v3 bind2[/"count(?instance)"/] v2 --o bind2 bind2 --as--o v4 bind3[/"sample(?instance)"/] v2 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end