I would like to write an equivalent recursive query in Sparql to query all types of organisations on Wikidata that roll up to wd:43229 (organisation)
For example, the following entity Q4926947, The output should like so
entity|entityLabel|path
Q4926947|Blitz Arcade| Q210167->Q112042224->Q1058914->Q4830453->Q43229
Q4926947|Blitz Arcade| Q210167->Q112042224->Q783794->Q43229
Q4926947|Blitz Arcade| Q210167->Q112042224->Q18388277->Q6881511->Q4830453->Q43229
Q4926947|Blitz Arcade| Q210167->Q112042224->Q18388277->Q6881511->Q362482->Q679206->Q43229
There are several paths that lead to Q43229. In my query, I would only like to specify the root (Q43229) and it should be able to query all the leaf nodes that link to Q43229
This is what I've got so far, but it is far from the desired result. Any help is appreciated
SELECT ?item ?itemLabel (group_concat(?linkTo; separator=",") as ?org_path) {
wd:Q43229 ^wdt:P279* ?item
OPTIONAL { ?item ^wdt:P279* ?linkTo }
SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
} group by ?item ?itemLabel
limit 5