<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AWikidata_list%2Fdoc</id>
	<title>Template:Wikidata list/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://moasspedia.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AWikidata_list%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Template:Wikidata_list/doc&amp;action=history"/>
	<updated>2026-04-13T09:08:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://moasspedia.org/w/index.php?title=Template:Wikidata_list/doc&amp;diff=39358&amp;oldid=prev</id>
		<title>Wikipedia&gt;Pppery: /* Use in mainspace */ Rewrite to reflect the current truth; it baffles me that nobody updated this section back in April 2020</title>
		<link rel="alternate" type="text/html" href="https://moasspedia.org/w/index.php?title=Template:Wikidata_list/doc&amp;diff=39358&amp;oldid=prev"/>
		<updated>2021-08-22T01:34:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Use in mainspace: &lt;/span&gt; Rewrite to reflect the current truth; it baffles me that nobody updated this section back in April 2020&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
This template defines a bot-generated list based on Wikidata ([http://magnusmanske.de/wordpress/?p=301 original blog post]). It must be &amp;quot;closed&amp;quot; with {{tl|Wikidata list end}}; the text between these two templates will be periodically (once every 24h) replaced by the bot-generated list. At this moment, only one list per page is possible. &lt;br /&gt;
&lt;br /&gt;
The query &amp;#039;&amp;#039;&amp;#039;MUST&amp;#039;&amp;#039;&amp;#039; include the &amp;lt;code&amp;gt;?item&amp;lt;/code&amp;gt; variable - do not rename it.&lt;br /&gt;
&lt;br /&gt;
It is also possible to combine usage with the Mbabel tool, for Wikipedia article drafts based on a particular Wikidata query - see [[Wikipedia:Mbabel/Collections]].&lt;br /&gt;
&lt;br /&gt;
=== Use in mainspace ===&lt;br /&gt;
There is no consensus to use this template and {{u|ListeriaBot}} to maintain lists in article space per [[Wikipedia:Bots/Noticeboard/Archive 13#Re-examination of ListeriaBot]]. Any uses of this template in mainspace will produce an error message ({{error|There is no consensus to use [[Template:Wikidata list]] in articles}}) and populate [[:Category:Pages with templates in the wrong namespace]], and will not be updated.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
 {{tlf|{{BASEPAGENAME}}&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;sparql&amp;#039;&amp;#039;&amp;#039;{{=}}&amp;lt;br/&amp;gt;&lt;br /&gt;
    {{pad}}{{code|2=sparql|SELECT ?item WHERE {}}&amp;lt;br/&amp;gt;&lt;br /&gt;
    {{pad|2em}}{{code|2=sparql|?item wdt:P31 wd:Q39715 .}}&amp;lt;br/&amp;gt;&lt;br /&gt;
    {{pad|2em}}{{code|2=sparql|?item (wdt:P131)* wd:Q55 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
    {{pad}}&amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;columns&amp;#039;&amp;#039;&amp;#039;{{=}}label:Article,description,p131:Place,P580,P582,p625,P18&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;section&amp;#039;&amp;#039;&amp;#039;{{=}}&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;min_section&amp;#039;&amp;#039;&amp;#039;{{=}}&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;sort&amp;#039;&amp;#039;&amp;#039;{{=}}label&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;links&amp;#039;&amp;#039;&amp;#039;{{=}}text&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;thumb&amp;#039;&amp;#039;&amp;#039;{{=}}128&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;autolist&amp;#039;&amp;#039;&amp;#039;{{=}}fallback&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;references&amp;#039;&amp;#039;&amp;#039;{{=}}all&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;summary&amp;#039;&amp;#039;&amp;#039;{{=}}itemnumber&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;freq&amp;#039;&amp;#039;&amp;#039;{{=}}7&amp;lt;br/&amp;gt;&lt;br /&gt;
 |&amp;#039;&amp;#039;&amp;#039;wdedit&amp;#039;&amp;#039;&amp;#039;{{=}}yes&amp;lt;br/&amp;gt;&lt;br /&gt;
 }}&lt;br /&gt;
 ... (This will be overwritten by ListeriaBot) ...&lt;br /&gt;
 {{tl|Wikidata list end}}&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
;sparql:A [[:mw:Wikidata query service/User Manual#Basics - Understanding SPO (Subject, Predicate, Object) also known as a Semantic Triple|SPARQL &amp;#039;&amp;#039;SELECT&amp;#039;&amp;#039; query]]. See [[d:Wikidata:SPARQL query service/queries/examples/advanced#Listeria|SPARQL query service examples ]] where many are suitable for Listeria. Needs to return &amp;lt;code&amp;gt;?item&amp;lt;/code&amp;gt; as the item number. Double curly brackets (for example &amp;quot;&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;quot;) should be avoided, for example by inserting a space between them (&amp;quot;&amp;lt;nowiki&amp;gt;} }&amp;lt;/nowiki&amp;gt;&amp;quot;). &amp;#039;&amp;#039;&amp;#039;Mandatory&amp;#039;&amp;#039;&amp;#039;. &amp;lt;br&amp;gt;&lt;br /&gt;
;columns:Defines the columns of the list table. Allowed values are :&lt;br /&gt;
:* &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt;, a serial row number (per section), increasing from 1, according to the initial sorting&lt;br /&gt;
:* &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;, the wiki-language-based label of the item, linked to the local article (where exists), or the Wikidata item. Labels without values for the wiki-language will show the english label as a fallback&lt;br /&gt;
:* &amp;lt;code&amp;gt;label/xx&amp;lt;/code&amp;gt;, the wiki-language-based label of the item, using the given language code (here, &amp;quot;xx&amp;quot;), as plain text. Labels without values for the requested language will show the english label as a fallback&lt;br /&gt;
:* &amp;lt;code&amp;gt;alias/xx&amp;lt;/code&amp;gt;, the wiki-language-based list of aliases for the item, using the given language code (here, &amp;quot;xx&amp;quot;), as plain text.&lt;br /&gt;
:* &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;, the manual, or auto-generated description&lt;br /&gt;
:* &amp;lt;code&amp;gt;item&amp;lt;/code&amp;gt;, the Q item number&lt;br /&gt;
:* &amp;lt;code&amp;gt;Pxxx&amp;lt;/code&amp;gt; a Wikidata property&lt;br /&gt;
:* &amp;lt;code&amp;gt;Pxxx/Pzzz&amp;lt;/code&amp;gt;, qualifier properties; for Pxxx linking to an item Qyyy and having a Pzzz qualifier, the Qxxx linked label and the value of Pzzz&lt;br /&gt;
:* &amp;lt;code&amp;gt;Pxxx/Qyyy/Pzzz&amp;lt;/code&amp;gt;, 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., &amp;quot;p553/q866/p554&amp;quot; to get YouTube account names.&lt;br /&gt;
:* &amp;lt;code&amp;gt;?fieldname&amp;lt;/code&amp;gt;, a SPARQL result field name (variable).&lt;br /&gt;
:A column header is specified by adding &amp;quot;:Header&amp;quot; suffix to the column definition, otherwise the Wikidata property (language) name is used. For quantities (numerical properties) where lower and upper bounds are indicated as &amp;#039;&amp;#039;nominal value&amp;#039;&amp;#039; +/- &amp;#039;&amp;#039;tolerance&amp;#039;&amp;#039; (for example 15 +/- 5), only the nominal value (15) is shown. Case sensitive. Since the release of May 2021 single quotes are not supported (causes the query to fail with a &amp;quot;not edited&amp;quot; message).&lt;br /&gt;
;sort:The initial sort key for the table. Valid values are:&lt;br /&gt;
:* &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;, the label of the item&lt;br /&gt;
:* &amp;lt;code&amp;gt;family_name&amp;lt;/code&amp;gt;, 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).&lt;br /&gt;
:* &amp;lt;code&amp;gt;Pxxx&amp;lt;/code&amp;gt;, a Wikidata property&lt;br /&gt;
: &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;section:The list can be sectioned by a Wikidata property. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;. Can be a property number (preferably prefixed by P), or a &amp;lt;code&amp;gt;?fieldname&amp;lt;/code&amp;gt;.&lt;br /&gt;
;min_section:The minimum number of entries to generate a section when used together with &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt;. All other entries will be put under section &amp;quot;misc&amp;quot;. Default:2. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;autolist:If &amp;#039;&amp;#039;description&amp;#039;&amp;#039; is a column but no description exists on Wikidata, &amp;quot;autolist=fallback&amp;quot; uses [https://tools.wmflabs.org/autodesc/ AutoDesc] to generate one. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;language:Label/description language, if different from site language. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;thumb:The thumbnail width for images (e.g. column P18). Default:128. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;links:How to render links (properties with datatype &amp;#039;&amp;#039;item&amp;#039;&amp;#039;) not in the local Wikipedia. Valid values are:&lt;br /&gt;
:* &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; to link to Wikidata. Default.&lt;br /&gt;
:* &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; to remove entries for which there exists no local article (the opposite of &amp;lt;code&amp;gt;red_only&amp;lt;/code&amp;gt;).&lt;br /&gt;
:* &amp;lt;code&amp;gt;red&amp;lt;/code&amp;gt; to generate red links based on label and item.&lt;br /&gt;
:* &amp;lt;code&amp;gt;red_only&amp;lt;/code&amp;gt; to remove entries for which there exists a local article (the opposite of &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt;).&lt;br /&gt;
:* &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; to generate blue links for existing pages, and plain text otherwise.&lt;br /&gt;
:* &amp;lt;code&amp;gt;reasonator&amp;lt;/code&amp;gt; to generate blue links for existing pages, and links to [https://tools.wmflabs.org/reasonator/ Reasonator] otherwise.&lt;br /&gt;
:&amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;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 suppressed using  &amp;lt;code&amp;gt;skip_table&amp;lt;/code&amp;gt; parameter. Parameters passed to the template are the lower-case keys from the &amp;lt;code&amp;gt;columns&amp;lt;/code&amp;gt; parameter, e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;label&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;p18&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;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 &amp;lt;code&amp;gt;row_template&amp;lt;/code&amp;gt;. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;skip_table:Suppresses the table markup completely when using &amp;lt;code&amp;gt;row_template&amp;lt;/code&amp;gt;. Any value will work.&lt;br /&gt;
;wdedit:Generates information that allows Wikidata editing from Wikipedia using [https://www.wikidata.org/w/index.php?title=User:Magnus_Manske/wd_edit.js this JavaScript]. Value needs to be &amp;lt;code&amp;gt;yes&amp;lt;/code&amp;gt;. Does not work when &amp;lt;code&amp;gt;row_template&amp;lt;/code&amp;gt; is used. Caution: This will result in larger wikitext than normal, and updates may fail because of that. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;references:Add references. Allowed value is &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt;. Requires {{tl|reflist}} or similar somewhere in the page. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;freq:Numerical value X; wait at least X days before an automatic update. Default 1. Does not affect updates via web interface. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
;summary:Comma-separated list of keys to add as a summary underneath all other content. &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
:* &amp;lt;code&amp;gt;itemnumber&amp;lt;/code&amp;gt; The total number of items (rows) in this list.&lt;br /&gt;
;one_row_per_item: Set to &amp;lt;code&amp;gt;no&amp;lt;/code&amp;gt; if the SPARQL has multiple results for the same item, and you want them in in separate list rows (since V2). &amp;#039;&amp;#039;Optional&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Bug reports ===&lt;br /&gt;
Report issues or propose new ideas [//github.com/magnusmanske/listeria_rs/issues on GitHub]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Wikidata list templates]]&lt;br /&gt;
[[Category:Wikidata templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wikipedia&gt;Pppery</name></author>
	</entry>
</feed>