模組:Authority control/config/doc
呢版係模組:Authority control/config嘅解說版
Wikipedia:Authority control |
---|
Template |
Module |
Config |
Auxiliary |
Doc module |
Category |
Contains configuation details for Module:Authority control.
Syntax
[編輯]The syntax for the p.config
table is as follows:
- Codename for identifier, inside quotation marks.
- 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
[編輯]The syntax below generates a link to the Dictionary of Irish Biography in section 5. It gets its data from Wikidata property Dictionary of Irish Biography ID (P6829) 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.
{'DIB',
property = 6829,
section = 5,
pattern = '0[01]%d%d%d%d%.?[A-D]?',
link = 'https://doi.org/10.3318/dib.$1.v1',
label = 'Ireland',
},
Advanced parameters
[編輯]- 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.
List of sections
[編輯]The names of each section are defined by the p.sectionNames
function.
Whitelists
[編輯]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 意大利 (Q38) and includes the following properties: SBN author ID (P396), Italian Navy Lighthouses and Beacons ID (P3863), Treccani's Biographical Dictionary of Italian People ID (P1986), Vatican Library VcBA ID (P8034).
The currently recognised whitelists are listed below:
Code | Topic | Identifiers |
---|---|---|
cl | 智利 | (P1890) |
lighthouse | 燈塔 | (P3563), (P4055), (P3223), (P4423), (P3723), (P3993), (P3562), (P2980), (P4038), (P3920), (P4143), (P3863), (P3601) |
gr | 希臘 | (P3348) |
hr | 克羅地亞 | (P1375) |
ch | 瑞士 | (P902), (P886), (P3065), (P781), (P1362) |
ru | 俄羅斯 | (P947) |
cz | 捷克 | (P691) |
lv | 拉脫維亞 | (P1368) |
ro | 羅馬尼亞 | (P1003) |
ja | 日本 | (P349), (P271) |
arts | 諸藝 | 法國國家圖書館識別碼 (P268), (P214), (P7859), (P3372), (P6804), (P1907), (P4186), (P2092), (P1908), (P1707), (P6829), (P2349), (P6792), 整合規範文檔識別碼 (P227), (P1960), (P347), (P1248), (P244), (P1225), (P2041), (P409), (P2750), (P650), (P350), (P781), (P3430), (P3544), (P1315), ULAN編號 (P245), (P1986), (P7902), (P651), (P791), (P7303) |
sv | 瑞典 | (P906), (P5587) |
pl | 波蘭 | (P1695), (P7293) |
nl | 荷蘭 | (P651), (P1006), (P650), (P350) |
uy | 烏拉圭 | (P2558) |
il | 以色列 | (P8189), (P1736) |
tw | 中華民國 | (P1048) |
tr | 土耳其 | (P7314) |
kr | 大韓民國 | (P5034) |
it | 意大利 | (P396), (P3863), (P1986), (P8034) |
es | 西班牙 | (P950), (P9984) |
See also
[編輯]