Module talk:WikidataIB/Archive 6

Retrieving nth value using #invoke:WikidataIB

 * Also posted at data:Wikidata:Project_chat

Is it possibly to retrieve an nth value from wikidata within a property. E.g. for a person to retrieve the first listed occupation separately to the second, the third etc? Example: returns me the whole list of employers when I use it here, or just the first one if I use it over at wikidata's talkpages. T.Shafee(Evo &#38; Evo)talk 02:05, 21 September 2019 (UTC)
 * Using the split function from Module:String2:
 * and so on. --RexxS (talk) 19:05, 21 September 2019 (UTC)
 * Thank you - very logical now that I see it! One limitation though: For properties where not all values have an entry (e.g. of the example above), is there a way to ask invoke:WikidataIB to include an empty string for the missing value? In the example above, |idx=3 should return an "" empty string but idx=4 should return "June 2013". Could a fulllist parameter be included to avoid removing repeat separators? T.Shafee(Evo &#38; Evo)talk 23:57, 22 September 2019 (UTC)
 * I'm not too certain what you're trying to achieve, so it's quite hard to guess at what code would be best. Can I suggest you have a look at what getValue can do with its qualifiers and see if that gives you a solution before I start re-coding, please? It can duplicate the functionality of getQualifierValue and quite a lot more now. Here are some examples using :
 * I've recently updated the documentation, so it might pay to check what's possible using different pre/post-fixes and separators. Cheers --RexxS (talk) 01:37, 23 September 2019 (UTC)
 * Apologies, I'll give a bit more detail. In this instance, I'm trying to automatically generate rows of a table such as this one, where each row details the a values of a property. In this case, for each instance of occupation = "Wikimedian in Residence", return organisation, location, start, and end dates. This all works fine when a person has only ever held a single WiR position, but if a person has held multiple WiR positions, only some of which have end dates, you end up with the end date column shifting upwards where empty cells should be (example). Eventually I'll template it so that generating rows only requires the QIDs. 05:35, 23 September 2019 (UTC)
 * Because most of the folks who use WikidataIB are template coders, rather than Lua coders, I've created some wrapper templates like Template:Stringsplit and Template:Wdib to condense the calls to modules such as String2 and WikidataIB. Using those can make your template more readable - just use  to replace   and   in place of  . You ought to consider using getValue instead of getQualifierValue.
 * I also created some helper templates like Template:If then show to do common tasks for template coders. That template tests whether a parameter is empty and displays it if it is, or returns another parameter if it isn't. That allows us to call Wikidata once and then test and display the result, or give something else if the result is blank, So we could provide a non-breaking space if the call was empty, thus creating an blank cell in the table for you.
 * Having said all of that, it doesn't offer a solution for your problem. What you need is a non-empty value to pad out the returned list of qualifers, so that each list is the same length. The snag is that it can only work if we know how many items you want to be in the list. I'll have a look at how I can insert a non-empty value every time the qualifier has no value and let you know when I've coded it. --RexxS (talk) 16:43, 23 September 2019 (UTC)
 * I'm not too certain what you're trying to achieve, so it's quite hard to guess at what code would be best. Can I suggest you have a look at what getValue can do with its qualifiers and see if that gives you a solution before I start re-coding, please? It can duplicate the functionality of getQualifierValue and quite a lot more now. Here are some examples using :
 * I've recently updated the documentation, so it might pay to check what's possible using different pre/post-fixes and separators. Cheers --RexxS (talk) 01:37, 23 September 2019 (UTC)
 * Apologies, I'll give a bit more detail. In this instance, I'm trying to automatically generate rows of a table such as this one, where each row details the a values of a property. In this case, for each instance of occupation = "Wikimedian in Residence", return organisation, location, start, and end dates. This all works fine when a person has only ever held a single WiR position, but if a person has held multiple WiR positions, only some of which have end dates, you end up with the end date column shifting upwards where empty cells should be (example). Eventually I'll template it so that generating rows only requires the QIDs. 05:35, 23 September 2019 (UTC)
 * Because most of the folks who use WikidataIB are template coders, rather than Lua coders, I've created some wrapper templates like Template:Stringsplit and Template:Wdib to condense the calls to modules such as String2 and WikidataIB. Using those can make your template more readable - just use  to replace   and   in place of  . You ought to consider using getValue instead of getQualifierValue.
 * I also created some helper templates like Template:If then show to do common tasks for template coders. That template tests whether a parameter is empty and displays it if it is, or returns another parameter if it isn't. That allows us to call Wikidata once and then test and display the result, or give something else if the result is blank, So we could provide a non-breaking space if the call was empty, thus creating an blank cell in the table for you.
 * Having said all of that, it doesn't offer a solution for your problem. What you need is a non-empty value to pad out the returned list of qualifers, so that each list is the same length. The snag is that it can only work if we know how many items you want to be in the list. I'll have a look at how I can insert a non-empty value every time the qualifier has no value and let you know when I've coded it. --RexxS (talk) 16:43, 23 September 2019 (UTC)
 * I've recently updated the documentation, so it might pay to check what's possible using different pre/post-fixes and separators. Cheers --RexxS (talk) 01:37, 23 September 2019 (UTC)
 * Apologies, I'll give a bit more detail. In this instance, I'm trying to automatically generate rows of a table such as this one, where each row details the a values of a property. In this case, for each instance of occupation = "Wikimedian in Residence", return organisation, location, start, and end dates. This all works fine when a person has only ever held a single WiR position, but if a person has held multiple WiR positions, only some of which have end dates, you end up with the end date column shifting upwards where empty cells should be (example). Eventually I'll template it so that generating rows only requires the QIDs. 05:35, 23 September 2019 (UTC)
 * Because most of the folks who use WikidataIB are template coders, rather than Lua coders, I've created some wrapper templates like Template:Stringsplit and Template:Wdib to condense the calls to modules such as String2 and WikidataIB. Using those can make your template more readable - just use  to replace   and   in place of  . You ought to consider using getValue instead of getQualifierValue.
 * I also created some helper templates like Template:If then show to do common tasks for template coders. That template tests whether a parameter is empty and displays it if it is, or returns another parameter if it isn't. That allows us to call Wikidata once and then test and display the result, or give something else if the result is blank, So we could provide a non-breaking space if the call was empty, thus creating an blank cell in the table for you.
 * Having said all of that, it doesn't offer a solution for your problem. What you need is a non-empty value to pad out the returned list of qualifers, so that each list is the same length. The snag is that it can only work if we know how many items you want to be in the list. I'll have a look at how I can insert a non-empty value every time the qualifier has no value and let you know when I've coded it. --RexxS (talk) 16:43, 23 September 2019 (UTC)
 * I've recently updated the documentation, so it might pay to check what's possible using different pre/post-fixes and separators. Cheers --RexxS (talk) 01:37, 23 September 2019 (UTC)
 * Apologies, I'll give a bit more detail. In this instance, I'm trying to automatically generate rows of a table such as this one, where each row details the a values of a property. In this case, for each instance of occupation = "Wikimedian in Residence", return organisation, location, start, and end dates. This all works fine when a person has only ever held a single WiR position, but if a person has held multiple WiR positions, only some of which have end dates, you end up with the end date column shifting upwards where empty cells should be (example). Eventually I'll template it so that generating rows only requires the QIDs. 05:35, 23 September 2019 (UTC)
 * Because most of the folks who use WikidataIB are template coders, rather than Lua coders, I've created some wrapper templates like Template:Stringsplit and Template:Wdib to condense the calls to modules such as String2 and WikidataIB. Using those can make your template more readable - just use  to replace   and   in place of  . You ought to consider using getValue instead of getQualifierValue.
 * I also created some helper templates like Template:If then show to do common tasks for template coders. That template tests whether a parameter is empty and displays it if it is, or returns another parameter if it isn't. That allows us to call Wikidata once and then test and display the result, or give something else if the result is blank, So we could provide a non-breaking space if the call was empty, thus creating an blank cell in the table for you.
 * Having said all of that, it doesn't offer a solution for your problem. What you need is a non-empty value to pad out the returned list of qualifers, so that each list is the same length. The snag is that it can only work if we know how many items you want to be in the list. I'll have a look at how I can insert a non-empty value every time the qualifier has no value and let you know when I've coded it. --RexxS (talk) 16:43, 23 September 2019 (UTC)

Function qualsToTable
How does that look? It's only an early draft and needs internationalisation and a parameter for the placeholder (currently hard-coded as "-" so I can see what's happening), but you could play around with it for now and let me know what changes you want. --RexxS (talk) 22:31, 23 September 2019 (UTC)
 * You're a champion, thank you. And it looks like it should be possible to merge into the current template I've been working on . Thanks again. It looks like that should work perfectly! Some additional features that would improve functionality:
 * Having ymd dates (2019-08-30) would make the date columns sortable (and probably useful for other applications).
 * Being able to include the qid and edit icon as the row's first item would be valuable (see ). Perhaps a parameter to omit the and  tags to allow it be used in the middle of a row?
 * In case some of the urls are extremely long, it might be useful to be able to place the links inside custom text, but that might be over-specialised for the module.
 * T.Shafee(Evo &#38; Evo)talk 00:54, 24 September 2019 (UTC)
 * I've implemented date sorting using Template:Date table sorting inside the module. Using ISO-style dates in article text is generally not recommended (see MOS:DATEUNIFY). I know how to add a first column and have an idea for shortening the displayed urls. I'll do that later this evening. --RexxS (talk) 17:15, 24 September 2019 (UTC)
 * Done. See if you can find any problems and let me know. Cheers --RexxS (talk) 21:47, 24 September 2019 (UTC)
 * Postscript: I also implemented a parameter emptycell so you can choose what to have in the empty cells. It defaults to, but you can set - for a short dash. etc. --RexxS (talk) 21:59, 24 September 2019 (UTC)
 * Thank you again - I'll leave a link here once I've got the system up and running at outreach.wikimedia.org. T.Shafee(Evo &#38; Evo)talk 23:41, 24 September 2019 (UTC)
 * I just spotted your suggestion about removing . It can't work because the module outputs multiple rows and won't fit in a table in any other way. If you should need more than one extra column at the start of a row, you can just use something like . That would give two extra columns and could be extended as long as you only want a fixed value in each column. --RexxS (talk) 00:56, 25 September 2019 (UTC)
 * That makes sense. The firstcol works well for any of the use cases I can think of. Let me know when the functionality has been moved from the /sandbox into the main template. I'm asking or it to be imported over to outreachwiki here. T.Shafee(Evo &#38; Evo)talk 02:00, 25 September 2019 (UTC)
 * Going well so far. A couple of urls shorten oddly though (e.g. ). Any ideas? T.Shafee(Evo &#38; Evo)talk 11:49, 29 September 2019 (UTC)
 * Its quite hard to cleanly shorten https://he.wikipedia.org/wiki/%D7%95%D7%99%D7%A7%D7%99%D7%A4%D7%93%D7%99%D7%94:%D7%9E%D7%99%D7%96%D7%9E%D7%99_%D7%95%D7%99%D7%A7%D7%99%D7%A4%D7%93%D7%99%D7%94/%D7%92%D7%9C%D7%90%D7%9D/%D7%A1%D7%A4%D7%A8%D7%99%D7%99%D7%AA_%D7%99%D7%95%D7%A0%D7%A1_%D7%95%D7%A1%D7%95%D7%A8%D7%90%D7%99%D7%94_%D7%A0%D7%96%D7%A8%D7%99%D7%90%D7%9F,_%D7%90%D7%95%D7%A0%D7%99%D7%91%D7%A8%D7%A1%D7%99%D7%98%D7%AA_%D7%97%D7%99%D7%A4%D7%94
 * In Module:WikidataIB/sandbox, I've tried decoding the url before capturing the final word, so we would get:
 * In Module:WikidataIB/sandbox, I've tried decoding the url before capturing the final word, so we would get:


 * }
 * Would you have a chance to try out the sandbox for now, please? as I don't want to keep making minor alterations to the main module. As soon as you're happy, I'll update the main module, but let's dig out the bugs using the sandbox first. I suspect that there will be other occasions where we will need to use unicode string matching. --RexxS (talk) 18:47, 29 September 2019 (UTC)

Ok, I think I've finished with inputting all the relevant info to wikidata. See the table as it currently stands. The only thing that really to be edited in the module sandbx before merging into the main module and importing over to meta: is there any way to avoid the error message when the end date is 'unknown'. A question mark or similar would be better if possible. Finally, is there any way to avoid having to manually list the QID for each wikimedian in residence individually, and instead just list all Q for which P106==Q3809586? T.Shafee(Evo &#38; Evo)talk 08:22, 27 October 2019 (UTC)
 * I've fixed the error message when the date is unknown and used "?" for the value. It's easy to change, just let me know.
 * The only practical way to create a list of items from Wikidata that match a given criterion is to use a bot which interrogates the Wikidata Query Service and creates the list. One such bot is User:ListeriaBot, but unfortunately the output it creates doesn't suit the Luddites because if they alter it, it gets changed back the next time the bot is run. So the bot has been banned from from being used in mainspace. You'll have to do it manually, although you could use https://w.wiki/Asg to generate the list of WiRs for you whenever you need them. You could also use Listeriabot with that query to generate the list in your userspace, where it is not banned.
 * Let me know when you're ready to update the main module. Cheers --RexxS (talk) 18:23, 27 October 2019 (UTC)
 * Excellent. In that case, I think it is now ready to merge the sandbox into the main module so that it can also be imported over to meta and outreachwiki. I see what you mean about ListeriaBot. For the moment I'll see how the solution works with the table as currently set up. T.Shafee(Evo &#38; Evo)talk 23:44, 27 October 2019 (UTC)
 * The main template is now synced with the sandbox. It's ready to go wherever you want. Cheers --RexxS (talk) 01:32, 28 October 2019 (UTC)
 * The main template is now synced with the sandbox. It's ready to go wherever you want. Cheers --RexxS (talk) 01:32, 28 October 2019 (UTC)

Last steps over at meta
Hi! The copy over at meta is so close to operational (see example meta:Wikimedian_in_residence) The only thing that doesn't seem to be operating is the date display, but no error message is being shown. Any guesses for what template/module is missing? T.Shafee(Evo &#38; Evo)talk 10:30, 28 November 2019 (UTC)
 * the problem is that Meta has the Module:Complex date, but none of its dependencies. Have a look at Module:WikidataIB, lines 15 to 17, for a list of its eight dependencies. You'll have to arrange to have those imported from Commons, as well as re-importing the Commons version of Module:Complex date. The complication is that the English Wikipedia already had a Module:Date, so the modules here have been altered slightly to use a differently named module for Module:Date. --RexxS (talk) 17:23, 28 November 2019 (UTC)
 * the problem is that Meta has the Module:Complex date, but none of its dependencies. Have a look at Module:WikidataIB, lines 15 to 17, for a list of its eight dependencies. You'll have to arrange to have those imported from Commons, as well as re-importing the Commons version of Module:Complex date. The complication is that the English Wikipedia already had a Module:Date, so the modules here have been altered slightly to use a differently named module for Module:Date. --RexxS (talk) 17:23, 28 November 2019 (UTC)

Remove pen icon from every row in infoboxes
I find the pen icon to edit individual rows of infoboxes quite distracting and unsightly. See for example Arecibo Observatory.

Would it be possible to remove it? I think keeping [edit on Wikidata] option would be enough. Vpab15 (talk) 23:46, 18 December 2019 (UTC)
 * There is a "noicon" option for the module. Infobox telescope doesn't seem to implement it, but look at Infobox video game for an example. -- ferret (talk) 00:05, 19 December 2019 (UTC)
 * I personally don't find the pen icon distracting and unsightly, but personal tastes differ. If the pen icon is disabled, other editors with different preferences may ask for it to be restored, so that doesn't bode well for finding a consensus on whether it should appear or not.
 * It has the functionality of allowing editors who spot a mistake or vandalism to go directly to the place on Wikidata where they need to make the correction, so that in itself must be a argument to retain the links. In addition, under current plans, when Wikidata Bridge is implemented, the pen icon will be needed to pop-up the proposed editing interface to directly edit Wikidata from within a Wikipedia article.
 * Nevertheless, I could add a class to the icon, for example, which would then allow you to add a line to your common.css file:
 * .penicon { display: none; }
 * The line would ensure that you never see the pen icons, although other readers would be unaffected. Would that represent an acceptable solution for you? --RexxS (talk) 02:55, 19 December 2019 (UTC)
 * The line would ensure that you never see the pen icons, although other readers would be unaffected. Would that represent an acceptable solution for you? --RexxS (talk) 02:55, 19 December 2019 (UTC)


 * Thanks, . I agree it is a matter of taste, but the average Wikipedia reader would probably find it more puzzling and distracting than useful. I can live with it as it is now, although I appreciate the offer, RexxS. It is more a question of whether it is a better user experience to have the pen icons or to just have the "edit on Wikidata" link. Vpab15 (talk) 15:58, 19 December 2019 (UTC)

Output of currency values
Hi. Following-up on a previous discussion we had here some time back. Looking at an article like Ace Embilipitiya Power Station, can we craft a way to change the output of the "Construction cost" parameter (which currently displays as ), so that it displays as   instead (including links)? Reh man  13:08, 18 February 2020 (UTC)

To get the biggest value / value corresponding to latest 'point in time'
What is the best way to get the biggest value or the value corresponding to latest 'point in time'? I have tried this code. It list all the values. But I want to get only the value which is either the biggest or the value corresponding to the latest 'point in time'.- ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 21:32, 7 April 2020 (UTC)
 * The module does not have the functionality to select biggest or smallest from multiple values. Normally, I would recommend sorting the values and then using Module:String2's stringsplit function to select whichever value you want (see the documentation), but that requires you to use a unique separator for the values and you haven't given me an example. Are you working with values that are numeric, text, date?
 * Nor does the module have the functionality to filter the results on a date qualifier being latest/earliest. The only simple way to get the latest value is to make it the only preferred rank on Wikidata, and use the best parameter in getValue. Sorry. --RexxS (talk) 22:17, 7 April 2020 (UTC)
 * Thank you for the reply. I was working on to get the numeric value which corresponds to latest 'point in time'. Since the data changes every data, I want to make the edit only in Wikidata so that the change will be reflected in Wikipedia. I have added the case on my sandbox over here. I just required the value with the date at the bottom.- ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 22:28, 7 April 2020 (UTC)
 * Well if you have a new value added every day, and you think it will always be the last in the list, you could cheat and use something like
 * to get a list of values with a custom separator ("--") in this case from the just as an example as I don't know where you're using it. Then you split off the last one:
 * You don't need the qid= for the page you're working on; just leave it out. Hope that helps. --RexxS (talk) 23:30, 7 April 2020 (UTC)
 * It worked. Thank you. I have added it to an English article, 2020 coronavirus pandemic in Kerala here. IS it possible to remove the dates if required.? - ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 05:34, 8 April 2020 (UTC)
 * Yes, just leave off the P858 and you just get the number:
 * You can drop the dateformat as well, of course, if you have no dates. --RexxS (talk) 17:04, 8 April 2020 (UTC)
 * Yes, just leave off the P858 and you just get the number:
 * You can drop the dateformat as well, of course, if you have no dates. --RexxS (talk) 17:04, 8 April 2020 (UTC)
 * You can drop the dateformat as well, of course, if you have no dates. --RexxS (talk) 17:04, 8 April 2020 (UTC)
 * You can drop the dateformat as well, of course, if you have no dates. --RexxS (talk) 17:04, 8 April 2020 (UTC)

Optionality of Wikidata
Hello everyone. I've recently begun using a local MediaWiki instance to prepare articles for Wikipedia and for an authentic experience exported several templates to use them there. Some of them transclude this Module. Since this local instance has no connection to Wikidata, access to, which is nil, fails and results in errors. I added a check (see the sandbox) to make sure the variable exists before it used. This will have a low impact on Wikipedia but a higher one for local wikis of other users, so I leave the inclusion of this fix up to you. Regards, IceWelder  &#91; &#9993; &#93; 14:05, 13 April 2020 (UTC)
 * Thanks for spotting that and for the accurate fix. I've updated to main module to include it. Cheers --RexxS (talk) 17:27, 14 April 2020 (UTC)
 * Thanks for spotting that and for the accurate fix. I've updated to main module to include it. Cheers --RexxS (talk) 17:27, 14 April 2020 (UTC)

Bug?
Hello. is a value in, on. But: Is this a bug, or am I doing something wrong? Reh man  14:54, 28 March 2020 (UTC)
 * Sorry I'm a bit late. The getLang function simply gets the language of the current wiki, not a value from Wikidata:
 * I don't recall writing a function that returns the language that a value is in, although I think we were doing something that passed a language code when we were working on PSunits, but my memory is poor.
 * There is a function called getValueByLang which gets the value of a property which has a qualifier P407 ("language of work or name") whose value has a given language code.
 * There is a function called getValueByQual which gets the value of a property which has a qualifier with a given entity value, so it could get a value which has a equal to
 * But it's hard to know what to recommend without seeing what you're trying to do. Cheers --RexxS (talk) 22:53, 7 April 2020 (UTC)
 * There is a function called getValueByQual which gets the value of a property which has a qualifier with a given entity value, so it could get a value which has a equal to
 * But it's hard to know what to recommend without seeing what you're trying to do. Cheers --RexxS (talk) 22:53, 7 April 2020 (UTC)


 * Thank you, RexxS. I'm trying to work my way though cleaning up Infobox mountain and making it Wikidata compatible. Is there a better way to add wd support for the  parameter?  Reh  man  05:13, 14 April 2020 (UTC)
 * is monolingual text, I am not sure works properly for monolingual text beyond the current wiki's language. What are you trying to do? One thing I notice is that  seems to be for names of people not mountains. Shouldn't you be using ?
 * You might be able to use with multilanguage as I demonstrate above where I pull the  claim from . I am not sure how to get the actual language code with either module though and for an article one probably does not want to use such text without properly marking it in its language, e.g., Japanese on English Wikipedia should always be marked with the proper HTML attribute via something like . Uzume (talk) 06:27, 16 April 2020 (UTC)
 * Thank you. I will look into this suggestion, and comment again. Cheers, Reh  man  07:12, 16 April 2020 (UTC)
 * You might be able to use with multilanguage as I demonstrate above where I pull the  claim from . I am not sure how to get the actual language code with either module though and for an article one probably does not want to use such text without properly marking it in its language, e.g., Japanese on English Wikipedia should always be marked with the proper HTML attribute via something like . Uzume (talk) 06:27, 16 April 2020 (UTC)
 * Thank you. I will look into this suggestion, and comment again. Cheers, Reh  man  07:12, 16 April 2020 (UTC)
 * Thank you. I will look into this suggestion, and comment again. Cheers, Reh  man  07:12, 16 April 2020 (UTC)

Line breaking for long URLs
Hello. What is the best way to go about in stopping infobox-widening caused by long URLs on Wikidata? For example Warradarge Wind Farm. Reh man  15:55, 4 March 2020 (UTC)
 * If you specify the URL locally, you'll have the same issue. However, if you wrap the URL in Url, it wraps (Which is the templates purpose, or at least one of them). Possibly could borrow something from the Url template for WikidataIB. -- ferret (talk) 19:52, 4 March 2020 (UTC)
 * Yes, it makes sense to fix it here, rather than implement a manual fix on each infobox that uses it... Reh  man  09:00, 24 March 2020 (UTC)
 * User:Ferret, after a bit of searching, I realised WikidataIB already has a feature that (seems) to do this. Module:WikidataIB. It seems to work alright so far. I wonder, though, why the function requires the code to be nested, rather than be a part of the same call. Anyway, it works, and I'm happy with that! Happy editing, Reh  man  14:15, 28 March 2020 (UTC)

Unfortunately, this does not seem to work as expected. Can someone have a look at Watts Bar Nuclear Plant and see what is causing that output? Reh man  05:05, 14 April 2020 (UTC)
 * ✅: The IB website parameter is supposed to be a bare URL not an wikimarkup external link. I updated the claims on  and then removed the URLs from the IB and EL causing them to pull the values from WD. Uzume (talk) 05:27, 16 April 2020 (UTC)
 * Thanks Uzume. But why isn't it working properly with local values? I've temporarily reversed your goodfaith edit on Watts Bar Nuclear Plant. As you can see there, the local usage is not displaying as expected... Reh  man  07:09, 16 April 2020 (UTC)
 * It works fine for local values but local values are supposed to be URLs and not general wikitext markup (Watts Bar Nuclear Plant was providing Watts Bar Nuclear Plant) because since 947790029 Infobox power station is formatting both the local parameter argument website and as URLs by pushing them through . You need to either rethink URL formatting for local values on the template or change all the calls to the template to adhere to a URL. I attempted the same thing recently on another IB sandbox (see 951238581) and decided to not use that in the live IB because such local values might come from the likes of Official URL (which also has an EditAtWikidata icon), etc. Uzume (talk) 13:21, 16 April 2020 (UTC)
 * BTW, if you are working on IBs like Infobox power station you should consider which Wikidata access mechanisms you are using, e.g, is unmaintained and deprecated and should be replaced with something else like  (of course such changes need ot be tested). Some of these changes are straightforward and easy, e.g., Special:Diff/947793208/951305116 but some functions are harder, e.g.,  and  are not implemented in . Uzume (talk) 14:12, 16 April 2020 (UTC)


 * Fixed by User:WOSlinker. Thank you! Reh  man  02:39, 18 April 2020 (UTC)

Create Graphs and tables from Wikidata Values
Hi, I know Module:WikidataIB is intended to be used only inside the Infobox of an article. Is there any modules available so that we can construct graph and create tables using the data from Wikidata.- ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 12:14, 24 April 2020 (UTC)
 * It depends on what you want to do.
 * Modules are good at extracting data from single entries, so it would be realistic, for example, to pull the figures for from :
 * It wouldn't be difficult to use those figures to create a chart.
 * Modules are very poor when you want to scan across multiple entries to extract a value from each one. That's usually done via the Wikidata Query Service (WDQS). This query is an example of cities with a population greater than 12 million. Unfortunately there's presently no way to use those results directly in Wikipedia pages. You'd have to use an external charting tool and embed the result in a Wikipedia page. --RexxS (talk) 17:48, 24 April 2020 (UTC)
 * Thank you for providing the information. It was just for a confirmation about the usage of the above mentioned template outside that of Infobox. I have created a model table using the template you have mentioned at here to display daily updates of 14 items. So that the data changes according to the changes in Wikidata.- ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 19:16, 24 April 2020 (UTC)
 * Thank you for providing the information. It was just for a confirmation about the usage of the above mentioned template outside that of Infobox. I have created a model table using the template you have mentioned at here to display daily updates of 14 items. So that the data changes according to the changes in Wikidata.- ❙❚❚ ❙❙ JinOy ❚❙❚ ❙❙ ✉ 19:16, 24 April 2020 (UTC)

Label
I am confused by something. lets one obtain a WD label but it requires a QID and will not fetch a label based on the QID linked to the current page. does something similar (and calls the same internal function to get the heavy lifting accomplished) but I can apparently call it without a QID and  gets passed into the internal function and the   API then fetches the label for the QID linked to the current page just fine, however, this module's invocation frame function was passing back to the wikitext invocation everything the internal function returned and the internal function returns two values: the label and   or the QID and. I fail to see how that is very useful. Is anyone actually using this? The wikitext template code would have to parse off the trailing boolean value somehow (since Scribunto just converts all the returned values and concatenates them together before handing it back to Mediawiki). What is the best way to obtain the label for the current page with this module and is there a way to do this without getting the QID back as a fallback or somehow otherwise testing if the label exists (having a QID fallback makes testing for label existence painful)? I added another set of parenthesis to  so it chops off the boolean (the comment about the return value mentions nothing about returning the boolean so I assume this is a bug) returned by the internal function; see: 953800705. Example:  yields "" where as   was yielding "Douglas Adamstrue" and now yields "". Let me know if this was the wrong to do or if someone screams loudly. Thank you, —Uzume (talk) 03:28, 29 April 2020 (UTC)
 * Thanks for updating to the latest API calls. The original code here predates the regularisation of the mw.wikibase calls, so needed that.
 * The  call is intended for use where a template passes a qid of another page to it, probably using   or   (the output of which could be an empty string). So if that qid is empty, the template doesn't want a fallback to the current page, it just wants to know that nothing was passed. That gets used when dealing with categories, for example. I didn't anticipate that anybody would want to use the label for the current page, as the sitelink is much more difficult to vandalise, and BASEPAGENAME is usually all that's needed.
 * As it says in the annotation, "labelorid is a public function to expose the output of labelOrId". I only created it to debug all of the output of the local  function so that I could see what was going on without going to the trouble of opening up a debugging console. I never use it now, as I've got used to using examine to have a look inside the Wikidata from any edit window. Nobody is going to scream about changing it return just the label.
 * I've just added a new function  to get the label or nothing for you:
 * Pasting and previewing the last one in Douglas Adams gives Douglas Adams
 * I don't know a page where's there's no English label off the top of my head, so I'll leave it to you to test that it returns nil if you give it a qid of a Wikibase entity that has no English label. Let me know if you get any problems. --RexxS (talk) 15:11, 29 April 2020 (UTC)
 * Okay, thanks for the new invoke API . Perhaps we can remove as I doubt anyone was using it since it was broken.
 * There are plenty of QIDs that have no English labels, e.g..
 * Notice it does yields the empty string and not its QID as you intended. The following code you wrote seems questionable:
 * I believe always returns a QID or nothing (resulting in ) so testing for empty string again will always fail. I fixed that, added the new function to the comment documented API at the bottom of the module and added documentation. —Uzume (talk) 18:40, 29 April 2020 (UTC)
 * thanks for spotting that and for the fix. I'm in the habit to normalising 'string variables' to "" instead of nil (as I always do for parameters passed via frame), and I neglected to add  after the getEntityIdForCurrentPage. But testing for nil is just as good in this case. I tend to use "", rather than allow variables that are expected to be strings to be nil, because sometimes when the code gets modified, string handling functions get used and they almost always throw an error when called with a nil argument. Whereas I prefer to see them fail gracefully for most purposes. It sometimes makes debugging a bit harder, but generally leads to fewer complaints in the long run. Cheers --RexxS (talk) 19:27, 29 April 2020 (UTC)
 * Notice it does yields the empty string and not its QID as you intended. The following code you wrote seems questionable:
 * I believe always returns a QID or nothing (resulting in ) so testing for empty string again will always fail. I fixed that, added the new function to the comment documented API at the bottom of the module and added documentation. —Uzume (talk) 18:40, 29 April 2020 (UTC)
 * thanks for spotting that and for the fix. I'm in the habit to normalising 'string variables' to "" instead of nil (as I always do for parameters passed via frame), and I neglected to add  after the getEntityIdForCurrentPage. But testing for nil is just as good in this case. I tend to use "", rather than allow variables that are expected to be strings to be nil, because sometimes when the code gets modified, string handling functions get used and they almost always throw an error when called with a nil argument. Whereas I prefer to see them fail gracefully for most purposes. It sometimes makes debugging a bit harder, but generally leads to fewer complaints in the long run. Cheers --RexxS (talk) 19:27, 29 April 2020 (UTC)
 * I believe always returns a QID or nothing (resulting in ) so testing for empty string again will always fail. I fixed that, added the new function to the comment documented API at the bottom of the module and added documentation. —Uzume (talk) 18:40, 29 April 2020 (UTC)
 * thanks for spotting that and for the fix. I'm in the habit to normalising 'string variables' to "" instead of nil (as I always do for parameters passed via frame), and I neglected to add  after the getEntityIdForCurrentPage. But testing for nil is just as good in this case. I tend to use "", rather than allow variables that are expected to be strings to be nil, because sometimes when the code gets modified, string handling functions get used and they almost always throw an error when called with a nil argument. Whereas I prefer to see them fail gracefully for most purposes. It sometimes makes debugging a bit harder, but generally leads to fewer complaints in the long run. Cheers --RexxS (talk) 19:27, 29 April 2020 (UTC)

Problem with shortname
Hello, and sorry for the repeated posts. Why does: And not, ? Reh man  06:39, 9 May 2020 (UTC)
 * = North American Vertical Datum of 1988
 * it's because shortname only applies to the value, not its qualifiers:
 * I've now added a parameter qshortname (alias qsn):
 * Hope that helps. --RexxS (talk) 18:28, 9 May 2020 (UTC)
 * Thank you, RexxS. Works like a charm! Reh  man  02:09, 10 May 2020 (UTC)
 * I've now added a parameter qshortname (alias qsn):
 * Hope that helps. --RexxS (talk) 18:28, 9 May 2020 (UTC)
 * Thank you, RexxS. Works like a charm! Reh  man  02:09, 10 May 2020 (UTC)
 * Thank you, RexxS. Works like a charm! Reh  man  02:09, 10 May 2020 (UTC)

Getting the nth value and the last value
Hi RexxS. Suppose we have a list of values:


 * undefined

To get the nth value, you have previously recommended the following solution:


 * undefined

Later you have introduced and  templates to simplify the task:


 * undefined

Which, of course, is better written as:


 * undefined

I have come up with an even better, more natural way of writing it using the list parameter and   templates:



Unfortunately, there is no good analogue to get the last value. There's  , but it is not used anywhere and has a very inefficient implementation that stops working if the list has more than a hundred items:

May I ask you to please create   that would return its last unnamed parameter? Then we would be able to write:



And stop worrying about 's separators potentially clashing with data. Thank you. — UnladenSwallow (talk) 02:39, 15 May 2020 (UTC)


 * That's a neat idea. I had forgotten that the list parameter actually pipes the output through an arbitrary template.
 * We already have support for negative indices in stringsplit:
 * But I like the idea of a utility that returns a given parameter from a list of those provided, so I've created Module:Pn to return a given positional parameter, and Template:P-1 as you requested. The module can generate as many wrappers as desired simply by supplying an index. For example, setting idx=-2 would make a template {last but one}, etc. Check to see if the behaviour is what you want (I've arbitrarily set idx=0 and any idx beyond the number of parameters to return the last one). Do you think indices outside the range should return nothing instead? Cheers --RexxS (talk) 18:21, 15 May 2020 (UTC)
 * But I like the idea of a utility that returns a given parameter from a list of those provided, so I've created Module:Pn to return a given positional parameter, and Template:P-1 as you requested. The module can generate as many wrappers as desired simply by supplying an index. For example, setting idx=-2 would make a template {last but one}, etc. Check to see if the behaviour is what you want (I've arbitrarily set idx=0 and any idx beyond the number of parameters to return the last one). Do you think indices outside the range should return nothing instead? Cheers --RexxS (talk) 18:21, 15 May 2020 (UTC)


 * You're awesome! Thank you! Now I will be able to greatly simplify Indian rows in Template:COVID-19 testing by country subdivision.
 * Yes, indices outside the range should definitely return nothing. For example, if we have a custom 3-column table for displaying a 3-value property, but a certain Wikidata item only has two values for that property, we want the third table cell to be empty, not repeat the second value.
 * Also, can now be used to get the nth value for any n. Is it okay if I add this to  's documentation? — UnladenSwallow (talk) 20:22, 15 May 2020 (UTC)
 * I've made the changes to return nothing if idx=0 or idx>(number of parameters). The only default behaviour left is when idx has a value that can't be recognised as a number (when it returns the first value). You can edit the documentation freely; it's not protected, and I have no feelings of ownership over it.
 * I've just realised that wdib may return an empty list, so it's better not to throw an error in Module:Pn, but just gracefully return nothing. --RexxS (talk) 21:22, 15 May 2020 (UTC)

