• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.55
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Wikidata alignment

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here

Wikidata value used

Template documentation[view] [edit] [history] [purge]

Contents

  • 1 Usage
    • 1.1 Syntax
  • 2 Example
  • 3 See also

Usage

This 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 Matches value on Wikidata ... same as Wikidata
Local parameter is defined but there is no value on Wikidata Value missing on Wikidata ... not in Wikidata
Local parameter does not match value of Wikidata Does not match value on Wikidata ... different from Wikidata
Local parameter not defined; value on Wikidata is used Wikidata value used n/a
Local parameter is equivalent to the value on Wikidata, as defined by the |equivalent= parameter Equivalent to value on Wikidata ... equivalent to Wikidata

Syntax

{{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.

Example

Infobox with withdata alignment example.png

This 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.

See also

  • Template:WikidataCheck
The above documentation is transcluded from Template:Wikidata alignment/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Wikidata_alignment&oldid=39345"
Categories:
  • Pages with script errors
  • Wikidata templates
Last edited on 4 November 2021, at 10:10

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 4 November 2021, at 10:10.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop