query-25dfcee52eaaf2fbd0818300cc6ee781
number of KOS instances grouped by KOS type of first level SELECT ?kostype ?kostypeLabel (COUNT(distinct ?kos) AS ?count) { ?kostype wdt:P279 wd:Q6423319 . ?kos wdt:P31/wdt:P279* ?kostype . SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } GROUP BY ?kostype ?kostypeLabel ORDER BY DESC(?count)
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#>
# number of KOS instances grouped by KOS type of first level
SELECT ?kostype ?kostypeLabel (COUNT(distinct ?kos) AS ?count) {
?kostype wdt:P279 wd:Q6423319 .
?kos wdt:P31/wdt:P279* ?kostype .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
GROUP BY ?kostype ?kostypeLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v3("?kos"):::projected
v2("?kostype"):::projected
a1((" "))
c5(["bd:serviceParam"]):::iri
c7(["en"]):::literal
c2(["wd:Q6423319"]):::iri
v2 --"wdt:P279"--> c2
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind1[/"count(?kos)"/]
v3 --o bind1
bind1 --as--o v4