Tracking function
Template:Track fallback is a newly created template which I recently came across. Does it makes sense to integrate this within WikidataIB so that it can be used with more complex calls? I'm not sure if such a function/template already exists though. Just posting here for better visibility. Reh man  07:49, 6 May 2020 (UTC)


 * I've just added a logic table to the template's documentation so folks can see what outputs they can get, and how to get them. It would probably benefit from being re-written in Lua to improve the logic, but I don't think it should be subsumed into WikidataIB, as it presently can make a call to any module and I don't want to disturb that option. --RexxS (talk) 21:14, 6 May 2020 (UTC)


 * Thank you RexxS! Reh  man  23:54, 6 May 2020 (UTC)

Feature request
Hello RexxS. I'm currently working on getting Infobox mountain on track for a Wikidata-enabled future. In order to support this, one of the WikiProject members require all articles which does not have a local value and uses a value from Wikidata, to be added to a tracking category, for each parameter separately. If you look at Template:Infobox mountain/sandbox (parameter, for example) , you can see that it is possible to do this, but still a bit manual and messy.

Would it be possible to add a  function to this module, such that if the above condition is met, the article would simply be added to a generic category:
 * [Template name] using Wikidata value for [parameter name based on ] (example)

The categories are of course temporary, and once the necessary checks are done,  could simply be removed from Infobox mountain. Would it be possible to implement this? Reh man  15:27, 9 May 2020 (UTC)
 * Sorry, but I think that's the wrong logic for doing checks. No infobox should become wikidata-enabled without consensus to do so. Most infoboxes need to be opt-in, that is, editors have to enable the wikidata functionality on an article-by-article basis by adding all in each article. That ensures that the display of the infobox is checked by an editor, who takes the blame if the infobox contains erroneous information. If they want to add a tracking category at the same time, that's fine, but I don't want to repeat the unpleasant time I endured at Village pump (policy)/Archive 128 . I think my comment at the time is just as relevant now:  It's a huge debate, but it demonstrates the misconceptions and the issues that face anyone wanting to make Wikidata-aware infoboxes on Wikipedia. --RexxS (talk) 17:01, 9 May 2020 (UTC)
 * Thanks for taking the time to explain this, RexxS. Yes, it makes sense. We have consensus, but tracking and article-by-article checks is requirement. I will take your comment regarding trackers back to discussions, and see how it goes. Before I do that, I have one more question. From above, it seems like we are still in a deadlock in terms of tracking "which articles don't have a local value and thus uses/would use a Wikidata value".
 * While NONE is set on the infobox as the default (as a start), would it be possible to add the above tracker without showing Wikidata values? We could then look up that tracking category, check the Wikidata contents of an article (although it is not displaying wd values yet), then add ALL to the article. Once all articles in that tracking category is checked, we can remove  and change the default for that particular parameter in the template to ALL. The ALL in the articles can be left as it is (as it now does nothing) and removed casually. What do you think?  Reh  man  02:07, 10 May 2020 (UTC)
 * I'll be as clear as I can, . I don't accept that Module:WikidataIB is the right place to do field-by-field tracking, nor that such tracking is a reasonable prerequisite for enabling Wikidata in infoboxes. I've already put a lot of effort into creating a mechanism that can ensure every deployment is checked, and I won't spend any time in changing the module to meet unnecessary demands. Anyone is free to get consensus to make changes, or to fork their own version that works the way they want it to, of course.
 * The alternative to the tracker scheme is to use a Wikidata-enabled infobox where the template is coded like this:  in every call to WikidataIB. In each article to be checked, it is only necessary to add   to the infobox, thus enabling Wikidata for the entire infobox, and previewing it. Any unwanted fields can be suppressed or a local value substituted before saving. That achieves exactly the same result without the complication of tracking. There are no downsides to working like that. --RexxS (talk) 21:30, 10 May 2020 (UTC)
 * I hear you, RexxS. I'm not a fan of such trackers myself, and I only ask as it seems to be the key requirement of a WikiProject editor, before I am allowed to enable Wikidata there. The solution you suggested above works, but the problem I'm trying to address is slightly different. Please do correct me if I'm not following you correctly.
 * Infobox mountain is used by roughly 25,000 articles (via local parameters). Only a maximum of roughly 1,500 articles have local values missing and have the corresponding properties populated on Wikidata (i.e. 1,500 articles will display a Wikidata value in a given parameter if Wikidata is enabled, as there is no local value stated currently), the rest of the articles have assigned local values and/or barely has any data populated on Wikidata.
 * So instead of going through all 25,000 articles and enabling them by adding ALL (which cause no change to about 23,500), I'm looking for a way to track articles that would use Wikidata before actually enabling Wikidata, and apply the ALL for those only, before actually enabling Wikidata as default at the infobox-level (we have consensus for this).
 * Please let me know if you feel that I'm looking to solve this problem in the wrong way, or if you know of any solution to this without amending the module. The discussion at the mountain infobox is still ongoing, so I'm simply getting things clarified here before commenting there. Kind regards, Reh  man  02:46, 11 May 2020 (UTC)
 * It's going to take you a long time to check 1,500 articles. If I had to have a tracking category, my solution would be to code the it into a temporary version of the template, of course, something like:
 * whenever you would normally use
 * You are still going to have to check and apply ALL for the other 23,500 articles before you return the template to its non-tracking version, though. --RexxS (talk) 17:17, 11 May 2020 (UTC)
 * I've thought about this some more. I could simply add a parameter that would contain text to be returned instead of whatever is returned from Wikidata. That would have a general functionality, rather than a narrow use. --RexxS (talk) 18:33, 11 May 2020 (UTC)
 * New parameter replacetext (alias rt) I've set this up in Module:WikidataIB/sandbox:
 * Optionally you could just use something like Category:Wikidata available for Infobox mountain. If that does what you want, I can update the main module to implement the functionality. --RexxS (talk) 19:01, 11 May 2020 (UTC)
 * Yes a broader feature such as above is definitely a much better approach than what I proposed. After testing the above for / at Template:Infobox mountain/sandbox by   it seems like the only bug is that the pen icon (alone) is still displayed when the text is replaced and no local value is present, other than that, it works great. Using a single tracking category also makes a lot of sense, in the way that we don't have to visit the same article over and over for different parameters. I will pass these to the discussion there. Please do go ahead and enable this when you feel it's ready. Thank you for this, RexxS.  Reh  man  02:24, 12 May 2020 (UTC)
 * Would it make sense/be possible to ignore  if   is non-blank? This would allow me do run the code as follows:
 * Allowing the person(s) checking and enabling Wikidata to simply add  once the check is done, while reducing a lot of code. What do you think?  Reh  man  04:06, 12 May 2020 (UTC)
 * I've moved the replacement to the output module so that the replacetext also replaces the pen icon.
 * The above will work for all the usual functions. I've only set ALL when  exists in , but that should still find almost all of the articles for you.
 * You'll still have to have two versions of the infobox template available, I think. One will need  coded in to each call, which will replace the current infobox template and generate the list of articles in the category. Then you'll need a second version without , so that you can use it in each article for checking what is actually returned from Wikidata when you add ALL to the article. After you've finished all of the checking, you can simply replace the tracking version of the template with the second version. Cheers --RexxS (talk) 17:59, 12 May 2020 (UTC)
 * Many thanks for this. This should do, I will test the new version and confirm again. I think two versions are not needed as I plan to add:
 * So after checking a particular article, the checker simply adds, which enables Wikidata and removes the category at the same time. And once all checks are done (the category is empty), we simply remove   from the infobox. Cheers,  Reh  man  02:33, 13 May 2020 (UTC)
 * RexxS, I've tested the above. In terms of functionality it now works well. There is a bug though, but I'm not sure if its coming from Module:WikidataIB/sandbox or Template:Infobox mountain/sandbox. If we preview, you will see that "Parent peak" shows a blank value. Would you know what is causing that?  Reh  man  06:24, 13 May 2020 (UTC)
 * You'll still need two versions, of course, but if you use your coding, you don't need them at the same time. That's fine. The blank field is as expected, and it's because Module:Infobox "sees" the category string as a field value (not a blank value), so it creates the field label for it. That's the problem with using the module to return the category, rather than coding it into the template. --RexxS (talk) 11:25, 13 May 2020 (UTC)
 * Oh :( I'm not too sure if there is a way around this, but I have posted at Module talk:Infobox to see if something can be done. This is too bad. A feature of this sort would surely come in handy with the "onboarding process" of infoboxes not yet with Wikidata support.  Reh  man  12:51, 13 May 2020 (UTC)
 * Optionally you could just use something like Category:Wikidata available for Infobox mountain. If that does what you want, I can update the main module to implement the functionality. --RexxS (talk) 19:01, 11 May 2020 (UTC)
 * Yes a broader feature such as above is definitely a much better approach than what I proposed. After testing the above for / at Template:Infobox mountain/sandbox by   it seems like the only bug is that the pen icon (alone) is still displayed when the text is replaced and no local value is present, other than that, it works great. Using a single tracking category also makes a lot of sense, in the way that we don't have to visit the same article over and over for different parameters. I will pass these to the discussion there. Please do go ahead and enable this when you feel it's ready. Thank you for this, RexxS.  Reh  man  02:24, 12 May 2020 (UTC)
 * Would it make sense/be possible to ignore  if   is non-blank? This would allow me do run the code as follows:
 * Allowing the person(s) checking and enabling Wikidata to simply add  once the check is done, while reducing a lot of code. What do you think?  Reh  man  04:06, 12 May 2020 (UTC)
 * I've moved the replacement to the output module so that the replacetext also replaces the pen icon.
 * The above will work for all the usual functions. I've only set ALL when  exists in , but that should still find almost all of the articles for you.
 * You'll still have to have two versions of the infobox template available, I think. One will need  coded in to each call, which will replace the current infobox template and generate the list of articles in the category. Then you'll need a second version without , so that you can use it in each article for checking what is actually returned from Wikidata when you add ALL to the article. After you've finished all of the checking, you can simply replace the tracking version of the template with the second version. Cheers --RexxS (talk) 17:59, 12 May 2020 (UTC)
 * Many thanks for this. This should do, I will test the new version and confirm again. I think two versions are not needed as I plan to add:
 * So after checking a particular article, the checker simply adds, which enables Wikidata and removes the category at the same time. And once all checks are done (the category is empty), we simply remove   from the infobox. Cheers,  Reh  man  02:33, 13 May 2020 (UTC)
 * RexxS, I've tested the above. In terms of functionality it now works well. There is a bug though, but I'm not sure if its coming from Module:WikidataIB/sandbox or Template:Infobox mountain/sandbox. If we preview, you will see that "Parent peak" shows a blank value. Would you know what is causing that?  Reh  man  06:24, 13 May 2020 (UTC)
 * You'll still need two versions, of course, but if you use your coding, you don't need them at the same time. That's fine. The blank field is as expected, and it's because Module:Infobox "sees" the category string as a field value (not a blank value), so it creates the field label for it. That's the problem with using the module to return the category, rather than coding it into the template. --RexxS (talk) 11:25, 13 May 2020 (UTC)
 * Oh :( I'm not too sure if there is a way around this, but I have posted at Module talk:Infobox to see if something can be done. This is too bad. A feature of this sort would surely come in handy with the "onboarding process" of infoboxes not yet with Wikidata support.  Reh  man  12:51, 13 May 2020 (UTC)
 * The above will work for all the usual functions. I've only set ALL when  exists in , but that should still find almost all of the articles for you.
 * You'll still have to have two versions of the infobox template available, I think. One will need  coded in to each call, which will replace the current infobox template and generate the list of articles in the category. Then you'll need a second version without , so that you can use it in each article for checking what is actually returned from Wikidata when you add ALL to the article. After you've finished all of the checking, you can simply replace the tracking version of the template with the second version. Cheers --RexxS (talk) 17:59, 12 May 2020 (UTC)
 * Many thanks for this. This should do, I will test the new version and confirm again. I think two versions are not needed as I plan to add:
 * So after checking a particular article, the checker simply adds, which enables Wikidata and removes the category at the same time. And once all checks are done (the category is empty), we simply remove   from the infobox. Cheers,  Reh  man  02:33, 13 May 2020 (UTC)
 * RexxS, I've tested the above. In terms of functionality it now works well. There is a bug though, but I'm not sure if its coming from Module:WikidataIB/sandbox or Template:Infobox mountain/sandbox. If we preview, you will see that "Parent peak" shows a blank value. Would you know what is causing that?  Reh  man  06:24, 13 May 2020 (UTC)
 * You'll still need two versions, of course, but if you use your coding, you don't need them at the same time. That's fine. The blank field is as expected, and it's because Module:Infobox "sees" the category string as a field value (not a blank value), so it creates the field label for it. That's the problem with using the module to return the category, rather than coding it into the template. --RexxS (talk) 11:25, 13 May 2020 (UTC)
 * Oh :( I'm not too sure if there is a way around this, but I have posted at Module talk:Infobox to see if something can be done. This is too bad. A feature of this sort would surely come in handy with the "onboarding process" of infoboxes not yet with Wikidata support.  Reh  man  12:51, 13 May 2020 (UTC)
 * RexxS, I've tested the above. In terms of functionality it now works well. There is a bug though, but I'm not sure if its coming from Module:WikidataIB/sandbox or Template:Infobox mountain/sandbox. If we preview, you will see that "Parent peak" shows a blank value. Would you know what is causing that?  Reh  man  06:24, 13 May 2020 (UTC)
 * You'll still need two versions, of course, but if you use your coding, you don't need them at the same time. That's fine. The blank field is as expected, and it's because Module:Infobox "sees" the category string as a field value (not a blank value), so it creates the field label for it. That's the problem with using the module to return the category, rather than coding it into the template. --RexxS (talk) 11:25, 13 May 2020 (UTC)
 * Oh :( I'm not too sure if there is a way around this, but I have posted at Module talk:Infobox to see if something can be done. This is too bad. A feature of this sort would surely come in handy with the "onboarding process" of infoboxes not yet with Wikidata support.  Reh  man  12:51, 13 May 2020 (UTC)

Thanks for helping at Module talk:Infobox. I'm very glad we now have this feature. I've did some more tests, and everything now seems to work seamlessly. When you're ready, could you move the WikidataIB code from sandbox to live please? Cheers, Reh  man  03:40, 14 May 2020 (UTC)
 * ✅ --RexxS (talk) 19:29, 14 May 2020 (UTC)
 * Thank you RexxS. Not sure if this is due to the above change, but there seems to be a bug in the main functions:
 * I'm not able to trace the cause of it though... Reh  man  05:25, 15 May 2020 (UTC)
 * all doesn't work - it would whitelist just a field called "all" because field names are case specific. Use ALL.
 * none doesn't work - it would blacklist just a field called "none". Usually that makes no difference, except that any value for suppressfields requires a name parameter so that it knows the name of the field it has to check on the blacklist. The same goes for fetchwikidata when it has any value other than "ALL", when it needs to know the field name to check on the whitelist.
 * In the cases where the name parameter is missing (other than when ALL), the call will always return empty. --RexxS (talk) 15:42, 15 May 2020 (UTC)
 * I'm quite certain these basic calls didn't work yesterday even when I tried uppercase. Probably a glitch/lag somewhere, or just me having a moment. I've gone ahead and changed all sandbox instances to uppercase anyway, in case it was me missing something. Thank you for explaining! Cheers, Reh  man  04:15, 16 May 2020 (UTC)
 * In the cases where the name parameter is missing (other than when ALL), the call will always return empty. --RexxS (talk) 15:42, 15 May 2020 (UTC)
 * I'm quite certain these basic calls didn't work yesterday even when I tried uppercase. Probably a glitch/lag somewhere, or just me having a moment. I've gone ahead and changed all sandbox instances to uppercase anyway, in case it was me missing something. Thank you for explaining! Cheers, Reh  man  04:15, 16 May 2020 (UTC)
 * In the cases where the name parameter is missing (other than when ALL), the call will always return empty. --RexxS (talk) 15:42, 15 May 2020 (UTC)
 * I'm quite certain these basic calls didn't work yesterday even when I tried uppercase. Probably a glitch/lag somewhere, or just me having a moment. I've gone ahead and changed all sandbox instances to uppercase anyway, in case it was me missing something. Thank you for explaining! Cheers, Reh  man  04:15, 16 May 2020 (UTC)
 * In the cases where the name parameter is missing (other than when ALL), the call will always return empty. --RexxS (talk) 15:42, 15 May 2020 (UTC)
 * I'm quite certain these basic calls didn't work yesterday even when I tried uppercase. Probably a glitch/lag somewhere, or just me having a moment. I've gone ahead and changed all sandbox instances to uppercase anyway, in case it was me missing something. Thank you for explaining! Cheers, Reh  man  04:15, 16 May 2020 (UTC)
 * I'm quite certain these basic calls didn't work yesterday even when I tried uppercase. Probably a glitch/lag somewhere, or just me having a moment. I've gone ahead and changed all sandbox instances to uppercase anyway, in case it was me missing something. Thank you for explaining! Cheers, Reh  man  04:15, 16 May 2020 (UTC)

Image captions
Hello. Any suggestions on getting accurate image captions? I'm aware of the old, but Module:Wikidata is outdated and the output isn't accurate when there are multiple images.

I tried to put together something like, but that of course didn't work. Reh man  06:49, 8 May 2020 (UTC)
 * The call I'm currently using to do this (in commons:Template:Wikidata Infobox) is . Thanks. Mike Peel (talk) 07:40, 8 May 2020 (UTC)
 * Thanks Mike Peel. Just what I was looking for! Cheers, Reh  man  07:49, 8 May 2020 (UTC)

Mike Peel, would you know if the Commons caption saved as structured data could be made use of if a caption on Wikidata is missing? Or even vice versa, if the Commons caption could be prioritised if preferred? Reh man  13:16, 16 May 2020 (UTC)
 * No idea, sorry. You can access Commons captions on Commons using WikidataIB and the media files M-id, but I've never tried outside of Commons. Thanks. Mike Peel (talk) 13:18, 16 May 2020 (UTC)
 * Thanks Mike. It would be nice if that is implemented in the future, especially considering Commons files themselves have useful machine-readable captions. Cheers, Reh  man  13:26, 16 May 2020 (UTC)

Qualifiers
I've done a fairly significant re-write of how qualifiers are handled. The effects are to allow DATES to be mixed with other parameters; to process and  separately, so they are always last in the list of qualifiers rendered (and use ndashes, regardless of the value of  ); and to clean up the code internally, reducing recalculation of certain objects every time a loop is iterated. I've tested as many cases as I can think of, but there may still be issues that require the code to be rolled back while they are sorted out. --RexxS (talk) 15:03, 13 June 2020 (UTC)

Infoboxes still using Template:Wikidata
According to "What links here", the following infoboxes are still using Wikidata and may benefit from conversion to Module:WikidataIB:


 * Template:Infobox Belgium municipality (611 transclusions)
 * Template:Infobox Belgium municipality section
 * Template:Infobox Italian comune (8,086 transclusions)
 * Template:Infobox Russian federal subject
 * Template:Infobox Swiss town (2,841 transclusions)
 * Template:Infobox airline (4,356 transclusions)
 * Template:Infobox artwork/wikidata (493 transclusions)
 * Template:Infobox company (76,000 transclusions)
 * Template:Infobox company/Unternehmen
 * Template:Infobox drink (1,166 transclusions)
 * Template:Infobox drug (8,510 transclusions)
 * Template:Infobox drug/formatCompTox (8,522 transclusions)
 * Template:Infobox element (somewhere in a subtemplate)
 * Template:Infobox football association
 * Template:Infobox gene (12,577 transclusions)
 * Template:Infobox golfer/ranking
 * Template:Infobox organization/Wikidata
 * Template:Infobox physical quantity
 * Template:Infobox power station (2,554 transclusions)
 * Template:Infobox rowing club
 * Template:Infobox scientist/Wikidata
 * Template:Infobox software (13,588 transclusions)

It seems likely that some of these templates are pulling unsourced data from Wikidata into infoboxes. – Jonesey95 (talk) 20:01, 1 July 2020 (UTC)