Extension:MobileFrontend/WikiGrok

WikiGrok is an experimental feature in the MobileFrontend Extension that prompts a user to confirm metadata information that will be eventually stored in Wikidata (https://www.wikidata.org).

Prototype user testing results
See Design/Research/Guerilla testing Wikigrok.

WikiGrok version A
Currently in Beta mode.

WikiGrok version A is a simplified interface that only asks a single binary question (randomly selected from all claim possibilities for that item), for example, "Was Anne Dallas Dudley an insurance broker?" It offers three possible answers: 'Yes', 'No', and 'Not sure'. After the user answers the question, they are thanked for participating and can then dismiss the interface.

WikiGrok version B
Currently in Alpha mode.

Version B is a more complicated tagging interface. In this version the user is presented a random set of several possible metadata tags. The user is asked to select the correct tags and then submit them. After the user submits the tags, they are thanked for participating and can then dismiss the interface. The tags only have two possible states: selected and not selected. 'Not selected' is an ambiguous state, i.e. it can either mean that the user rejected the tag or that the user isn't sure the tags is correct.

Vocabulary
Wikidata:Glossary is required reading to understand the rest of this documentation. Especially the entries on item, property, claim, label, and values.

Claim recording
Right now (during prototype testing) claims are recorded on Tool Labs via the WikiGrok API. The API code itself is at https://github.com/kaldari/WikiGrokAPI (with some limited documentation). The table where the claim data is stored is s52293__wikigrok.claim_log. The client-side code that interacts with that API is in the WikiGrokApi class in MobileFrontend. During the A/B testing phase, we will be switching to use EventLogging for claim recording. (See Trello card). Once we have selected a model to productize (A or B), we will probably switch to using dedicated database tables.

Claim suggestions
Currently: WikiGrok relies on claim suggestions generated by scripts written by Magnus and stored in database tables on Tool Labs. These scripts in turn rely heavily on the WikidataQuery API (which is not an official part of Wikidata, but a 3rd party service created by Magnus). Most of the scripts can be seen in Magnus's bitbucket repo. The tables are: These tables are directly accessible by maintainers of the wikidata_game project on Tool Labs, or can be accessed via the WikiGrok API on Tool Labs (https://github.com/kaldari/WikiGrokAPI).
 * s51999__merge_candidates.genderless_people (items that are people and don't have their gender set)
 * s51999__merge_candidates.people_no_date (items that are people and are missing birth/death dates; does not include suggestions)
 * s51999__merge_candidates.potential_disambig (items that may be disambiguation pages)
 * s51999__merge_candidates.potential_nationality (potential nationality for specific items)
 * s51999__merge_candidates.potential_new_pages (?)
 * s51999__merge_candidates.potential_occupation (potential occupations for specific items)
 * s51999__merge_candidates.potential_people (items that may be humans)

Coming soon: WikiGrok will do its own analysis of existing Wikipedia and Wikidata content related to an item to generate cached lists of claim suggestions for each item. How these claim suggestions are generated depends on the type of claim, but typically it will involve looking at links or template parameters in an article and seeing if they could be potential claims. Some of these may follow logic similar to Magnus's scripts and some may not.

Criteria for specific suggestions
See Extension:MobileFrontend/WikiGrok/Claim suggestions.

Local testing
Since your local articles are not connected to actual Wikidata items (i.e. they don't have valid Wikidata item IDs), WikiGrok will not work locally unless you use a testing override. To force WikiGrok to load on any page, you can manually assign the page a Wikidata item ID via the query string. Just make sure the item ID corresponds to a Wikidata item that would normally trigger the WikiGrok interface (for example, an item that needs an occupation claim). Examples include: If your local wiki has an article called MegaMan, you should be able to load WikiGrok with the following URL: http://localhost/index.php/MegaMan?wikidataid=Q3784220 (or something similar depending on how your local wiki is configured).
 * Q3784220 - Anne Dallas Dudley (one potential occupation claim, insurance broker)
 * Q116287 - James Fazy (multiple potential occupation claims)
 * Q1775 - Brownie Mary (potential nationality claim, Iran; potential alma mater claim)
 * Q9685 - Diana, Princess of Wales (potential nationality claim, UK, multiple potential occupation claims, alma mater claim)
 * Q764812 - August Wilson (potential alma mater claim)
 * Q14540 - Tina Fey (potential author claim)

Note: WikiGrok will only load if you are logged in, in Alpha or Beta mode, and you have the following config vars set in your LocalSettings.php file:

The WikiGrok API will accept data from any host, so there is no need to create a local instance of it for testing (unless you are writing new claim recording code and need to make sure it works). The API tracks the host that the data is submitted from (e.g. localhost, en.wiki, beta labs, etc.) so we can filter out submissions from testers and developers.