query-162b970b799622a38cfe34ccbef4f2f1
TODO
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#>
select ?descendentLabel (count(?mid) as ?distance) where {
?descendent wdt:P921 wd:Q202864.
?descendent wdt:P2860* ?mid .
?mid wdt:P2860+ wd:Q22241243.
?mid wdt:P921 wd:Q202864.
filter (?descendent != ?mid)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
group by ?descendentLabel
order by desc(?distance) ?descendentLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?descendent")
v2("?descendentLabel"):::projected
v5("?distance")
v4("?mid"):::projected
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
c4(["wd:Q22241243"]):::iri
c2(["wd:Q202864"]):::iri
f0[["?descendent != ?mid"]]
f0 --> v3
f0 --> v4
v3 --"wdt:P921"--> c2
v3 --"wdt:P2860"--> v4
v4 --"wdt:P2860"--> c4
v4 --"wdt:P921"--> c2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind2[/"count(?mid)"/]
v4 --o bind2
bind2 --as--o v5