Jump to content

Module:Authority control/config/doc: Difference between revisions

From Humanipedia
hp>Christian75
{{high use}}
 
m 1 revision imported
 
(No difference)

Latest revision as of 21:22, 3 February 2025

Script error: No such module "High-use". Template:Authority control/related

Contains configuation details for Module:Authority control. Authority control/config/doc

Syntax[edit source]

The syntax for the p.config table is as follows:

  • property = Wikidata property number, without the prefix P.
  • section = section number to place the identifier. See #List of sections for details.
  • pattern = Lua pattern of valid format for identifier. Note this is similar but not identical to a regular expression. If this is omitted, then the module will not check the validity of the identifiers.
  • link = the URL of the external page with details of the identifier. The code $1 will be replaced with the identifier.
  • label = the label for the link.
  • remark = a brief explanation of the authority control database, for use on the documentation of Template:Authority control only.

Example[edit source]

The syntax below generates a link to the Dictionary of Irish Biography in section 5. It gets its data from Wikidata property Template:Q and identifiers need to be in the following form: 0, followed by 0 or 1, followed by 4 digits, possibly followed by a decimal point and then a letter from A to D. <syntaxhighlight lang="Lua">{

 property = 6829,
 section = 5,
 pattern = '0[01]%d%d%d%d%.?[A-D]?',
 link = 'https://doi.org/10.3318/dib.$1.v1',
 label = 'Ireland',

},</syntaxhighlight>

Advanced parameters[edit source]

  • patterns = if more than one Lua pattern is needed, then use the plural form of this argument and include the comma-separated list of patterns enclosed by curly braces.
  • prefix = a prefix to be included before the links. In this case numbers 1, 2, ... will be used as the labels and the label field will be ignored.
  • valid = the name of a custom Lua function in /auxiliary used to determine if the identifier is valid or not, in case the pattern method cannot be used. It should return false if the identifier is invalid.
  • customlink = the name of a custom Lua function in /auxiliary which will produce the entire external link. It should return false if the identifier is invalid.
  • suppressedbyproperty = if this identifier should not be displayed if other identifiers are present, then specify them here in a comma-separated list enclosed by curley braces. Note: the property to be suppressed must be listed later in the list than the property which suppresses it.
  • category = defines a category that should be used to track uses of this property (not usually needed). For example if category = 'VIAF' then Category:Articles with VIAF identifiers and Category:Articles with faulty VIAF identifiers will be populated.

List of sections[edit source]

The names of each section are defined by the p.sectionNames function. The syntax is as follows:

[number] = {name = name of section, hidelabelwhenalone = true/false},

where

  • number is the section number (must be sequential integer).
  • name of section is the name which appears in the header column of the infobox.
  • true/false is set to true if you want the name to be suppressed when this section is the only section to be displayed. (For example, there is no point in showing "Other" if that is the only section.) The default is false.

For example, the section 7 is defined as:

[7] = {name = 'Other', hidelabelwhenalone = true}

This section has name "Other" and it will be hidden when it is the only section to be shown.

The current list of sections is shown below:

SectionDescriptionIdentifiers
1International (P213), (P214), (P2163), (P10832)
2National (P227), (P244), (P268), (P268), (P349), (P396), (P409), (P691), (P947), (P950), (P1003), (P1005), (P1006), (P1015), (P1048), (P1368), (P1375), (P1890), (P3348), (P3788), (P5034), (P5587), (P906), (P7293), (P1695), (P8034), (P8189), (P8980), (P9984), (P11249)
3Geographic (P380), (P454), (P982), (P1004), (P1584), (P1886), (P2484), (P2980), (P3223), (P3326), (P3407), (P3562), (P3563), (P3601), (P3723), (P3863), (P3920), (P3993), (P4038), (P4055), (P4143), (P4423), (P4535), (P5288), (P5818), (P9725)
4Academics (P271), (P428), (P496), (P549), (P864), (P1053), (P1153), (P1556), (P1960), (P2456), (P3233), (P3829), (P4955), (P10299)
5Artists (P245), (P434), (P650), (P781), (P1248), (P1707), (P1736), (P2041), (P2174), (P2268), (P2349), (P2750), (P3372), (P4114), (P4457), (P4581), (P5226), (P5321), (P5368), (P6792), (P6804), (P7303), (P8381), (P9692), (P10608)
6People (P651), (P791), (P865), (P1045), (P1146), (P1157), (P1186), (P1315), (P1907), (P1908), (P1986), (P2418), (P2558), (P4186), (P4534), (P6213), (P6829), (P7902), (P10020), (P11646), (P12362), (P13049)
7Other (P269), (P347), (P350), (P435), (P436), (P716), (P886), (P902), (P966), (P1225), (P1323), (P1330), (P1362), (P1407), (P3430), (P3544), (P4613), (P5302), (P5504), (P5736), (P7314), (P8671), (P9070), (P12204), (P12754)

Whitelists[edit source]

The whitelists are defined by the p.whitelists function. The syntax is as follows:

code = {topic = topic QID, properties = {property PIDs}}

where

  • code is the code of the whitelist which is called via the |show= parameter.
  • topic QID is the Wikidata QID for the topic represented by the whitelist, without the Q prefix.
  • property QIDs is a comma-separated list of PIDs for the properties included in the whitelist (without the prefix P).

For example, the whitelist for Italy is defined as:

it = {topic = 38, properties = {396, 3863, 1986, 8034}},

The whitelist has code it, represents Template:Q and includes the following properties: Template:Q, Template:Q, Template:Q, Template:Q.

The currently recognised whitelists are listed below: Lua error in Module:Authority_control/documentation at line 122: attempt to index field 'wikibase' (a nil value).

See also[edit source]