Plantía:Wikidata list/doc

De Wikipedia
Saltar a navegación Saltar a la gueta

Avisu[editar la fonte]

Esta documentación podría quedar anticuada. Equí ta la documentación actualizada.

Usu[editar la fonte]

Esta plantía define una llista xenerada por un bot basada en Wikidata (publicación orixinal nel blog). 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])]
{{Wikidata list end}}


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.
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.
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, la etiqueta en llinguaxe wiki del elementu, enllazada col artículu llocal (onde exista), o l'elementu de Wikidata
  • description, la descripción, manual o xenerada automáticamente
  • item, el númberu Q del elementu
  • Pxxx una propiedá de Wikidata
  • 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.
Values marked as "deprecated" are not shown. Every column can optionally have a ":Titel", otherwise the Wikidata property name is used. Mandatory
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
The list can be sectioned by a Wikidata property. Optional
The minimum number of entries to generate a section. All other entries will be put under "misc". Default:2. Optional
If description is a column but no description exists on Wikidata, "autolist=fallback" uses AutoDesc to generate one. Optional
Label/description language, if different from site language. Optional
The thumbnail width for images (e.g. column P18). Default:128. Optional
How to render links 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.
  • red to generate red links based on label and item.
  • 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.
Generates a template call rather than a table row; the template must then generate the table row in turn. Parameters passed to the template are the lower-case keys from the columns parameter, e.g. label or p18. Optional
Generates information that allows Wikidata editing from Wikipedia using this JavaScript. Value needs to be yes. Caution: This will result in larger wikitext than normal, and updates may fail because of that. Optional