This is the template sandbox page for Template:Wikidata alignment (diff). |
Usage
editThis template is designed for use in Infobox templates. It will compare the values of locally defined parameters with data available on Wikidata, and report back on whether they are the same or different. If the result is different it will display the Wikidata value alongside the local parameter value, for comparison.
It will also categorise articles accordingly, if desired, in the same manner as Template:WikidataCheck.
It is designed for editors rather than readers; therefore its output is hidden by default. To show the output you should add the following to your personal CSS file:
.infobox .showwd {display:inline !important;}
The following table shows the output in various circumstances:
Scenario | Output | Category |
---|---|---|
Local parameter matches value on Wikidata | ... same as Wikidata | |
Local parameter is defined but there is no value on Wikidata | ... not in Wikidata | |
Local parameter does not match value of Wikidata | ... different from Wikidata | |
Local parameter not defined; value on Wikidata is used | n/a | |
Local parameter is equivalent to the value on Wikidata, as defined by the |equivalent= parameter
|
... equivalent to Wikidata |
Syntax
edit{{Wikidata alignment|qid= |property= |local= |category= }}
The parameters are:
qid
- if a Wikidata other than that associated with the current article is used, then this should be passed, e.g.|qid=Q76833710
property
- the associated property ID on Wikidata, e.g.|property=P3920
local
- pass the value of the local parameter to the template, e.g.|local={{{opened|}}}
category
- naming scheme of the categories, if required, e.g.|category=Admiralty number
equivalent
- Scribunto ustring pattern involving the local parameter to define an equivalent value on Wikidata. See Module:String#match for more detail.- for example
|equivalent=11%d%-{{{NGA}}}
was used to say that something of the form "11n-" (where n is a digit) in front of the local value {{{NGA}}} shoul be treated as equivalent.
- for example
Example
editThis screenshot shows four fields in an infobox.
- The NGA number is defined locally but missing from Wikidata. A link to import this value via QuickStatements is provided.
- The admiralty number is not defined locally, so the Wikidata value is used by default.
- The ARLHS number stored on Wikidata is slightly different to the local value. The Wikidata value is displayed in red alongside.
- The USCG number defined locally matches the local parameter.