Module:WikidataIdentifiers/doc
| This is a documentation subpage for Module:WikidataIdentifiers. It may contain usage information, categories and other content that is not part of the original module page. |
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
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
[edit source]getIdentifierQualifier
[edit source]This returns the value of a qualifier for an identifier such as Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1367).
There is an assumption is that one value exists for the property, and only one qualifier exists for that value.
Constraint violations for Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1367) are at d:Wikidata:Databasereports/Constraintviolations/P1367 #Single_value
Usage
[edit source]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
[edit source]Retrieving the Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1114) qualifier for the Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1367) within an article:
{{#invoke:WikidataIdentifiers |getIdentifierQualifier |P1367 |qual=P1114}}
Retrieving the Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1114) qualifier for the Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (P1367) for Lua error in Module:Wd at line 633: attempt to index field 'wikibase' (a nil value). (Q5083334) 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).