Given a specific category (i.e. https://commons.wikimedia.org/wiki/Category:Motorcycles) I want to get names of all sub-categories recursively, either in SPARQL:
SELECT ?category ?entityLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
#get sub categories of category wd:Q7025402
}
LIMIT 10000
or using MediaWiki API:
https://commons.wikimedia.org/w/api.php?{get all subcategories of Category:Motorcycles}
Is there a way to do this?