Module:Wikidata label/documentation

Hello, you have come here looking for the meaning of the word Module:Wikidata label/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:Wikidata label/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:Wikidata label/documentation in singular and plural. Everything you need to know about the word Module:Wikidata label/documentation you have here. The definition of the word Module:Wikidata label/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:Wikidata label/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Documentation

The module provides functions to fetch from Wikidata labels, aliases or sitelinks for specific item in specific language. Each function can be called both from Lua and from Wikitext templates. Used by {{Wikidata label}} template.

getLabel

This function returns a label translated to the desired language and linking to desired project, created based on Wikidata.

Call from template

{{#invoke:Wikidata label|getLabel |item=<''item ID''> |lang=<''language''> |link=<''link type''> |capitalization=,''capitalization style''> }}

Calls from Lua

require('Module:Wikidata label')._getLabel( item, , , )

Inputs
Name Function Default
item Wikidata item ID number in form "Q" + item number.
Also works with Wikidata properties if you use "P"+number.
(required field)
lang Language code (only needs to be provided if the language displayed is to be fixed and independent of the user’s preferences). {{int:lang}}
link link type:
wikipedia will try to link to Wikipedia (does not work for properties)
wikidata to Wikidata
commons to Commons (does not work for properties)
- means no link.
The code will first try the link of your choice, then, if it is unable to link to that, it will fallback and try linking to Wikipedia, and if that is not possible then it will link to Wikidata.
wikipedia
capitalization can be:
uc: upper case
lc: lower case
ucfirst: upper case for the first letter
lcfirst: lower case for the first letter
none: to leave it as is
none

This function returns a list of sitelinks for a single project organized by language

Call from template

{{#invoke:Wikidata label|sitelinks |item=<''item ID''> |project=<''project''> }}

Calls from Lua

require('Module:Wikidata label')._sitelinks( item, project )

Inputs
Name Function
item Wikidata item ID number in form "Q" + item number or entity class
project "wikipedia" (or "wiki"), "wikisource", "wikiquote", "wikibooks", "wikinews", "wikiversity", "wikivoyage", "wiktionary", etc.
Output
  • for sitelinks a comma separated list
  • for _sitelinks a lua table


aliases

This function returns a list of aliases for a single language

Call from template

{{#invoke:Wikidata label|aliases |item=<''item ID''> |lang=<''language''> }}

Calls from Lua

require('Module:Wikidata label')._aliases( item, lang )

Inputs
Name Function
item Wikidata item ID number in form "Q" + item number or entity class
lang Language code
Output
  • for aliases a comma separated list
  • for _aliases a lua table