query-43e54b9e56195ed89a92a3926e21e9e2
Six degrees of Bush, using the ALP service which is fast
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#>
# Six degrees of Bush, using the ALP service which is fast.
#defaultView:Graph
SELECT ?item ?itemLabel ?edgeLabel ?rgb ?linkTo
WHERE {
SERVICE bd:alp {
wd:Q207 ?pred ?item.
pathExpr true .
FILTER(?pred IN (wdt:P26, wdt:P451, wdt:P22, wdt:P25, wdt:P40))
lowerBound 1 .
upperBound 6 .
bidirectional true .
}
bind(if(?item = wd:Q207, "a0a0ff", "ffffff") as ?rgb)
?item ?pred ?linkTo. filter(?pred in (wdt:P26, wdt:P451, wdt:P22, wdt:P25, wdt:P40))
?edge wikibase:directClaim ?pred .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}