Module talk:Wikidata

From Wikidata
Jump to: navigation, search

Lua error in Module:Wikidata at line 135: attempt to concatenate field 'month' (a nil value).[edit]

Acoelorrhaphe (Q140088), apparently after this edit. Another example Salix (Q36050). --Succu (talk) 19:49, 5 May 2015 (UTC)

Pxxx of the item Qxxx from Pxxx of current item[edit]

Is there a option to get Pxxx of the item Qxxx from Pxxx of current item? In other words, for infoboxes in Wikipedia is possible to easily get birth_place with {{#property:P19}}, but how to get country of birth — P17 of that settlement? --XXN, 11:58, 10 January 2016 (UTC)

Consider using qualifier inside the property. See for example place of birth (P19) at Juenh Chopin (Q1268), the country where and when he was born does not exists. Otherwise you had to create dedicated Lua script for that purpose, and fill all necessary historical data for country (P17) with qualifiers start time (P580) and end time (P582) for places. Paweł Ziemian (talk) 13:07, 10 January 2016 (UTC)

Issue: getFormattedQualifiers() returns all languages for a given monolingual text qualifier[edit]

I added comment (P2315) in three languages here; on the talk page, field "Allowed values" shows all three languages (en, ru and de) where I would have expected it to display only en if my current language is en. This field is the result of this call in Module:Property documentation:

d.formatStatements{
  conjtype = '<br />',
  displayformat = 'wikidatastyle',
  entity = entity,
  lang = lang,
  property = 'P1793',   -- format as a regular expression
  showqualifiers = 'P2315'     -- comment
}

Could someone add support for some kind of "qualLang" param that could be used to select one of the languages for monolingual text qualifiers? Or is there already a scheme for that that I missed?

Thanks -- LaddΩ chat ;) 22:43, 1 February 2016 (UTC)

When I looked at the doc by VIAF, I realized we could even use similar logic to {{TranslateThis}} (ie. language fallback). I will try to implement a sane way for this but I don't promise it will happen immediately (so if another one wants to do this, just go ahead). Matěj Suchánek (talk) 13:44, 2 February 2016 (UTC)
✓ Done This behaviour is always forced now (if it's not okay, I can rewrite it). I have also made a fix for coordinates which weren't shown at all. Looks like we still need a fix for quantities with units... Matěj Suchánek (talk) 17:19, 3 February 2016 (UTC)
Formidable! Thanks a lot, it works great! -- LaddΩ chat ;) 16:06, 4 February 2016 (UTC)

new datatype mathematical expression[edit]

see here. --Molarus 12:34, 7 February 2016 (UTC)

Internal link on the same page[edit]

It can happens that a Wikidata model generates a link on the same page. It then is shown in bold, which might not be the wanted behavior. author  TomT0m / talk page 10:03, 15 July 2016 (UTC)

Example? Matěj Suchánek (talk) 12:31, 15 July 2016 (UTC)
Module talk:Wikidata?! -- Innocent bystander (talk) 07:03, 16 July 2016 (UTC)
And example where the module produces this problem? Because AFAIK this module outputs either external links, or links to entities whereas it cannot be linked from any entity. Matěj Suchánek (talk) 07:30, 16 July 2016 (UTC)
Hmm OK, this might be a frwiki Wikidata module peculiarity. I'll relocate this : on frwiki, this generate an internal link. author  TomT0m / talk page 07:33, 16 July 2016 (UTC)

Labels and descriptions in a language without fallback[edit]

If I now try Lady Toida, I get the English label (via fallback) instead of the Dutch label as there is no Dutch label. This can be useful, but I also like to have the option if a label or description in a certain language is empty. Can this option be added to the module? Thanks! Romaine (talk) 15:57, 30 December 2016 (UTC)

Done with "|fallback= - " parameter: {{#invoke:Wikidata|getLabel|entity=Q11418831|lang=nl|fallback=-}},
@Zolo: Thank you for the addition! Romaine (talk) 02:04, 4 January 2017 (UTC)
Zolo: I tested it and it seems not to work completely... My interface language is set in Dutch, the item Q11418831 only has a label in English.
  1. When I do lang=nl + fallback=- (no label) I get: Lady Toida
  2. When I do only lang=nl (Lady Toida) I get: Lady Toida
  3. When I do lang=fr + fallback=- (no label) I get: Q11418831
  4. When I do only lang=fr (Lady Toida) I get: Lady Toida
So the outcome of case one is not right.
So my conclusion is or Dutch (nl) is just a problem, or that the fallback I get is depending on the language set in the preferences, and for the language set in the preferences it does not work well.
Also I would suggest that the given output when no label/description is available in a language when no fallback is used, the output is the same as when no label or no description is available. It normally shows: no label / no description, or in Dutch: geen label / geen omschrijving.
I hope these issues can be fixed, thanks!! Romaine (talk) 02:22, 4 January 2017 (UTC)
@Romaine: Yesterday I made an update to fetching labels. Could you please check again how it works now? Matěj Suchánek (talk) 13:55, 11 February 2017 (UTC)

make use of mw.wikibase.label?[edit]

This may reduce the number of expensive function calls.--GZWDer (talk) 09:19, 10 February 2017 (UTC)

✓ Done Matěj Suchánek (talk) 21:43, 10 February 2017 (UTC)