Wikidata:Requests for permissions/Bot/Josh404Bot 4
- The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
- Approved--Ymblanter (talk) 20:34, 5 November 2022 (UTC)[reply]
Josh404Bot 4 (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: Josh404 (talk • contribs • logs)
Task/s:
Add review score (P444) for video game (Q7889) items that have an OpenCritic ID (P2864) with data from the OpenCritic (Q21039459) API.
Code:
https://github.com/josh/wikidatabots/compare/review-score
Script is written in Python using pywikibot.
Function details:
The bot intents to add or update review score (P444) statements qualified by review score by (P447) OpenCritic (Q21039459) with data from the OpenCritic API. Additionally, the number of reviews/ratings (P7887) qualifier will be added or updated. Edits will be referenced with OpenCritic ID (P2864) and retrieved (P813).
- Query a sample of items with a OpenCritic ID (P2864).
- For each item, use OpenCritic ID (P2864) to fetch topCriticScore and numReviews from the OpenCritic API.
- Check if there's an existing review score (P444) claim with the qualifier review score by (P447) OpenCritic (Q21039459)
- Update the existing review score (P444) claim or create a new one with topCriticScore
- Check if there's an existing number of reviews/ratings (P7887) qualifier or create a new one with numReviews
- Check if any edits will be submitted, the values may be already up-to-date. If so, skip to the next item without making an edit.
- If there are pending edits, create a OpenCritic ID (P2864) and retrieved (P813) reference
Some test edits for review:
- Q63225080 diff
- Q55614715 diff
- Q17210606 diff
- Q108061178 diff
- Q63175402 diff
- Q47004655 diff
- Q3010595 diff
- Q26252663 diff
- Q23303467 diff
- Q21427959 diff
Addition test edits after implementing suggestions:
Mentioning Jean-Fred who suggested the idea for the bot automation.
--Josh404 (talk) 23:58, 13 October 2022 (UTC)[reply]
- should this add a point in time (P585) qualifier in addition to the retrieved (P813)? In theory those needn't be the same. BrokenSegue (talk) 03:20, 14 October 2022 (UTC)[reply]
- Oh interesting. So there is also an updated timestamp that's returned from the API to indicate when the most recent change was. Curious how this could best be applied as a qualifier? Could it make sense as point in time (P585) or is there a better property for that? Josh404 (talk) 05:01, 14 October 2022 (UTC)[reply]
- Thanks for doing this!
- Agree that it makes sense to record this updated timestamp. I think point in time (P585) works fine for this (that’s also what’s used for the Rotten Tomatoes scores) Jean-Fred (talk) 12:20, 14 October 2022 (UTC)[reply]
- I would add -stated in (P248)OpenCritic (Q21039459) to the reference, for completeness
- I noticed that Rotten Tomatoes statements use -determination method or standard (P459)Tomatometer score (Q108403393) (there’s also a couple of -determination method or standard (P459)Metascore (Q106515043). How about creating such an item for “Top Critic Average” and use it? (I realized only now that OpenCritic has two scores, the “Top Critic Average” and the “Critics Recommend” so I think it’d make sense to be clear which one it is).
- Jean-Fred (talk) 12:20, 14 October 2022 (UTC)[reply]
- Great suggestions!
- ✔ Added point in time (P585). Just to double check, it's a qualifier to review score (P444) claim and not supposed to be on the reference source?
- ✔ Added stated in (P248) to the reference.
- That's an interesting idea with determination method or standard (P459). Do you think those items should be narrowly defined as "OpenCritic Top Critic Average" like Tomatometer score (Q108403393) is specific to Rotten Tomatoes (Q105584) or made more general purpose? OpenCritic outlines how their metrics are defined here.
- Josh404 (talk) 18:14, 14 October 2022 (UTC)[reply]
- yeah point in time is part of the statement not the reference. retrieved goes on the reference. I think having a narrowly defined item is fine. I Support now. BrokenSegue (talk) 20:18, 16 October 2022 (UTC)[reply]
- I created an item page for OpenCritic Top Critic Average (Q114712322). Feel free to make any improvements! And thanks for suggesting the idea. Josh404 (talk) 23:59, 16 October 2022 (UTC)[reply]
- Apologies, I missed the answer − this all looks great, thanks again for doing this! Jean-Fred (talk) 13:57, 31 October 2022 (UTC)[reply]
- Discovered an edge case where new games or games with not enough critic ratings return a -1 integer from the API. I updated the script to simply skip over these games and not post any statements. I think that's okay, but curious if anyone has opinions on whether this should be set to a no-value snak? Josh404 (talk) 16:27, 31 October 2022 (UTC)[reply]