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.

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

WikiGrok version A
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
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 via EventLogging (and are not yet being pushed to Wikidata). The API code that handles that is in the ApiResponse PHP class in the WikiGrok Extension. The client-side code that interacts with that API is in the WikiGrokResponseApi JS class in MobileFrontend. Once we have selected a model to productize (A or B), we will probably switch to using dedicated database tables.

Claim suggestions
WikiGrok analyses existing Wikidata content related to a page to generate cached lists of claim suggestions for each page. For example, if a page's Wikidata item indicates that the item is 'instance of human' and 'occupation writer', but not 'occupation author', it will add 'occupation author' as a claim suggestion for that page. The different types of claims that are possible to generate are defined as 'campaigns'. The campaign definitions are defined in the $wgWikiGrokSlowCampaigns global variable.

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

Local testing
To get WikiGrok to load locally, you have to do four things:
 * 1) Install the MobileFrontend and WikiGrok extensions
 * 2) Set   and
 * 3) Assign suggestions to the page in the database
 * 4) Assign a Wikidata item ID to the page using the query string

Note: WikiGrok will currently only load if you are in Alpha or Beta mode.

Assign suggestions to a page
To assign suggestions to a page on your local wiki, you'll need to insert records into the wikigrok_questions table in your local database. Here's an example:

Change  in the code above to the page ID of the page you want to test on. That will add two claim suggestions to the page: 'instance of live album' and 'instance of studio album'.

Assign a Wikidata item ID
You can manually assign any page a Wikidata item ID via the query string. Just append 'wikidataid=Q123' to the query string of the URL. It doesn't really matter what ID you assign, as long as you assign one.

Forcing a particular WikiGrok interface
You can force WikiGrok to load version A or version B by appending 'wikigrokversion=a' or 'wikigrokversion=b' to the query string of the URL.