For the second batch of images we do not have an exact machine readable mapping to a Wikidata object. We can however still attempt to find an exact category match.
Proposed strategy
( This would probably be called from inside the if not found_commonscat in generate_content_cats() after the class and keyword calls )
- Check if there is a commons category with the exact same name as item.name.
- Get the parent categories of that category.
- If any of the parent categories is also in item.content_cats then the category should be considered an exact match.
- Add the exact match to item.content_cats and remove (at least) the connecting parent category from item.content_cats.
- If we fail to make an exakt match then add a maintenance category along the lines of "needs more specific category"