வார்ப்புரு:Wikidata list/doc
{{Documentation subpage}}
 &lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&gt;
 ==NOT IN MAINSPACE==
 Per [[Wikipedia:Wikidata#Lua_module]], this template (or anything similar) should NOT be used in the mainspace at the moment. 
 
 == Usage ==
 
 This template defines a bot-generated list based on Wikidata ([http://magnusmanske.de/wordpress/?p=301 original blog post]). It must be &quot;closed&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. 
 
 The query '''MUST''' include the &lt;code&gt;?item&lt;/code&gt; variable - do not rename it.
 
 Example:
  {{tlf|{{BASEPAGENAME}}
  |'''sparql'''{{=}}&lt;br/&gt;
     {{pad}}{{code|2=sparql|SELECT ?item WHERE {}}&lt;br/&gt;
     {{pad|2em}}{{code|2=sparql|?item wdt:P31 wd:Q39715 .}}&lt;br/&gt;
     {{pad|2em}}{{code|2=sparql|?item (wdt:P131)* wd:Q55 }}&lt;br/&gt;
     {{pad}}&lt;code&gt;}&lt;/code&gt;&lt;br/&gt;
  |'''columns'''{{=}}label:Article,description,p131:Place,P580,P582,p625,P18&lt;br/&gt;
  |'''section'''{{=}}131&lt;br/&gt;
  |'''min_section'''{{=}}3&lt;br/&gt;
  |'''sort'''{{=}}label&lt;br/&gt;
  |'''links'''{{=}}text&lt;br/&gt;
  |'''thumb'''{{=}}128&lt;br/&gt;
  |'''autolist'''{{=}}fallback&lt;br/&gt;
  |'''wdedit'''{{=}}yes&lt;br/&gt;
  }}
  ... (This will be overwritten by ListeriaBot) ...
  {{tl|Wikidata list end}}
 
 Parameters:
 ;sparql:A [[:mw:Wikidata query service/User Manual#Basics - Understanding SPO (Subject, Predicate, Object) also known as a Semantic Triple|SPARQL ''SELECT'' query]]. Needs to return &lt;code&gt;?item&lt;/code&gt; as the item number. '''Mandatory'''. &lt;br&gt;See [[d:Wikidata:SPARQL query service/queries/examples#Listeria|SPARQL query service examples suitable for Listeria]]
 ;columns:Defines the columns of the list table. Allowed values are :
 :* &lt;code&gt;number&lt;/code&gt;, a serial row number (per section), increasing from 1, according to the initial sorting
 :* &lt;code&gt;label&lt;/code&gt;, the wiki-language-based label of the item, linked to the local article (where exists), or the Wikidata item
 :* &lt;code&gt;label/de&lt;/code&gt;, the wiki-language-based label of the item, using the given language (here, &quot;de&quot;), as plain text
 :* &lt;code&gt;description&lt;/code&gt;, the manual, or auto-generated description
 :* &lt;code&gt;item&lt;/code&gt;, the Q item number
 :* &lt;code&gt;Pxxx&lt;/code&gt; a Wikidata property
 :* &lt;code&gt;Pxxx/Pzzz&lt;/code&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;code&gt;Pxxx/Qyyy/Pzzz&lt;/code&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., &quot;p553/q866/p554&quot; to get YouTube account names.
 :* &lt;code&gt;?fieldname&lt;/code&gt;, a SPARQL result field name.
 :Values marked as &quot;deprecated&quot; are not shown. Every column can optionally have a title generation by adding &quot;:TITLE&quot;, otherwise the Wikidata property name is used. '''Mandatory'''
 ;sort:The initial sort key for the table. Valid values are:
 :* &lt;code&gt;label&lt;/code&gt;, the label of the item
 :* &lt;code&gt;family_name&lt;/code&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;code&gt;Pxxx&lt;/code&gt;, a Wikidata property
 : ''Optional''
 ;section:The list can be sectioned by a Wikidata property. ''Optional''
 ;min_section:The minimum number of entries to generate a section when used together with &lt;code&gt;section&lt;/code&gt;. All other entries will be put under section &quot;misc&quot;. Default:2. ''Optional''
 ;autolist:If ''description'' is a column but no description exists on Wikidata, &quot;autolist=fallback&quot; uses [https://tools.wmflabs.org/autodesc/ AutoDesc] to generate one. ''Optional''
 ;language:Label/description language, if different from site language. ''Optional''
 ;thumb:The thumbnail width for images (e.g. column P18). Default:128. ''Optional''
 ;links:How to render links not in the local Wikipedia. Valid values are:
 :* &lt;code&gt;all&lt;/code&gt; to link to Wikidata. Default.
 :* &lt;code&gt;local&lt;/code&gt; to remove entries for which there exists no local article (the opposite of &lt;code&gt;red_only&lt;/code&gt;).
 :* &lt;code&gt;red&lt;/code&gt; to generate red links based on label and item.
 :* &lt;code&gt;red_only&lt;/code&gt; to remove entries for which there exists a local article (the opposite of &lt;code&gt;local&lt;/code&gt;).
 :* &lt;code&gt;text&lt;/code&gt; to generate blue links for existing pages, and plain text otherwise.
 :* &lt;code&gt;reasonator&lt;/code&gt; to generate blue links for existing pages, and links to [https://tools.wmflabs.org/reasonator/ Reasonator] otherwise.
 :''Optional''
 ;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  &lt;code&gt;skip_table&lt;/code&gt; parameter. Parameters passed to the template are the lower-case keys from the &lt;code&gt;columns&lt;/code&gt; parameter, e.g. &lt;code&gt;&lt;nowiki&gt;label&lt;/nowiki&gt;&lt;/code&gt; or &lt;code&gt;&lt;nowiki&gt;p18&lt;/nowiki&gt;&lt;/code&gt;. ''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 &lt;code&gt;row_template&lt;/code&gt;. ''Optional''
 ;skip_table:Suppresses the table markup completely when using &lt;code&gt;row_template&lt;/code&gt;. Any value will work.
 ;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 &lt;code&gt;yes&lt;/code&gt;. Does not work when &lt;code&gt;row_template&lt;/code&gt; 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 &lt;code&gt;all&lt;/code&gt;. Requires {{tl|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''
 :* &lt;code&gt;itemnumber&lt;/code&gt; The total number of items (rows) in this list.
 
 &lt;includeonly&gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 &lt;!-- Categories below this line, please; interwikis at Wikidata --&gt;
 [[Category:Wikidata templates]]