I have this wikidata query, that tries to find all the companies owned directly or indirectly by the Walt Disney company.
SELECT ?company ?companyLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?company (wdt:P127|wdt:P749)* wd:Q7414.
?company wdt:P31/wdt:P279* wd:Q4830453.
}
I'm trying to find if company is owned by Disney (P127) or where Disney is the parent organization (P749).
Property P749 is a subproperty of P127. There may be other subproperties of "owned by" that I don't know about.
Can I make a query that returns all companies that has relation that has any subproperty of "owned by" in relation to Disney? I also need to return the subsidiaries of the direct subsidiaries, and the subsidiaries of those subsidiaries and so on.