Plantía:Wikidata list/doc
Avisu
editarEsta documentación podría quedar anticuada. Equí ta la documentación actualizada.
Usu
editarEsta plantía define una llista xenerada por un bot basada en Wikidata (publicación orixinal nel blog y artículu sobre la versión 2). Tien de «zarrase» con {{Wikidata list end}}; el testu ente eses dos plantíes trocaráse periódicamente (una vegada cada 24h) pola llista xenerada pol bot. Nesti momentu, sólo ye posible tener una llista per páxina. Exemplu:
{{Wikidata list |sparql=SELECT ?item WHERE { ?item wdt:P31 wd:Q39715 . ?item wdt:P131 ?sub0 . ?sub0 (wdt:P131)* wd:Q55 } |wdq=claim[31:39715] and claim[131:(tree[55][][131])] |section=P131 |sort=label |columns=label:Article,description,p131:Place,P580,P582,p625,P18 |thumb=128 |min_section=2 }} ... {{Wikidata list end}}
Parametros
editar- sparql
- Una consulta SPARQL SELECT. Tien de devolver
?item
como númberu del elementu. Puedes usar una ferramienta de conversión pa convertir WDQ a SPARQL, pero siempre comprueba la consulta p'asegurate de que funciona y cambia "entity:" por "wd:" (phab:T119332). Obligatoriu, sacante que s'use WDQ. - wdq
- Una cadena de consulta de WikiDataQuery. Los elementos resultantes usaránse pa crear la llista. Prueba equí la salida de la consulta. Obligatoriu, sacante que s'use SPARQL.
- columns
- Define les columnes de la tabla de la llista. Los valores permitíos son:
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. 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).
- A column header is specified by adding ":Header" 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 nominal value +/- tolerance (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 "not edited" message). Mandatory
- sort
- The initial sort key for the table. Valid values are:
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.
- Optional
- section
- The list can be sectioned by a Wikidata property. Can be a property number (preferably prefixed by P),
or a(using variables does not work anymore). Optional?fieldname
- min_section
- The minimum number of entries to generate a section when used together with
section
. All other entries will be put under section "misc". Default 2. Optional - autolist
- If description is a column but no description exists on Wikidata, "autolist=fallback" uses 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 (properties with datatype item) not in the local Wikipedia. Valid values are:
all
to link to Wikidata. Default.local
to remove entries for which there exists no local article (the opposite ofred_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 oflocal
).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.
- 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
skip_table
parameter. Parameters passed to the template are the lower-case keys from thecolumns
parameter, e.g.label
orP18
. 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. Optional - wdedit
- Generates information that allows Wikidata editing from Wikipedia using this JavaScript. Value needs to be
yes
. Does not work whenrow_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. Default 1. Does not affect updates via web interface. Optional
- summary
- Comma-separated list of keys to add as a summary underneath all other content.
itemnumber
The total number of items (rows) in this list.
- Optional
- one_row_per_item
- Set to
no
if the SPARQL has multiple results for the same item, and you want them in separate list rows (since V2). Optional