Help talk:Lua

From Wikidata
Jump to: navigation, search

How to use Wikidata country data in a Wikipedia Lua template?[edit]

Hi, I'm trying to reimplement w:Template:Flagicon on Lua just for the fun of it - see the small announcement. There is a table where images of flags in Commons are identified with the article of their territory in the project where the module is hosted: w:Module:Sandbox/QuimGil/FlagTranslations. Could Wikidata help here?

For instance at Q228 we have all the ISO codes related to "Andorra", the flag image and the translations in all Wikimedia projects. It would be amazing if this data could be leveraged. Maybe not for each template query (that could be expensive) but at least to populate and maintain those local tables automatically. The master table would be the only one maintained manually and all it would do is to state that "Andorra" = Q228, "Berlin" = Q64...

Even that master table could be highly automated one day because we do have the ISO 3166 entries etc in Wikidata... but let's go step by step.  :) --Qgil (talk) 18:42, 3 June 2013 (UTC)

Well, no, not yet, but that is planned. There is an limitation in WikibaseClient (the client extension of Wikidata), that only pulls claims from an item that is linked to that particular page. So, for example, the only page on the English Wikipedia where you can pull the ISO 3166 entries about Andorra from Wikidata is w:Andorra.--Snaevar (talk) 18:28, 4 June 2013 (UTC)
Ok, thank you! Good to know. Is there a specific bug report or wiki page to watch and follow the progress in the development of this feature?--Qgil (talk) 18:47, 4 June 2013 (UTC)
bugzilla:47930 (Sorry I wasn't sure if this also applies to Lua but it does.) --Lydia Pintscher (WMDE) (talk) 15:41, 5 June 2013 (UTC)

Item id lookup?[edit]

Is there a way to look up an item id from a language code and article title, like Special:ItemByTitle does (sample: "en" + "Arctic" => Q25322)?

I'd like to check a series of pages and see if there is an item available. --  Docu  at 15:26, 13 August 2013 (UTC)

Can you explain a bit more specifically what you are trying to do? --Lydia Pintscher (WMDE) (talk) 15:33, 13 August 2013 (UTC)

rm Wikipedia has some 4000 articles. I'd like to figure out which ones don't have items yet.
A simple way could be look them up in sets of 500, e.g. *{{#invoke:LuaItemByTitle|rm|Alfons Tuor}} => Q14565844
Maybe I'd better try to do this in python by bot? --  Docu  at 15:46, 13 August 2013 (UTC)
answers my question (seems that I created most of the remaining ones yesterday), but I'm sure that there would be another application for this feature. --  Docu  at 08:51, 14 August 2013 (UTC)

Help with Module[edit]

Hello. I need help for Module. el:Module:Περισσότερεςκατακτήσεις (is in English).

See Cypriot First Division (Q155965), property winner (P1346), qualifier number of wins (P1355). I want to show the item of P1346 if it has the largest qualifier P1355. Xaris333 (talk) 00:00, 27 November 2016 (UTC)