query-b6b0fa390b8042246afeb5f89be31c93
Types of things that are followed by something else (P1366) SELECT ?typeFollowed ?typeFollowedLabel ?numItems WHERE { { SELECT ?typeFollowed (COUNT(DISTINCT ?item) AS ?numItems) { ?item wdt:P156 [] ; wdt:P31 ?typeFollowed . } GROUP BY ?typeFollowed ORDER BY DESC(?numItems) LIMIT 100 } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?numItems)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Types of things that are followed by something else (P1366)
SELECT ?typeFollowed ?typeFollowedLabel ?numItems
WHERE {
{
SELECT ?typeFollowed (COUNT(DISTINCT ?item) AS ?numItems)
{
?item wdt:P156 [] ;
wdt:P31 ?typeFollowed .
}
GROUP BY ?typeFollowed
ORDER BY DESC(?numItems)
LIMIT 100
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?numItems)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item")
v4("?numItems"):::projected
v3("?typeFollowed"):::projected
a1((" "))
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P156"--> a1
v2 --"wdt:P31"--> v3
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end