query-df68e963ead7ee8d6eb9e5ca06ca30ad
Most frequent classes of items SELECT ?class ?classLabel (COUNT(?item) AS ?cnt) WHERE { ?item wdt:P5008 wd:Q6173448. ?item wdt:P31|wdt:P279 ?class. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?class ?classLabel ORDER BY DESC(?cnt)
Use at
- https://query.wikidata.org/sparql
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#>
# Most frequent classes of items
SELECT ?class ?classLabel (COUNT(?item) AS ?cnt) WHERE {
?item wdt:P5008 wd:Q6173448.
?item wdt:P31|wdt:P279 ?class.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?class ?classLabel
ORDER BY DESC(?cnt)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?class"):::projected
v4("?cnt")
v2("?item"):::projected
c6(["bd:serviceParam"]):::iri
c2(["wd:Q6173448"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P5008"--> c2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P279"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P31"--> v3
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v4