User:Danny Benjafield (WMDE)/sandbox


handy links - MediaWiki Documentation

Wikidata screenshot – adding a new sitelink
edit

Sitelinks are special links that connect a Wikidata item with another Wikimedia project page. They allow easy navigation between language versions of an article or page on the same concept, using a linked Wikidata item as a central hub. Sitelinks replaced the local, on-wiki links system referred to as interwiki links or interlanguage links.

Sitelinks populate the "In Other Languages" section, allowing reader's to switch to a corresponding page in their preferred language (or any other that is sitelinked). Of course, there is no guarantee that the page content will be the same as every language community is responsible for writing their pages. However, this does allow editor's to cross-reference content between different versions and update their page accordingly.

edit

Sitelinks are bidirectional links, creating a two-way connection between the Wikidata Item and the linked page. On Wikidata, the link will be stored under the relevant Project header (Wikipedia, Wikibooks, Wikinews and so on...). On the linked page, a 'Wikidata Item' button will appear in the Tools sidebar.

Unique

edit

Each Wikidata item can only have one sitelink to each Wikimedia project language version. There can be a sitelink from Douglas Adams (Q42) to the English and German Wikipedia, but not to two different English Wikipedia pages. The linked page can be an article, Help:, Special: or many other types of namespace) pages.

Consistent and Synchronized

edit

Editor's can refer to other language versions and the Wikidata item to check the completeness of their article, they might discover new content from another version to translate or use statements from the Wikidata item. Adding, editing or removing a sitelink will update in real-time. The change will be reflected wherever that link can be found.

Queryable

edit

Sitelink locations can be tracked, which allows better analysis of knowledge gaps and where articles and content is missing in different projects.

edit

If an editor clicks 'Add sitelink' under the Wikivoyage section of the Sitelinks area for the Wikidata Item Berlin (Q64), this enforces the domain of the sitelink to .wikivoyage.org/.
They will then be asked to enter the language code (ISO 639-1 or ISO 639-3) of the language-version of Wikivoyage to link to. Entering the language code will open a dropdown list to select the matching language version of that Wikimedia project.

How to add a Sitelink?

edit

There are a few ways to add a sitelink, depending from where you are adding it and which Preferences you have set.

From the Wikidata Item

edit
  1. Find the Wikidata item you want to sitelink to / from.
  2. Click the edit / pencil icon in the appropriate Sitelink section (Wikipedia, Wikivoyage, Wikisource, etc.)
  3. If there are already sitelinked pages, scroll to the bottom of the list.
  4. In the first input box (with placeholder text 'wiki') enter the language code of the target Wikipedia / Wikimedia project. A dropdown menu will appear with the language name, click to confirm.
  • If the target language version is already sitelinked, it will not appear in the dropdown.
  • If you enter a partial, you will be shown all partial-matching language versions available based on your entry. Entering 'y' in the Wikipedia section will display results for Yiddish (yi) and Yorùbá (yo) - if neither of these pages are already sitelinked.
  1. A new input field will appear (with placeholder text 'age'), enter the page title of the target article / page.
  2. To confirm and publish the sitelink, click the tick (tick symbol) on the Section header.

From a Wikimedia project (e.g. Wikipedia)

edit

(This process may vary depending on the Skin and Wikimedia project you are using)

Vector 2010

  • Click 'Add Links' from the Languages in the sidebar.
  • You will be forwarded to the Wikidata item
  • Follow the steps described above for adding from the Wikidata item (anchor link)

EN Wikipedia

  • Click 'Add Links' from the Languages in the sidebar.
    • A popup will appear with 2 input fields: Language and Page.
    • Language: Begin typing the language code or language name, a dropdown will appear showing matching and partially-matching options, click to select.
    • Page: Enter the title of the page to link to.
    • Click the 'Link Page' button to confirm.

Vector 2022

  1. Open the languages dropdown
  2. Click 'Add Other Languages'
  3. You will be forwarded to the Wikidata item
  4. Follow the steps described above for adding from the Wikidata item (anchor link)

Language-independent general principles

edit
 
Before Wikidata: Interlanguage links between all languages
 
After the start of Wikidata: Sitelinks to all languages from one central point

Usage

edit

