Feature summary
We need to store suggestions that have been accepted by the user in the ISA database.
For this initial version of the feature, we only need to keep a record of Google Vision suggestions (already implemented) that have been "accepted". However, the next iteration of the feature will require us to also store:
- Rejected suggestions
- Metadata-to-Concept module suggestions
A suggestion is "accepted" when the user adds a depict statement with the same Wikidata Q number as one of the suggestions presented in the UI.
Uses
The main uses of this feature will be:
- Analysing the performance of the automated suggestions
- Reporting back to the suggestion services which statements where accepted/rejected
- Not displaying rejected statements (for this one we need to make sure the solution used allows us to quickly and cheaply query for "rejected statements for image X" as this will need to be completed when the user lands on an image)
Technical info
Database
It seems the best approach would be to create a new table for storing suggestions, e.g.
| id | campaign_id | file | depict_item | status |
Where:
campaign_id = campaign in which the suggestion was presented
file = filename of the image which the suggestion is for
depict_item = the Wikidata item of the suggestion depict value
status = "accepted" or "rejected" (or perhaps better to use integer codes instead? 0=rejected, 1=accepted)
Front end
We need to add a key to the object used in the postContribution method.
For this iteration, we only need to add:
"googleVisionSuggestion": true/false
Where this is determined in the front end by comparing the depict values to the list of suggestions.
Later, we can add another service (e.g. conceptToImageSuggestion = true/false