Module:WikidataIdentifiers/doc

MyWikiBiz, Author Your Legacy — Tuesday November 26, 2024
< Module:WikidataIdentifiers
Revision as of 08:00, 16 July 2021 by Zoran (talk | contribs) (Pywikibot 6.4.0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This is the documentation page for Module:WikidataIdentifiers

Template:Module rating


Functions for use in retrieving Wikidata for use in templates that deal with identifiers

  • getIdentifierQualifier returns the value of a qualifier for an Identifier

Functions

getIdentifierQualifier

This returns the value of a qualifier for an identifier such as Template:Q.

There is an assumption is that one value exists for the property, and only one qualifier exists for that value.

Constraint violations for Template:Q are at d:Wikidata:Databasereports/Constraintviolations/P1367 #Single_value

Usage

Normally use like this within a template for use in the article concerned:

  • {{#invoke:WikidataIdentifiers |getIdentifierQualifier |<property> |qual=<qualifier>}}

If used outside of the related article, an expensive version of the call is available:

  • {{#invoke:WikidataIdentifiers |getIdentifierQualifier |<property> |qual=<qualifier> |qid=<Q-value for target in Wikidata}}

Examples

Retrieving the Template:Q qualifier for the Template:Q within an article:

  • {{#invoke:WikidataIdentifiers |getIdentifierQualifier |P1367 |qual=P1114}}

Retrieving the Template:Q qualifier for the Template:Q for Template:Q outside of the article:

  • {{#invoke:WikidataIdentifiers |getIdentifierQualifier |P1367 |qual=P1114 |qid=Q5083334}}Lua error in Module:WikidataIdentifiers at line 24: attempt to index field 'wikibase' (a nil value).