Siirry sisältöön

Malline:Wikidata-lista/ohje

Wikiuutisista

13.9.2017 ListeriaBot ei näyttäisi toimivan Wikiuutisissa joten tämä ei tällä hetkellä toimi.

Käyttö

[muokkaa]

Tämä malline määrittelee botin luoman luettelon, joka perustuu Wikidatasta haetulle tiedolle (alkuperäinen blogipostaus). Se täytyy päättää mallineella {{Wikidata-listan loppu}}. Näiden kahden mallineen välissä oleva teksti päivitetään (kerran vuorokaudessa) botin tuottamalla sisällöllä. Tällä hetkellä on mahdollista sijoittaa vain yksi lista sivulle. Alla oleva ohjeistus on englanniksi, jotta sen päivittäminen ajantasaisimpaan versioon olisi mahdollisimman helppoa.

Esimerkki:

{{Wikidata-lista
|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])]
|links=red
|section=131
|autolist=fallback
|sort=label
|columns=label:Article,description,p131:Place,P580,P582,p625,P18
|thumb=128
|min_section=2
|references=all
|wdedit=
|language=
|silent =
}}
...
{{Wikidata-listan loppu}}

Parameters:

sparql
A SPARQL SELECT query. Needs to return ?item as the item number. You can use a conversion tool to convert WDQ to SPARQL, but always check your query to make sure it works. Mandatory, unless WDQ is used.
Samples at mw:Wikibase/Indexing/SPARQL_Query_Examples#Listeria
wdq
A WikiDataQuery query string. The resulting items will be used to build the list. Try your query out here. Mandatory, unless SPARQL is used.
columns
Defines the columns of the list table. Allowed values are :
  • 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
  • label/de, the wiki-language-based label of the item, using the given language (here, "de"), 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 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
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. Optional
min_section
The minimum number of entries to generate a section. All other entries will be put under "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 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 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.
Optional
row_template
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
skip_table
Suppresses the table markup completely when using row_template. Any value will work.
wdedit
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
references
Add references. Allowed value is all. Requires {{reflist}} or similar somewhere in the page. Optional
silent
ei tulosteta johdantoa taulukon alkuun