Typically items have at least one corresponding page on a Wikimedia site such as Wikipedia, Wikivoyage, Wikisource, Wikiquote, or Wikimedia Commons (however, there are some exceptions to this rule). Having at least one sitelink ensures that an item meets Wikidata's notability criteria. Sitelinks are also useful for ensuring that items in Wikidata represent only one unique concept. In cases when more than one item could reasonably correspond to the same Wikimedia page, it is likely that the items should be merged together.


Sitelinks serve as a replacement for a previous system of interlanguage links that was used to link from a page in one language on a Wikimedia site to an equivalent page in another language, for example the English Wikipedia page on Paris to the French Wikipedia page on Paris. These interlanguage links used to be stored locally on each Wikimedia site and maintained separately in each language so that if the name of a page on one Wikimedia site changed, then the other Wikimedia sites in each language would need to have their links updated to reflect the changes. Sitelinks thereby improve upon this system by having everything centralized in Wikidata. Sitelinks can have attached badges and will usually show that a page has been a featured article, or of similar status.

Linking to Wikimedia site pages

edit


Wikidata currently supports sitelinks for most Wikimedia projects (except Incubator, see phab:T54971). The site id for English Wikipedia is enwiki, for French Wikipedia frwiki and so on and for Commons commonswiki. The site id for English Wikimedia projects are enwikinews, enwikiquote, enwikisource, enwikivoyage etcetera.

Sitelinks are for linking items to standalone pages that already exist on Wikimedia sites. Wikidata sitelinks do not support anchors (links to a specific section of a page). Anchors are preceded by the "#" character on Wikimedia sites.


