Page MenuHomePhabricator

Attempt exact Category match
Closed, ResolvedPublic

Description

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 )

  1. Check if there is a commons category with the exact same name as item.name.
  2. Get the parent categories of that category.
  3. If any of the parent categories is also in item.content_cats then the category should be considered an exact match.
  4. Add the exact match to item.content_cats and remove (at least) the connecting parent category from item.content_cats.
  5. If we fail to make an exakt match then add a maintenance category along the lines of "needs more specific category"

Event Timeline

In 4 we can either only remove the connecting category(ies) or remove them all if we also implement T170528: Remove skipping categories for certain keywords