query-1727b1908e06bd38125b4582eab322d0
TODO
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#>
SELECT ?n ?x ?xLabel ?c1 ?c1Label ?c2 ?c2Label ?class ?classLabel
WHERE {
{
SELECT (COUNT(DISTINCT (?x)) AS ?n) (MIN(?x) AS ?x) ?class WHERE {
{
SELECT ?x ?c1 ?c2 ?class WHERE {
?x wdt:P31 ?c1 .
?c1 wdt:P31 ?c2 .
?c2 wdt:P31 ?class .
} LIMIT 40000
}
} GROUP BY ?class
}
{
SELECT ?x ?c1 ?c2 ?class WHERE {
?x wdt:P31 ?c1 .
?c1 wdt:P31 ?c2 .
?c2 wdt:P31 ?class .
} LIMIT 40000
}.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } .
} ORDER BY DESC(?n) ?x ?c1 ?c2 ?classes
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?c1"):::projected
v4("?c2"):::projected
v6("?class"):::projected
v5("?classes")
v7("?n"):::projected
v7("?x"):::projected
c3(["bd:serviceParam"]):::iri
c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v7 --"wdt:P31"--> v3
v3 --"wdt:P31"--> v4
v4 --"wdt:P31"--> v6
bind2[/"count(?x)"/]
v7 --o bind2
bind2 --as--o v7
bind3[/"min(?x)"/]
v7 --o bind3
bind3 --as--o v7
v7 --"wdt:P31"--> v3
v3 --"wdt:P31"--> v4
v4 --"wdt:P31"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c3 --"wikibase:language"--> c5
end