Wikidata edits are fetched via wikidata.org/w/api.php using
action=query&list=usercontribs&ucstart={contest.start_time}&ucend={contest.end_time}
for each Participant.user in this contest.
The Wikibase edit type is parsed from the auto-generated comment
(e.g. /* wbsetclaim-create:2||1 */) using a regex.
Points are stored in a new WikidataEdit model and summed
alongside bytes_points in the counter query.
Updated scoring formula
bytes_points = FLOOR(SUM(real_bytes per article, capped) / bytes_per_points) pictures_points = FLOOR(SUM(pictures) / pictures_per_points) wikidata_points = SUM(WikidataEdit.points) per participant new total_points = bytes_points + pictures_points + wikidata_points
Features
Enable Wikidata scoring
Adds wikidata_enabled boolean to Contest model. When on, the cron update command also queries wikidata.org for each participant's edits.
Exclude bot edits
Skips edits where the Wikidata usercontribs API returns a bot tag. Stored as wikidata_exclude_bots on Contest.
Only count edits linked to contest articles
If on, only scores Wikidata edits to items with a sitelink to an article in this contest's Article list. If off, any Wikidata edit by a participant counts.
Points per Wikibase action
Stored in a new WikidataPointRule model
(contest → action_type → points). One row per rule per contest.
Edit type
Wikibase action (parsed from comment)
Points
Create new item
wbcreate-new
Add statement
wbsetclaim-create
Add reference
wbsetreference-add
Add label / description
wbsetlabel-add / wbsetdescription-add
Add sitelink
wbsetsitelink-add
Edit statement
wbsetclaim-update
Remove statement
wbremoveclaims
This tab demonstrates the real load_wikidata management command logic running in the browser.
It calls wikidata.org/w/api.php?action=query&list=usercontribs live,
parses Wikibase action types from edit comments using regex
/\/\* ([\w-]+)(?::[^*]*)? \*\//, and scores each edit
using the point rules defined in the settings tab.
Item
Edit comment (raw)
Parsed action
Points awarded
Timestamp
Total Wikidata points for this period:0
Create / edit contest
Fields marked new are added by Wish #8 to the existing manage form