As a creator of campaigns, I want to be able to direct users to particular categories of images to tag with depicts statements using the ISA tool/CAT, so that I can increase the amount of structured data on images in a _targeted area.
This task is to create a script that can be updated to point to any particular category on Commons and run through older images in that category to add them to the "popular" CAT queue. The first use case is for Category:Files_from_content_partnerships from the creators of the ISA tool:
As we are planning to work on content that has been uploaded by GLAM institutions: Would it be possible to include all the files in the following category (including sub-categories) to the maintenance script that triggers the generation of “depicted” suggestions? Category:Files_from_content_partnerships
Acceptance Criteria
- A script is created that can be run on any category when needed to add all images from that category to the CAT "popular" queue
- The script is run on Category:Files_from_content_partnerships
- The script does not prioritize images in that category (e.g., uncategorized images will still maintain priority in the CAT queue as per T262857)
Testing instructions
tl;dr: run the script maintenance/createFileListFromCategoriesAndTemplates.php to generate a list of files in either a category or a template that can then be ingested by maintenance/fetchSuggestions.php
Only the categories code has changed with this patch, but you probably also ought to check that I haven't broken the template code
How the script works is essentially you give it the name of a category or a template and it writes a list of articles with that category or template (one article title per line)
So, for example, you can create a list of article titles that have template Boink with mwscript extensions/MachineVision/maintenance/createFileListFromCategoriesAndTemplates.php --outputFile=/path/to/your/file --template=Boink
You can create a list of article titles in category Bazoink and its subcats with mwscript extensions/MachineVision/maintenance/createFileListFromCategoriesAndTemplates.php --outputFile=/path/to/your/file --category=Bazoink --deepcat (remove deepcat to exclude the subcats)
You'll need to set up templates/categories locally to check this, and probably ought to set up a circular category loop to make sure that deepcat doesn't give you an infinite loop