Jump to content

Module:WikidataIB/sandbox1/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RexxS (talk | contribs) at 13:14, 13 April 2018 (add parameters). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

For documenting developments not yet in the main module.

Parameters to getValue
Name Alias Function Default
(first unnamed) 1 The property ID whose values are returned. Required.
(second unnamed) 2 A locally-supplied value that will be returned in preference to the value on Wikidata if it is not empty. empty
qid The Q-number of the entity that the property belongs to. Defaults to the associated Wikidata entry of the current page. nil
qual The property-id of a qualifier that is to be returned in parentheses after the property. Setting qual=ALL returns all qualifiers. Setting qual=DATES returns start time (P580) and end time (P582) with a date separator. none
fetchwikidata fwd List of fields to fetch values from. ALL fetches all fields. NONE explicitly fetches no fields. none
suppressfields spf List of fields which will never display none
name Name of the field: when encoding an infobox, this is the name that fetchwikidata and suppressfields will recognise. Required if fetchwikidata or suppressfields is specified (except when fetchwikidata=ALL). nil
onlysourced osd A boolean which will filter out Wikidata values that are unsourced or only sourced to Wikipedia. Values no, false and 0 are all false; anything else is true. true
df Date format: may be dmy (day before month) or mdy (month before day) or y (year alone). dmy
bc Format of the BC/BCE suffix for dates. BCE
linked A boolean that enables the link to a local page via its sitelink on Wikidata. Values no, false and 0 are all false; anything else is true. true
wdlinks wdl A boolean that enables the display of links to Wikidata when no local article exists. Values no, false and 0 are all false; anything else is true. false
unitabbr A boolean that enables unit abbreviations for common units. Values no, false and 0 are all false; anything else is true. false
maxvals Determines how many values may be returned when multiple values are available. Setting it to 1 is useful where the returned string is used within another call, e.g. image. Values 0 and empty return all values. 0 (all)
linkprefix A link prefix that is prepended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed. empty
linkpostfix A link postfix that is appended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed. empty
prefix A prefix that is prepended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed. empty
postfix A postfix that is appended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed. empty
sorted A boolean which enables sorting of the values returned. Values no, false and 0 are all false; anything else is true. false
qsorted A boolean which enables sorting of the qualifier values within each item returned. Values no, false and 0 are all false; anything else is true. false
noicon A boolean which will suppress the trailing "edit at Wikidata" pen-icon. Useful for when the returned value is to be further processed. Values no, false and 0 are all false; anything else is true. false
list The name of a template that the list of multiple values is then passed through. Examples include "hlist" and "ubl". Setting it to "prose" produces something like "1, 2, 3, and 4" none
sep Customises the string that is used to separate multiple returned values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English). ", "
qsep Customises the string that is used to separate multiple returned qualifier values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English). ", "