跳转到内容

Template:Wikidata list/doc

维基百科,自由的百科全书

请勿用于主空间

[编辑]

本模板现时禁止在主名字空间使用。

使用

[编辑]

本模板用于定义基于维基数据自动生成的列表。模板后必须加上{{Wikidata list end}},两個模板之間的内容会由机器人自动更新。目前,每个页面仅支持一个列表。

示例:

{{Wikidata list|sparql=
 SELECT ?item WHERE {
 ?item wdt:P31 wd:Q39715 .
 ?item (wdt:P131)* wd:Q55
 }
|columns=label:Article,description,p131:Place,P580,P582,p625,P18
|section=131
|min_section=3
|sort=label
|links=text
|thumb=128
|autolist=fallback
|wdedit=yes
}}
... (This will be overwritten by ListeriaBot) ... {{Wikidata list end}}

参数:

sparql
一条SPARQL SELECT语名。需返回?item(维基数据项)。该参数为必需参数
参见适用于Listeria的SPARQL查询示例
columns
定义表格的列。允许值包括:
  • number, a serial row number (per section), increasing from 1, according to the initial sorting
  • label, the wiki-language-based label of the item, linked to the local article (where exists), or the Wikidata item
  • label/de, the wiki-language-based label of the item, using the given language (here, "de"), as plain text
  • description, the manual, or auto-generated description
  • item, the Q item number
  • Pxxx a Wikidata property
  • Pxxx/Pzzz, qualifier properties; for Pxxx linking to an item Qyyy and having a Pzzz qualifier, the Qxxx linked label and the value of Pzzz
  • Pxxx/Qyyy/Pzzz, qualifier properties; for Pxxx linking to an item Qyyy and having a Pzzz qualifier, the value of Pzzz. This is a version of the above, specific for a single item; e.g., "p553/q866/p554" to get YouTube account names.
  • ?fieldname, a SPARQL result field name. For SPARQL-based lists only.
在其后加上":TITLE"可定义每一列的标题。没有指定标题时,将使用维基数据属性的名称。该参数为必需参数
sort
用于表格元素的排序。允许值包括:
  • label, the label of the item
  • family_name, tries to find, and sort by, the family (last) name from the label, assuming items are people. This is a heuristic and may not work properly in all cases. If possible, try to sort by P734 (family name).
  • Pxxx, a Wikidata property
该参数为可选参数。
section
列表可使用一个维基数据属性来划分章节。该参数为可选参数。
min_section
使用section参数时每章节包含元素的最小值。其他元素将放入"misc"章节中。默认值:2。该参数为可选参数。
autolist
description(描述)为表格的一列而维基数据中还没有对应描述时,"autolist=fallback"使用AutoDesc生成描述。该参数为可选参数。
language
当标签/描述使用的语言与站点语言不同时可使用此参数。该参数为可选参数。
thumb
图片缩略图的宽度(对应列P18)。默认值:128。该参数为可选参数。
links
定义如何处理本地维基百科的红链。允许值包括:
  • all to link to Wikidata. Default.
  • local to remove entries for which there exists no local article (the opposite of red_only).
  • red to generate red links based on label and item.
  • red_only to remove entries for which there exists a local article (the opposite of local).
  • text to generate blue links for existing pages, and plain text otherwise.
  • reasonator to generate blue links for existing pages, and links to Reasonator otherwise.
该参数为可选参数。
row_template
Generates a template call rather than a table row; the template must then generate the table row in turn or the table header/footer need to be surpressed using skip_table parameter. Parameters passed to the template are the lower-case keys from the columns parameter, e.g. label or p18. Optional
header_template
Generates a template call rather than a table header; the template must then generate the table header. No parameters are passed to this template. Recommended to be used with row_template. Optional
skip_table
Suppresses the table markup completely when using row_template. Any value will work.
wdedit
Generates information that allows Wikidata editing from Wikipedia using this JavaScript. Value needs to be yes. Does not work when row_template is used. Caution: This will result in larger wikitext than normal, and updates may fail because of that. Optional
references
Add references. Allowed value is all. Requires {{reflist}} or similar somewhere in the page. Optional
freq
Numerical value X; wait at least X days before an automatic update. Does not affect updates via web interface. Optional
summary
Comma-separated list of keys to add as a summary underneath all other content. Optional
  • itemnumber The total number of items (rows) in this list.