Content deleted Content added
tt -> code; one kbd->code; per deprecation |
→Methods: update link |
||
Line 4:
== Methods ==
The module "{{BASEPAGENAME}}" contains the following methods, that allow the calling script to retrieve the value for any property from Wikidata by supplying the property ID as the first parameter:
* <code>getValue</code>: Returns wiki-linked values, if applicable. All other values will be output similar to <code><nowiki>{{#property:}}</nowiki></code>, except that if values with preferred rank exist, then only they are returned. Unlike <code>formatStatements</code> from [[:ru:Модуль:Wikidata]], <code>getValue</code> does not yet pick up any references (see [[Module talk:Wikidata/Archive 1#Why the references from Wikidata get dropped?]]).
* <code>getRawValue</code>: Returns non-linked property values and numbers with the thousand separator. It also returns the plain numeric value of a property which is a quantity. All other values will be output similar to <code><nowiki>{{#property:}}</nowiki></code>, including normal values, even if preferred values exist.
* <code>getDateValue</code>: Special method to return formatted dates. The default date format is [day month year]; an optional third parameter can be added for other date formats: for [month day, year], add "mdy"; for [month year], add "my"; for year only, add "y". A further optional parameter, which must be fourth, such as "BCE", may be added to override the default "BC" that is suffixed for dates BC.
|