Wikidata API - SWE-574-Spring-2018/LinkyWay GitHub Wiki

Overview

Wikidata is a free, collaborative, multilingual, secondary database, collecting structured data to provide support for Wikipedia, Wikimedia Commons, the other wikis of the Wikimedia movement, and to anyone in the world.

In Wikidata, the focus is structured data. This makes it possible for humans and computers alike to use the data. The Wikidata repository consists mainly of items.

Items: Representations of knowledge. Items are flexible enough to represent abstract concepts like childhood, hunger, and weight as well as real-world objects like a television, a kayak, and a volcano. Each item has its own page—where all the data about it is collected—and a unique identifier. This identifier always looks similar to Q123. In order to identify, represent and differentiate data, we have items.

Data Model

Items in Wikidata consist of four main components:

  1. Label: A label is like a page title (e.g Earth, London, cat, planet). An item can have only one label.
  2. Description: Provide more details about an item (e.g third planet in the Solar System). An item can have only one description in each language.
  3. Aliases: Alternative names for Earth to the page. An item can have multiple aliases.
  4. Statements: Concepts, topics, and objects related with an item is stored using statements. Statements are represented by property-value pairs (e.g label: Earth, property: highest point, value: Mount Everest). Properties have a P followed by a number, such as with educated at P69.

Wikidata Data Model Image Reference: Wikidata.org

Data Access via API

Wikidata is a central storage repository that can be accessed by anyone. There are a number of ways to access Wikidata using built-in tools, external tools, or programming interfaces. We will focus mainly on the public API. There is an extensive set of guidelines provided for API consumers:

Query API Page for metadata queries.

Wikibase API Page for entity filtering.

Wikibase API Datamodel for a detailed explanation of the Wikibase datamodel.

Wikibase API Documentation for details of the API usage.

In addition to the documentation above, there are several tools to get familiar with the Wikidata API:

API Sandbox for playing with the API.

Wikidata Toolkit for a client library in Java.

Wikidata Toolkit Examples for show cases of the Wikidata Toolkit.