Wikidata Query Service

Rationale
The Wikimedia Foundation Mobile web team is investigating new types of contributions that are better suited to the mobile device and user context than free-form text editing. Inspired by the Wikidata game, the team has built WikGrok, a feature that generates simple questions about a Wikipedia article and can send the responses to Wikidata. The ultimate goal of WikiGrok is two-fold:


 * 1) Provide an engaging way for users to add value to Wikimedia projects via a mobile device. WikiGrok contributors will be helping convert the tremendous but unstructured repository of knowledge contained in Wikipedia into structured, machine-readable data in Wikidata.
 * 2) Use the data generated by this feature to provide a better reading and editing experience on existing and new devices/platforms. As Wikidata becomes a more robust repository of structured data about Wikipedia items, we can use it to generate more modular blocks of content to our users across the spectrum of mobile devices (handsets, tablets, wearables), in specialized standalone apps, etc.

In order to scale up the current WikiGrok functionality, as well as provide a benefit to other proposed Wikidata-related projects, we need to build a service that allows for simple and more complex queries of Wikidata items/properties.

Use-cases
We hope to cover a variety of use-cases with WikiGrok, so that it can be a flexible tool for generating new campaigns to meet the changing needs of Wikidata. However, our current hypothesis is that while simple query question types will be easier to generate, the kinds of questions that require more sophisticated queries will be more interesting and engaging for end-users.

Simple query
Collect all Wikidata items with a specific claim or property.


 * Examples
 * all items that are ‘instance of: human’ (claim)
 * all items that have ‘date of publication’ (property)

Complex queries
Collect all Wikidata items that belong to an intersection or combination of parameters (including negation and ranges).


 * Examples
 * all ‘instance of: human’ with ‘birth date: between 1900 and 2000’
 * all ‘instance of: painting’ with ‘creator: Leonardo da Vinci’

Tree traversal
Look for specific data in a tree or collect items from a tree.


 * Examples
 * Find out what country a city is in by traversing the ‘administrative district’ tree
 * Build a list of all possible occupations by traversing the subclasses and instances of the ‘occupation’ item