For example, a sitelink for the item for The Beatles (Q1299) should only link to the Wikipedia page on The Beatles (https://en.wikipedia.org/wiki/The_Beatles) — and not any sections of that page, such as https://en.wikipedia.org/wiki/The_Beatles#Discography. Moreover, it's not possible for any item on Wikidata to link to just the Discography section of The Beatles page because this would require an anchor link. However, it would be possible to link a different item, The Beatles discography (Q829965) to a different Wikipedia page (i.e. one that is completely devoted to The Beatles discography, such as https://en.wikipedia.org/wiki/The_Beatles_discography).


Note that each Wikimedia/Wikipedia page can only have one sitelink to any one Wikidata item page. You will receive an error message when attempting to add a new sitelink if the page is already connected to another item page (even when trying to link to a redirect page pointing to this particular page). If you receive an error message but believe the item you are editing is the most appropriate one for a sitelink, you may need to merge two items.
Please consult Help:Merge or visit Wikidata:Interwiki conflicts to report a conflict and ask for others to look at the situation.


To connect a redirect page to a Wikidata item, you need to also add a redirect badge (usually intentional sitelink to redirect (Q70894304)) to it. To add a badge, click the icon next to the input field for the page title when adding the sitelink. Previously you can alternatively use local interlanguage links; this is no longer recommended.


A more detailed discussion on how to connect multiple related pages to two or more Wikipedia language editions: Help:Handling sitelinks overlapping multiple items.


Wiktionary

edit

Wiktionary article pages use a different method for sitelinking articles between language versions, called Extension: Cognate.
Sitelinks to Wikidata are still used in the other namespaces however, such as Special: or Help:.

Why is this?
Wiktionary 'sitelinks' (via cognate) work by matching an exact article name, and not a translation of that name. A Cognate sitelink for the word 'fire' between the English and German Wiktionary would mean both articles in both versions must have 'fire' in the article space of the URL:

EN: https://en.wiktionary.org/wiki/fire
DE: https://de.wiktionary.org/wiki/fire

With Wikidata sitelinks, moving from the English wikipedia article on 'Fire' to the German Wikipedia, would take you to 'Feuer'

EN WP: https://en.wikipedia.org/wiki/Fire
DE WP: https://de.wikipedia.org/wiki/Feuer

You can read more about the specific tools and rules on Wikidata:Wiktionary/Sitelinks.

Languages

edit

One of the primary uses of Sitelinks are providing an easy way to navigate to articles or pages of the same topic but in different languages. The English Wikipedia is the largest and most 'complete' and non-native readers and editors may often end up viewing articles there from their search results, but with the "Languages" tool (powered by Wikidata-Sitelinks), they can navigate to that article in their primary or other preferred language.

Sitelinked articles and pages are not translations
However, there is no guarantee that the linked-page will have the same level of content or completeness as the currently viewed article. Each language version of Wikipedia (or any other Wikimedia project) is an independent instance with its own editing community, policies and responsibility for adding content. This is important to ensure inherent biases of one dominant language and culture are not exported and replicated into other languages and communities. Read more about Wikimedia's Global perspective.

Of course, we encourage readers/editors to expand and edit the article if they see potential to contribute with information they have discovered from another language version or from the Wikidata Item. Learn about article translation of

Old: Sitelinks can be added to Wikimedia sites in more than 300 languages. When adding a sitelink for an item, you will need to input both the language of the Wikimedia site page that the item corresponds to and the title of the page as it appears on the Wikimedia site. You can only add a sitelink for a language and a Wikimedia site if a page on that language version of the Wikimedia site already exists.

Badges

edit

Badges can be applied to Sitelinks to give a visual clue about the quality or purpose of the the linked article or page. Commonly-used badges are:

  • (Silver Ribbon image) Silver Star indicates a Good Article.
  • (Gold Ribbon image) Silver Star is a Featured Article.
  • (Gold Ribbon image) Good List: Pages that are Lists rather than 'normal' articles.
  • Sitelink-to-Redirect: The linked page links again to another page, you are redirected. As Wikidata Items can only be sitelinked to one page per Wikipedia project version, redirects are a workaround to allow multiple links to a single, related concept.

Some Badges (such as Featured and Good Article) are displayed in the language-switcher. To see a full list of Badges, their function and how to apply them, visit the Help: Badges page.

Namespaces

edit

The Wikidata community agreed in an RFC that most namespaces of Wikimedia projects other than "User" are eligible for storage on Wikidata. This means that in addition to sitelinks for pages like Wikipedia articles and Wikisource texts, sitelinks for categories, templates, and help pages can also be stored in Wikidata. For an example of a Wikidata item referring to a namespace, see item Wikimedia category (Q4167836), which includes sitelinks to w:Wikipedia:Categorization, q:Help:Category, and voy:Wikivoyage:Categories.


Note that when adding a sitelink for a page that is outside of a Wikimedia site's main namespace, you need to keep the namespace in the page title.


Examples:


Wikidata item: Wikimedia category (Q4167836)
Wikiquote page to add as sitelink: <tvar name="1">https://en.wikiquote.org/wiki/Help:Category
Wikimedia site to add under "Language Code": English enwikiquote
Page title to add under "Linked page": Help:Category


Wikidata item: Joan of Arc (Q7226)
Wikiquote page to add as sitelink: https://en.wikiquote.org/wiki/Joan_of_Arc
Wikiquote site to add under "Language Code": English enwikiquote
Page title to add under "Linked page": Joan of Arc

edit
edit

Editors on the English Wikipedia have created a great page with all the necessary information for editors. Much of the information will be relevant to contributors on other Wikimedia projects too.

edit

An individual page on a Wikimedia site can completely suppress Wikidata sitelinks by using the {{noexternallanglinks}} magic word. The magic word also supports suppression of sitelinks from only specific languages, for example, "{{noexternallanglinks:es|fr|it}}" would suppress only the Spanish, French, and Italian links. Neither of these uses prevents Wikidata from listing all sitelinks of an item.

edit
 
Screenshot of "Languages" (Wikidata sitelinks) highlighted on a Wikimedia page

In the previous system of interlanguage links, an anchor link was used when a Wikimedia site did not have an exact match in another language for a corresponding page, but did have a page that dealt in part with the same subject. However, Wikidata does not support anchors as sitelinks. Previously, it is a practice to retain interlanguage links with anchors locally on the Wikimedia sites (not Wikidata); this is no longer recommended.


If you want to connect a section of a page (also called an anchor) to a Wikidata item, first find an appropriate redirect to that anchor (if none exists, create one), then connect the redirect to the item using Linking to Wikimedia site pages above.

Talk pages

edit

When linking from a Wikidata talk page (or most other pages other than items) to another Wikimedia project, a prefix is used in the wiki markup. For example, if one wished to link to the documentation about JSON format on mediawiki.org, one could write [[mediawikiwiki:Wikibase/DataModel/JSON]] and the result would be mediawikiwiki:Wikibase/DataModel/JSON.


A table of available prefixes may be found at Special:Interwiki.

Page renames

edit

When a page is renamed on a client wiki, the page move automatically updates the sitelink at Wikidata, if the renaming user has an active account on Wikidata.


Scenario: A new contributor at English Wikipedia, who has never visited Wikidata, renames an article. The sitelink at Wikidata will continue to point to the page title that has become a redirect.


When page moves aren't reflected on Wikidata, sometimes a second item for the new page title is created, leading to a duplicate on Wikidata. These should be merged.


A bot or Wikibase function could update sitelinks based on the pagemove log at Wikipedia (or other client wikis).


This is currently (November 2021) being done for German Wikipedia (Q48183) and English Wikipedia (Q328) by User:Krdbot.


It's appreciated if users who rename pages on client wikis log in to Wikidata once to create an account.

See also

edit

For related Help pages, see:


  • Help:Items, which explains what items are and what rules they follow
  • Help:Merge, which explains what merges are and how to perform one
  • Help:Badges, which explains badges


For additional information and guidance, see:

  • Project chat, for discussing all and any aspects of Wikidata
  • Wikidata:Glossary, the glossary of terms used in this and other Help pages
  • Help:FAQ, frequently asked questions asked and answered by the Wikidata community
  • Help:Contents, the Help portal featuring all the documentation available for Wikidata

Welcome! We're very happy to have you here!


Wikidata is a multilingual knowledge base of structured data that anyone can edit. The project relies on the efforts of people — just like you! — from all around the world who work together to collect and maintain data in more than 200 languages.


There are many opportunities for contributing to Wikidata, from improving and translating documentation to planning and proposing new properties in support of data. If you're looking for ways to get involved, please see below for an overview of the different roles and activities available, and browse the suggested and open tasks available.


If the roles listed below are not a good fit for you, or you're having a hard time deciding where your interests lie, please talk to someone on the Wikidata team (specifically Lydia).

Editors


You can directly edit data on item pages.

Add statements, qualifiers and sources to enrich the Wikidata knowledge base. Help with migrating language links to support centralized access for all Wikimedia Foundation projects.

To learn how to get started, see Help:Items to learn how to add or edit items, or follow an interactive tutorial at Wikidata:Tours.

Updating Help pages and improving documentation, for example by adding examples and screenshots, is another great way you can support the Wikidata community.

Developers/span>


As a developer you can either contribute to Wikibase, the extension that powers Wikidata, directly or write things on top of it.


If you are interested in writing bots that work on Wikidata please check out the Bots page.


Ambassadors


Ambassadors spread the word about Wikidata to others, answer questions about the project, and serve as educational resources for Wikidata. They encourage Wikidata collaboration on other sister projects you are active on, help update the weekly summary, or participate in Wikidata discussions on one of the mailinglists and Twitter, and provide support to other contributors on the IRC channelconnect.


If you are interested in giving a talk at a meet-up or conference or organizing a Wikidata event, Lydia Pintscher (WMDE) can provide you with slides, flyers and other material you might find useful.

Project members


WikiProjects are groups of contributors who want to work together as a team to improve Wikidata. These groups often focus on a specific topic area (for example, astronomy) or a specific kind of task (for example, solving problems related to disambiguation pages). To find a WikiProject that reflects your interests or to propose a new one that doesn't yet exist, visit WikiProjects.


As a contributor to Wikipedia, Wikivoyage, Wikisource, or any other one of Wikidata's sister projects, you can give valuable input on a lot of decisions that have to be made during development and deployment. To join in planning and discussions, or to help with integration of Wikidata on sister projects, navigate to sister projects.

Translators


As a translator you can translate Wikibase, the extension that powers Wikidata, on translatewiki.net.


In addition you can help by translating documentation and information pages about Wikidata here and also on Meta.


For more information for Wikidata translators, see the translators' noticeboard.

Data owners


If you have data that you want to contribute to Wikidata please see the page about data donation.


It is possible to enter data into Wikidata by hand and through a bot via an API. For the latter please review our API and Bots pages.

 


This page has been created to outline the benefits and challenges of using facts from Wikidata on other Wikimedia projects including how to avoid, improve or correct any issues and address common misunderstandings or concerns. It will also provide an overview of what is and isn’t currently possible when reusing data from Wikidata on other Wikimedia projects and improvements planned in the future. If you are new to Wikidata the following links may be helpful to you:


  • Wikidata:Database reports: many database reports show statistics about how sitelinks are being used on Wikidata. Try exploring some.
 

Centralising facts across many Wikimedia projects

edit

Centralising facts for Wikimedia projects on Wikidata will allow people across many different Wikimedia projects in many different languages to work together to collate information which has many benefits:

  • Reduce duplicated effort: Wikidata is multilingual, meaning that if you contribute information to Wikidata for it to be used on your project is available for all other projects to use. This is a much more efficient than all Wikimedia projects compiling facts separately e.g. manually updating numbers of inhabitants of each country in the world on every different language Wikipedia.
  • Reduce language barriers: Wikidata allows us to collate facts from sources in different languages and make them accessible to everyone, regardless of the language they speak. This concept also applies to barriers caused by lack of local and specialist knowledge about a subject.
  • Bring together data from many sources: Wikidata allows us to systematically import large volumes of facts from external databases using bots and tools.
  • More people working on error correction: By centralising facts we can centralise our efforts and resources to find and correct errors either through vandalism and good faith mistakes. Having a centralised database of facts means that errors only need to be corrected once, finding incorrect facts spread over several Wikipedia articles is harder to correct.
 

Data quality on Wikidata

edit

Wikidata is a young project that is growing quickly. Receiving contributions from users is essential to improving data quality. There are several ways data are added to and improved on Wikidata:

Individuals

edit

Individual users adding individual facts is the most common way users add data to Wikidata. Wikidata reuses data that has already been added to other Wikimedia projects, however this data is sometimes out of date, incomplete or incorrect.

Importing datasets

edit

Data is also added through importing large external datasets. Anyone can request that data is imported from an external source through the Wikidata:Data Import Hub.

Partnerships

edit

There are several partnerships with external organisations to improve data quality including:


Queries

edit

The Wikidata Query Service is one way that data can be checked for completeness and accuracy, you can request a query at Wikidata:Request a query.

Future developments

edit

In future Wikidata will be introducing new features including:

  • More specific tracking of changes to Wikidata item pages that are used on other Wikimedia projects
  • Property constraints are being developed as rules on properties that specify how properties should be used.
  • Signed statements: to improve and maintain data quality.
  • ORES: to automatically score the quality of an item.
 


Making changes to Wikidata

edit

Whilst Wikidata can be complex when adding a large quantity of data, adding single facts is a relatively simple process with a smaller learning curve than most other Wikimedia projects. The most common tasks on Wikidata are adding statements and adding references. Adding statements and references to Wikidata doesn't require a coding or markup knowledge. If you would like a larger amount of information from an external database added to Wikidata please make a request on the Wikidata:Data Import Hub.

Statements

edit

The process of adding statements is quite simple and requires no coding skills, an overview can be found at Help:Statements#Adding statements.

References on Wikidata

edit

Many facts on Wikidata do not yet have a reference or have a reference of being imported from another Wikimedia project. References are being added all the time both through individual contributions and planned, structured imports from external databases add 1000s or even 10,000 of referenced facts at a time. Adding a reference is a simple process:

  1. Choose a statement you would like to add a reference to and click the +Add reference button
  2. In the first box write reference URL if the information comes from an online source
  3. Paste the URL of the reference into the box on the right
  4. Click the Save button

For more in-depth instructions for adding references to statements please see Help:Sources.

 

Tracking changes to a Wikidata page from other Wikimedia projects

edit

It is important for Wikimedia project contributors using data from Wikidata on their pages to know if a change has been made on Wikidata that affects their pages. It is possible to keep track of changes made to Wikidata item pages which are being used to display facts on other Wikimedia projects. On your Wikimedia project (when logged in):

  1. Go to your Special:Preferences page (link in the top right-hand corner of your screen).
  2. Click on the Watchlist tab.
  3. Tick the check-box next to 'Show Wikidata edits in your watchlist'.
NOTE: There is also a 'Watchlist' tab to the right of the 'Special:Preferences' tab. That's different. Going there will NOT allow you to 'Show Wikidata edits in your watchlist'.

Now when a change is made to a Wikidata item which is being on another Wikimedia project it will be displayed in your watchlist. Currently, the watchlist will not display what change has been made on the Wikidata page or if the statement appears on the article, although these are planned improvements. You can simply use the History tab on Wikidata to find this information like any other Wikimedia project. This is a much clearer and simpler process than transclusion of images from Commons where it is not possible to keep track of changes of an image on Commons from within another Wikimedia project.

 


Examples of data reuse

edit

There are many ways Wikidata is being used on other Wikimedia projects including:

  • Wikidata fed infoboxes on Wikipedia
  • Maps and graphs
  • Mapping work on a subject
  • Visualisations
 

Wikidata fed infoboxes on Wikipedia

edit

It is possible for infoboxes on Wikipedia to use data directly from Wikidata.

Control on the wiki

edit

The templates that display the data from Wikidata provide additional controls to the wiki so they can customise the data to their needs, this includes:

  • Ability to override fields on the wiki
  • Filter to only show data on Wikidata that has references
  • Customise the parameters taken from Wikidata in the infobox
  • Select formatting (e.g., date formatting can be displayed as mdy or dmy)

Examples

edit

There are several examples of Wikidata fed infoboxes on Wikipedia, these include:

Guides

edit

Guides are available to help set up Wikidata fed infoboxes on Wikipedia

 


Maps and graphs

edit

You can render Wikidata content as maps and graphs in Wikimedia projects, also see Wikidata:Geoshapes.


Lakes with name "Long lake" in Sweden.
[ source data ]

Country with regions and capitals


Population of London.
[ source data ]

World land area.
[ source data ]
 


Mapping work on a subject

edit

It is possible to create lists of missing articles on any subject using Wikidata. This is done by creating a set of items on Wikidata and using a tool to see which articles do and do not exist on which Wikimedia projects:

 

Visualisations

edit

There are many tools, both within Wikimedia projects and externally that reuse and combine Wikidata, Wikipedia, Wikimedia Commons and other projects. These tools allow people to explore the content in a new way and can also be used to visualise content to provide new ways to highlight issues and possble improvements.

  • Histropedia: uses data from Wikipedia and Wikidata to automatically generate interactive timelines with events linked to Wikipedia articles. Example: The Apollo missions
  • Monumental: a tool that allows you to explore built heritage and learn more about monuments by collating information Wikidata, Wikipedia and Wikimedia Commons. Example: Paris
  • Scholia: a tool that creates scholarly profile pages constructed from queries to Wikidata Query Service. Example: Turing Award


 

Setting up use of Wikidata data on Wikimedia projects

edit

Wikidata:How to use data on Wikimedia projects provides technical instructions on how to use Wikidata data on another Wikimedia project. You can also find help on the Wikidata:Project chat.


Data from Wikidata can be directly displayed on Wikimedia projects, with different methods. With the parser function or Lua code, it is possible to display labels, descriptions, values, references, and a lot of other information stored on Wikidata. For an overview of uses on Wikidata on Wikimedia projects see Wikidata:Wikidata in Wikimedia projects.

On this page, you will learn how to use Wikidata data on your wiki. You can also learn more about what is Wikidata, how the information is organized, or browse the glossary.

Can I access Wikidata data from my wiki?

edit

The two main client functionalities, parser function and access via Lua, can be enabled together on the wikis of the Wikimedia projects. This is the case for almost all Wikimedia projects now.

To check if these functionalities are activated on a wiki, you can access the page Special:Version. In the section "Parser function hooks", if "statements" appears in the list, that means that you can use it on this wiki.

The access to Wikidata data is currently restricted to the Wikimedia projects, because of technical limitations. If you have your own instance of MediaWiki, you can't use Wikidata's data using these features. However, you can set up your own Wikibase instance and use data from there in the same way.

Parser function

edit

The first way to access data is to use the #statements parser function. This function will allow you to display the value of any statement included in an item.

 
Diagram of a Wikidata datamodel.

Direct access

edit

On a page that is connected to a Wikidata item via the interwiki links, you can use the function by adding the label of the property you want in your language or the P-number of the property. The code has to be added in the wikicode.

Examples:

  • {{#statements:member of political party}} or {{#statements:P102}} will return the "member of political party" value.
  • {{#statements:discoverer or inventor}} or {{#statements:P61}} will return the "discoverer or inventor" value.
  • On w:en:Douglas Adams, the code {{#statements:country of citizenship}} will display "United Kingdom".

Arbitrary access

edit

You can also display data from an item that is not connected via an interwiki link. For this, you use the same function, adding a parameter from= followed by the Q-id of the item.

Examples:

  • {{#statements:birth name|from=Q42}} will display "Douglas Noël Adams"
  • {{#statements:country of citizenship|from=Q42}} will display "United Kingdom".
  • {{#statements:P1476|from=Q191380}} will display "Notre-Dame de Paris"
  • {{#statements:author|from=Q191380}} will display "Victor Hugo"
  • {{#statements:publication date|from=Q191380}} will display "1831"

Multiple values

edit

When a statements has multiple values, the parser function will show the "best" value(s), which means:

Where there are multiple values, they are shown in a comma-separated list.

Example: {{#statements:occupation|from=Q42}} displays "playwright, screenwriter, novelist, children's writer, science fiction writer, comedian, writer, musician" (there are other occupations in Douglas Adams (Q42) but only some are preferred).

Formatted values

edit

For some properties, the #statements parser function will display the value in a specific format.

Commons images

The parser function displays a thumbnail preview of the image, resizing it to 200 pixels. It links to the Wikimedia Commons file description page.


{{#statements:image|from=Q42}} displays  


Geo coordinates

The parser function displays the coordinates in degree-minute-second format.


{{#statements:coordinate location|from=Q243}} displays 48°51′30″N 2°17′40″E


Monolingual text

Text values are displayed as they are, with no formatting.


{{#statements:native label|from=Q31}} displays "Koninkrijk België, Royaume de Belgique, Königreich Belgien".


Date

The date value will be formatted in day-month-year format.

{{#statements:date of birth|from=Q42}} displays 11 March 1952

Links

The links are clickable.

{{#statements:official website|from=Q243}} displays https://www.toureiffel.paris, https://www.toureiffel.paris/en, https://www.toureiffel.paris/it

External IDs

An external ID will provide a direct link to the external website.

{{#statements:IMDb ID|from=Q42}} displays nm0010930

Items

Items have their label (in the content language) displayed, without a link.

{{#statements:capital|from=Q142}} displays Paris

Raw value

edit

To display the unlinked value, use #property.

Sample:

{{#property:IMDb ID|from=Q42}} displays nm0010930

Modules

edit

Data can also be accessed with Lua modules, which are much more flexible. Modules that access data from Wikidata should be organized as instance of Wikimedia module using Wikidata (Q59259626). For instance, Module:Wikidata (Q12069631) is available on many wikis, see w:Module:Wikidata#Usage for usage instruction. If your wiki does not contain a module you can copy it from another wiki and add documentation.


For a full technical reference of Lua functions for accessing Wikidata, see mw:Extension:Wikibase Client/Lua.

Templates

edit

Some templates use modules to access Wikidata data. They are as simple to use as regular templates. Moreover, using Wikidata, some parameters become unnecessary. For instance, some infoboxes are able to retrieve data from Wikidata, so you just have to insert the template and all the data will magically appear (if the needed information is present on the Wikidata item, of course). For templates using Wikidata see Category:Templates using data from Wikidata (Q11985372).


If you want to create a template on your wiki, check your documentation page about Module:Wikidata and already existing templates.

Lists

edit

Regularly updated lists

edit

Daily updated lists based on SPARQL queries can be configured using Template:Wikidata list (Q19860885). Content is replaced daily.


There are essentially two uses:

  • Work lists: lists with topics to be covered in project namespace. Results can be limited to topics that don't exist.
  • Reference list: lists for a specific topic in article namespace.


This is currently the most efficient way of doing lists.

Dynamic lists

edit

Content is displayed from various items based on a selection done in a Lua module.

Manual lists

edit

A series of items are selected and their properties displayed in an article. Content from Wikidata can be completed with locally edited text.

Examples of use cases

edit

Magic infobox

edit

A call of the general cheese infobox template fr:Modèle:Infobox Fromage without any parameters, on an article about a type of cheese, for example fr:Reblochon, produces an infobox with details about that type of cheese, using data from the Wikidata item linked to the article.

Commons

edit

Commons creator template uses Wikidata with arbitrary access to provide information about the creators of the works.

Graph

edit

Authority model

edit

Wikisource

edit

How to find help ?

edit

You will find contributors on the Wikidata project chat which exists in different languages. Moreover, some wikis have projects dedicated to Wikidata : see Project:WikiProject Wikidata (Q20855878).


See also

edit