I have a list of articles and I want to find the main category of each article.
Wikipedia lists its main categories here - http://en.wikipedia.org/wiki/Portal:Contents/Categories.
I am able to find the subcategories of each article using:
http://en.wikipedia.org/w/api.php?action=query&prop=categories&titles=%s&format=xml
I also am able to check whether a subcategory is within a category:
http://en.wikipedia.org/w/api.php?action=query&titles=Dog&prop=categories&clcategories=Domesticated animals&format=xml
This will tell me whether "domesticated animals" is a subcategory of Dog, but this is not quite what I want. I want to be able to check which main category 'domesticated animals' is in. Is this possible using the API?