wikidata

This page provides help, with the most common questions about using Wikidata in Wikipedia and templates, as described bellow.

You can also search all Wikipedia's help pages using the search box below, or browse the Help menu or the Help directory.

wikidata
The Wikidata logo

Wikidata is a collaboratively edited knowledge base hosted by the Wiki Foundation. It is a common source of open data that Wiki projects such as Wiki can use, and anyone else, under a public domain license.

In this page there is a basic explanation about how to use Wikipedia Tools and Language links with Wikidata, in an easy language for newbies, in the first part; and, in the second, about how to use Wikidata elements for Wikipedia templates.

wikidata 
The link to edit the Wikidata page, in grey, in the lateral pane.

From a Wikipedia page, you can go to the link "Wikidata item", using "Tools" in the lateral pane (in the left), to see and edit it. Also in Tools, there is another link to "page information", where is "Wikidata item ID", that contains the QID (for example: Q171 or "None").

QID (or Q number) is the unique identifier of a data item on Wikidata, comprising the letter "Q" followed by one or more digits. It is used to help people and machines understand the difference between items with the same or similar names, e.g., there are several places in the world called London and many people called James Smith. This number appears next to the name at the top of each Wikidata item.

You can go to the page of the same item in the Wikimediasphere (that is, Wiki sister projects) using the links under "In other projects", also in the lateral pane.

Finally, you can go to other Wikipedia language links of the item, clicking in "Languages" in the lateral pane. In a similar way to clicking "Wiki item", you can use "Edit links" there.

Templates

Here, we are going to see how to use data from Wikidata in enwiki templates.

Data model

How to link to Wikidata items and QID from Wikipedia:

  • d:item = en:article title
    d:Q-number = identity for enwiki:article title
      Example:
      (todo).

Template building: using data from Wikidata

Inclusion of data values may be achieved by using mediawiki-like WP:MAGICWORDs.

Simple

Fetching instance of (P31) for this page; and cause of death (P509) for Douglas Adams (Q42):

    Using #property
    {{#property:P31}} → Wiki help page
    {{#property:P509|from=Q42}} → myocardial infarction

Automatic links can be created where they exist:

    Using #statements
    {{#statements:P31}}Wiki help page
    {{#statements:P509|from=Q42}}myocardial infarction

By module or template

wikidata 
Wikidata screenshot - label field highlighted
wikidata 
Changing item label in Wikidata, from "elephant" to another arbitrary one (you can see asdfasdfasdf before the Q).

To fetch data from Wikidata with or without a link to the connected Wikipedia article and with many other features:

For example: {{wikidata|label|raw}} returns the Q-identifier (also known as QID or identifier) of the Wikidata item connected to the current page (e.g. "Q55").

Label (also name) is the main name given to identify an entity (i.e. an item or a property). E.g.: the item with the item identifier d:Q7378 has the English label “elephant”. Every entity has exactly one label in a given human language. Labels do not need to be unique. Descriptions and aliases are used to distinguish between entities with the same label. Wikidata pages do not have labels, but titles. It's a type of term.

Raw means that will return the Q-identifier or P-identifier instead of the regular label.

In infoboxes

Module:WikidataIB was developed to provide the tools necessary for drawing information from Wikidata into infoboxes on Wiki English. It allows infobox fields to draw information from Wikidata while ensuring that local values take priority and that unsourced information is filtered out by default. It also gives the infobox designer the opportunity to make the enabling of Wikidata controllable on a per-article basis ("opt-in").

    Example of conversion
    An infobox like {{Infobox writer}} has a field for "Occupation" with its value defined like this: | data7 = {{{occupation|}}}
    That could be updated to bring information from Wikidata using the getValue function from the module, which has a template shortcut {{wdib}}. Occupation is P106:
    | data7 = {{wdib |fwd={{{fetchwikidata|}}} |P106 |qid={{{qid|}}} | {{{occupation|}}} }}
    That would import the sourced occupations of the connected page (or any other page if qid is set) unless the local parameter |occupation= is given a value in an article, when that value takes preference over anything in Wikidata. But this does not happen until |fetchwikidata=ALL is set in the infobox of the article.
    For example, for Douglas Adams (Q42), we would get:
    screenwriter, novelist, science fiction writer, writer, musician wikidata 
    The pen icon is automatically added at the end of each field that fetches its value from Wikidata and gives a direct link to the place on Wikidata where the value(s) came from. It can be suppressed by setting |noicon=true.
    Although the values are linked, there is a string-handling function that will capitalise the first letter, regardless of whether the value is linked or is part of a list:
    {{#invoke:String2 |ucfirst | {{wdib|fwd=ALL|P106|qid=Q42}} }}Screenwriter, novelist, science fiction writer, writer, musician wikidata 
    Examples of some of the functionality can be found at Module talk:WikidataIB/testing.

Tracking

    Tracking categories
    Tracking & using

To track the data in or missing from one or more Wikidata properties; or to indicate that template or module uses a Wikidata property or properties, where available.

A property (also attribute) describes the data value of a statement and can be thought of as a category of data, for example "color" for the data value "blue". Properties, when paired with values, form a statement in Wikidata. Properties are also used in qualifiers. Properties have their own pages on Wikidata and are connected to items, resulting in a linked data structure.

See also

Tags:

wikidata Access from Wikipedia and linkswikidata Templateswikidata

🔥 Trending searches on Wiki English:

Natalia TenaTina TurnerJennifer ConnellyJoseph StalinSexXXX (2002 film)Colonel Tom ParkerThe Whale (2022 film)WikiThe Banshees of InisherinRaghav ChadhaIOSBen StillerJohn TravoltaDemi MooreMel GibsonBelarusMelanie LynskeySuccession (TV series)Barack ObamaBrock LesnarBranch DavidiansDwayne JohnsonChabeloWrexham A.F.C.Tottenham Hotspur F.C.Leo VaradkarKellie-Jay Keen-MinshullJ. Robert OppenheimerThomas TuchelAustin Butler2023 IBA Women's World Boxing Championships2022 Israeli legislative electionJeremy Strong (actor)NapoleonWindows Server 2019Jennifer AnistonKabzaa (2023 film)Pathaan (film)The Ballad of Songbirds and SnakesRoman EmpireClaudia KarvanThe Menu (2022 film)List of NCAA Division I men's basketball championsSteve BuscemiBabylon (2022 film)Keanu Reeves filmographyFranceBholaaMadonnaBRICSVal KilmerCharlotte FlairHighland Park parade shootingCatSnoop DoggLamar JacksonBanzhaf power indexMillennialsJonah HillChris RockRasmus HøjlundYami GautamGabriel BassoTwitterParineeti ChopraTed NugentMichael LandonJake GyllenhaalFinlandList of James Bond filmsSarah, Duchess of YorkNicholas BraunChristina RicciEngland national football team🡆 More