This list is automatically generated from data in Wikidata and is periodically updated by Listeriabot.
Edits made within the list area will be removed on the next update!
This template is used on approximately 3,900 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Preview message: Transclusion count updated automatically (see documentation). |
This template defines a bot-generated list based on Wikidata (original blog post). It must be "closed" with {{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 ?item
variable - do not rename it.
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.
There is no consensus to use this template and 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 (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.
The following example shows only entries where
"instance of" (P31) has the value of "lighthouse" (Q39715)
and
"located in the administrative territorial entity" (P131) can be anything as long as its part of the "Netherlands" (Q55)
and in the information it retrieves one should be call "Place" rather than its default value "located in the administrative territorial entity" (P131)
{{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=
|min_section=
|sort=label
|links=text
|thumb=128
|autolist=fallback
|references=all
|summary=itemnumber
|freq=7
|wdedit=yes
}} ... (This will be overwritten by ListeriaBot) ... {{Wikidata list end}}
?item
as the item number. Double curly brackets (for example "}}") should be avoided, for example by inserting a space between them ("} }"). Mandatorynumber
, 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. Labels without values for the wiki-language will show the english label as a fallback.label/xx
, the wiki-language-based label of the item, using the given language code (here, "xx"), as plain text. Labels without values for the requested language will show the english label as a fallback.alias/xx
, the wiki-language-based list of aliases for the item, using the given language code (here, "xx"), 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 Qyyy 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 (variable).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.?fieldname
section
. All other entries will be put under section "misc". Default 2. Optionalall
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.skip_table
parameter. Parameters passed to the template are the lower-case keys from the columns
parameter, e.g. label
or P18
. Optionalrow_template
. Optionalrow_template
. Any value will work. Optionalyes
. Does not work when row_template
is used. Caution: This will result in larger wikitext than normal, and updates may fail because of that. Optionalall
. Requires {{reflist}} or similar somewhere in the page. Optionalitemnumber
The total number of items (rows) in this list.no
if the SPARQL has multiple results for the same item, and you want them in separate list rows (since V2). OptionalReport issues or propose new ideas on GitHub