Module talk:Wd/Archive 1: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot
m Archiving 1 discussion(s) from Module talk:Wd) (bot
 
(44 intermediate revisions by 2 users not shown)
Line 603:
{{reflist-talk}}
Note especially the "author name string" spelled out. No human would produce a citation like that. I with {{tlx|wikidata|references}} would produce this kind of citation:
{{demo|<nowiki>{{citecitation |author=Lukasiwicz |date=25 December 2013 |title=What happened to Wikifonia? |url=https://www.saxontheweb.net/threads/what-happened-to-wikifonia.198166/post-2154479 |access-date=1 December 2020}} ''Additional parameters here''</nowiki>}}
[[User:Daask|Daask]] ([[User talk:Daask|talk]]) 14:55, 2 December 2020 (UTC)
:I did not know of the existence of {{wpl|P2093}} until now, I will take it into account in the upcoming update. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]]&nbsp;[[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 19:35, 2 December 2020 (UTC)
Line 979:
:{{replyTo |Calistemon}} Or just <code><nowiki>{{cvt |input=P2046 |qid=Q5004080}}</nowiki></code> to produce {{cvt |input=P2046 |qid=Q5004080}}. [[User:Betterkeks|Betterkeks]] ([[User talk:Betterkeks|talk]]) 09:00, 28 November 2022 (UTC)
::Thank you {{replyTo|Betterkeks|MSGJ}}, this is such a simpler way to achieve this instead of the clumsy way I produced! Much appreciated. [[User:Calistemon|Calistemon]] ([[User talk:Calistemon|talk]]) 06:58, 29 November 2022 (UTC)
 
== Access value by date using P585 point-in-time ==
 
Why isn't it possible to access specific values by comparing date against P585 point in time not just start and end time?
Say call for a value that has point-in-time value in January 1st 2022 because not all values can be correctly described as having start and end points, some for example population is specifically point-in-time value as it is changing day by day.
Is it not implemented because it is not possible or it hasn't yet been deemed useful?
If it's possible how could it be done? Does someone else add the functionality or do I copy the code and try to add the functionality and then if it is successful it may be added to main Module? [[User:Liinisx|Liinisx]] ([[User talk:Liinisx|talk]]) 11:48, 5 January 2023 (UTC)
 
== Template-protected edit request on 5 January 2023 ==
 
{{edit template-protected|Module:Wd|answered=y}}
Add functionality to call for a property value if "date=..." matches P585 date-in-time value
As I understand it is not possible for now and one can call for a value by date only if it has start-time and/or end-time qualifiers [[User:Liinisx|Liinisx]] ([[User talk:Liinisx|talk]]) 14:21, 5 January 2023 (UTC)
:Unless you can code this yourself in the sandbox and test it, this probably will not get done. This module is no longer actively maintained, and the last time I tried to edit the code I made little progress.
 
== Examples in the main page ==
 
The examples in the main page are kind of difficult:<br /><nowiki>{{wikidata|properties|qualifier|normal+|Q55|P1082|P585}}</nowiki><br />↓<br />17,282,163 (2019), 16,829,289 (26 August 2014), 16,779,575 (2013), 10,026,773 (1950), 17,000,000 (21 March 2016), 17,132,854 (2017), 17,181,084 (1 January 2018), 17,622,200<br /><br />
The results aren't in any order - neither by time, nor by size.<br /><br />What I want is eg [[:Santa Fe, Cebu]] using P150 which can have a number of elements in alphabetic order. They are each similar eg Q26763388, and from each I want (P1082) the most recent population, and the closest earlier.<br />If I can work it out, that can do the whole job is one line (adding text where needed). - [[User:Auntie Kathleen|Auntie Kathleen]] ([[User talk:Auntie Kathleen|talk]]) 06:05, 6 January 2023 (UTC)
 
:I guess it is giving the values in the order that they are on Wikidata. I have changed the order on there (using [[wikidata:Help:Statements#Order_of_statements_for_a_property]] and now it displays 2019 first (which is the statement marked as preferred) and then all the others in chronological order, and then the undated one.
:{{wikidata|properties|qualifier|normal+|Q55|P1082|P585}}
:Hope this helps &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 15:13, 8 January 2023 (UTC)
 
== Pulling structured data from Commons ==
 
Is there an equivalent to this module to retrieve structured data from a file on wikimedia commons? E.g. [[c:File:Inhibition_mechanism_(irreversible).svg|this file]] should have P275 = Q20007257. Any ideas? [[User:Evolution and evolvability|T.Shafee(Evo<small>&#38;</small>Evo)]]<sup>[[User talk:Evolution and evolvability|talk]]</sup> 06:30, 10 March 2023 (UTC)
 
== Is there a risk for overusing this module? ==
 
Hello. Thank you for developing this amazing module. I am working in the Ladin language Wikipedia, where I have created this module by copying this code and it works well. I have started using this module a lot on many articles, because the Ladin Wikipedia is very small and there aren't enough people to regularly update information, so I try to automatise everything as much as possible. I have found that when an article contains several instances of "module:wd", like five or more, it can take a while for the page to display the information. I include this module both in infoboxes as well as in the text of the article. When it takes longer to display the information from Wikidata, it may even show only certain information from Wikidata but not other. I don't think it's a syntax issue, because other pages with the same syntax did not have this issue.
 
Therefore, I wonder whether there is a recommended guideline against overusing this module, whether using it five times on every single page in the entire Wikipedia would slow everything down considerably. Or is this practice fine?
Do the long loading times only happen when the Wikidata item or the Wikipedia article are edited, and otherwise it just loads the information once and then it's fine?
 
Thanks for helping. [[User:Asenoner|Asenoner]] ([[User talk:Asenoner|talk]]) 13:01, 19 March 2023 (UTC)
 
== Edit request 4 April 2023 ==
 
{{Edit template-protected|answered=yes}}
 
'''Description of suggested change:'''
I would like to update this module with my revision of its sandbox ([https://en.wikipedia.org/w/index.php?title=Module:Wd/sandbox&oldid=1148218836 permalink]). I've made the module slightly simpler by simplifying its conditional statements, and fixed two minor errors in pattern matching (attempts to escape w/ backslash instead of %). I've checked my changes in [[Module:Wd/testcases|/testcases]], and my version appears to fare equally to the current revision.
 
'''Diff:'''
[https://en.wikipedia.org/wiki/Special:ComparePages?page1=Module%3AWd&rev1=1073619513&page2=Module%3AWd%2Fsandbox&rev2=1148218836&action=&unhide=&diffmode=source diff link]
 
{&#123;'''[[User:Lemondoge|Lemondoge]]'''&#124;[[User talk:Lemondoge|Talk]]&#124;[[Special:Contributions/Lemondoge|Contributions]]&#125;} 20:36, 4 April 2023 (UTC)
:This module is used in more than 1.5 million pages. It would be nice to have this proposed revision checked by one or two editors who are familiar with the module. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 22:24, 4 April 2023 (UTC)
::Although I am not very familiar with the inner workings of the module, I reviewed the changes and they look right. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:44, 8 April 2023 (UTC)
: {{not done}} I'm not willing to make cosmetic, possibly-poorly-tested changes to a module used on a million pages, and it appears no one else is willing to either because this has languished for weeks. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 01:47, 17 April 2023 (UTC)
 
== [[COVID-19 pandemic in Luxembourg]] totally broken ==
 
Not sure why there's the memory errors, but all the articles uses of [[Module:Wikidata]] are borked. [[User:Galobtter|Galobtter]] ([[User talk:Galobtter|talk]]) 22:19, 18 April 2023 (UTC)
:That page's corresponding Wikidata page is currently 3,222,389 bytes, with 2,631 statements, putting it at #90 overall on the [https://www.wikidata.org/w/index.php?title=Special:LongPages&limit=100&offset=0 Wikidata list of long pages]. Something probably needs to be done to improve efficiency of querying such a large page, or to reduce the size of the page. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 22:49, 18 April 2023 (UTC)
 
== Reference formatting bug when using "author name string" (P2093) ==
 
When a reference on Wikidata includes the "author name string" qualifier, the resulting citation is formatted improperly. It should be formatted the same way as when the "author" (P50) qualifier is used. See the reference 1 on [[GNU GRUB]] for example. This issue was already [[Module_talk:Wd/Archive_1#Improved_citation_formatting|discussed in 2020]], but it seems that it wasn't solved.
[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:58, 6 January 2023 (UTC)
 
:It looks it is related to [[Module:Wd/i18n]]. Maybe it could be fixed by adding something like <code>[aliasesP.authorNameString] = "author"</code> between the line 60 and 71. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:03, 20 January 2023 (UTC)
 
=== Template-protected edit request on 2 March 2023 ===
 
{{edit template-protected|Module:Wd/i18n|answered=yes}}
Please copy the contents of the revision 1142478456 of [[Module:wd/sandbox/i18n]] into [[Module:wd/i18n]] and the contents of the revision 1142479763 of [[Module:wd/sandbox]] into [[Module:wd]]. It is the fix for the bug described in the section above. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:05, 2 March 2023 (UTC)
 
:Thanks for looking into this. Have you got any test cases where we can check that everything is working properly? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 17:21, 2 March 2023 (UTC)
::I don't have any new testcases. I'm not sure how do the testcases of this module work, but [[Module:wd/testcases/1]] references only the original module and testcases 2 and 3 also reference the sandbox. I've made a tweaked copy of testcases/1 at [[Module:wd/sandbox/testcases/1]] and its output seems to be the same as before my edits (5 errors reported). The output of the testcase 2 and 3 is also the same as before. However, I've made a very basic test page for my changes at [[User:Janhrach/sandbox]]. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 06:11, 3 March 2023 (UTC)
:::[[User:Janhrach/sandbox]] proves the point that I made below; the {{tlx|cite web}} template called from wd/sandbox is using {{para|authors}} so that thing in your sandbox will, if used in mainspace add the article to {{cl|CS1 maint: uses authors parameter}}. So, I '''oppose''' the proposed change.
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:48, 3 March 2023 (UTC)
:If I understand what it is that this change accomplishes, I think I'm opposed. At [[Special:Permalink/1142478456#L-69|line 69]] of Module:Wd/sandbox/i18n is this:
::<syntaxhighlight lang="lua">[aliasesP.authorNameString] = "authors", </syntaxhighlight>
:If I understand the purpose of that, it is supposed to assign whatever value wikidata has for P2093 to the {{tlx|cite web}} parameter {{para|authors}}. Use of that parameter is discouraged and it will (someday) go away. {{tlx|cite q}} assigns P2093 values to {{para|author}} as a fallback (if one is to believe the module documentation at [[Module:Cite_Q#L-245|line 245]]). Neither of these solutions is a good solution when P2093 lists more than one name. Because P50 can (and does) hold more than one name it seems to me that wikidata q values using P2093 should be fixed to use P50 and this module tweaked to support that. Assigning P2093 to {{para|authors}} seems to me a hack that will come round to bite someone later. Don't do that.
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 18:19, 2 March 2023 (UTC)
::I have just noticed that P2093 is supposed to hold one author at once, and if there are more authors, the reference will have more P2093s. For example, see the items listed at the "Most recently created items" URL at [[d:Property talk:P2093]]. I suggest to use <code>author</code> (instead of <code>authors</code>) for holding P2093s. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:55, 3 March 2023 (UTC)
:::Ok, so long as the value from each P2093 goes in a separate enumerated {{para|author&lt;{{var|n}}>}} parameter.
:::
:::I have marked this edit request as {{para|answered|yes}}. When you have got working code that does not create broken cs1|2 templates, feel free to set {{para|answered|no}}.
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:48, 3 March 2023 (UTC)
 
=== Template-protected edit request on 4 March 2023 ===
 
{{edit template-protected|Module:Wd|Module:Wd/i18n|answered=yes}}
Please copy the contents of the revision 1142767581 of [[Module:wd/sandbox/i18n]] into [[Module:wd/i18n]] and the contents of the revision 1142771233 of [[Module:wd/sandbox]] into [[Module:wd]].
 
I've implemented the handling of P50 and P2093. In my implementation, each P50 and P2093 has its <code>authorN</code> parameter, with (template) parameters for P50 having lower <code>N</code> than parameters for P2093. For compatibility reasons, I have retained code that would handle multiple properties other than P50 and P2093. <s>I've also tweaked the fallback display of citations (used when a citation has parameters not supported by Cite web or when it doesn't include title or URL). The authors from P2093 are now displayed properly and the author separator was changed from " & " to "; ". The parts of the citation are now separated by ". ", not by "; ".</s> For output examples, see [[User:Janhrach/sandbox]].
[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:18, 4 March 2023 (UTC)
 
'''Edit:''' see the comment from March 11.
:[[Special:Permalink/1142659125#cite_note-wikidata-45b28f9ca74a90a4f01d5dd643c79201de7817b8-v5-2|This cite]] seems to be more-or-less correct; [[Special:Permalink/1142659125#cite_note-wikidata-440dd35a0625814a5114a133ac12478c83252b47-v5-3|this cite]] does not. It appears that for some reason you are inventing your own citation style which would be ok if it were the only style to be used in articles that use this module. Alas, editors like citation consistency. I'm guessing that the reason for this different style is to prevent the embedded {{tlx|cite web}} template from emitting an error when wikidata does not have a title for the citation. Titles are required so when {{tld|cite web}} emits a missing title error, that is a good thing, because someone can go to wikidata and fix it (P1476). I'm inclined to oppose because of the non-standard citation style.
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:02, 4 March 2023 (UTC)
::I did "invent" a new citation style (which is a slight modification of the previous one), but I did not come up with the idea of a fallback mode. See the updated version of [[User:Janhrach/sandbox|my sandbox]] for the original behavior of the module. So, is your opinion to remove the fallback mode and issue an error instead, or is it to keep the fallback mode and to issue an error only if the title is missing? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:21, 4 March 2023 (UTC)
:::I would get rid of the fallback format as it exists now. If that is not possible, at the very least, the fallback format should look (to the reader) just like a cs1|2 template rendering. Maybe fallback format can use {{tlx|citation}} with {{para|mode|cs1}}:
::::<code><nowiki>{{citation |mode=cs1 |author1=John Doe |author2=Jane Doe |url=https://example.org |date=2000}}</nowiki></code>
:::::{{citation |mode=cs1 |author1=John Doe |author2=Jane Doe |url=https://example.org |date=2000}}
:::This looks much the same as the {{tlx|cite web}} and {{tlx|cite q}} template renderings; sort of. In the event that there is no url but there is a title, {{tld|citation}} will treat the citation as a book cite:
::::<code><nowiki>{{citation |mode=cs1 |author1=John Doe |author2=Jane Doe |title=Title |date=2000}}</nowiki></code>
:::::{{citation |mode=cs1 |author1=John Doe |author2=Jane Doe |title=Title |date=2000}}
:::<s>One thing that should be done with this referencing stuff is to set {{para|id|<nowiki>[[WDQ (identifier)|Wikidata]]</nowiki> Q&lt;{{var|number}}>}} so that editors know where to go to fix missing/broken url/title/whatever.</s> yeah, there is a pencil icon... forgot about that.
:::
:::I should say that while I have contributed to [[Module:Cite Q]], I am, in general, opposed to its use and, by extension, to this module because both create buggy, hard to fix citations.
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) <s>17:16, 4 March 2023 (UTC)</s> 17:44, 4 March 2023 (UTC)
::::What about citation properties/parameters in Wikidata unknown to {{tl|Citation}}? Should they be left undisplayed, should the template output an error, or should the current behavior (outputting them in the format <code>property: value.</code>) be retained? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:54, 4 March 2023 (UTC)
:::::{{tq|citation properties/parameters in Wikidata unknown to {{tl|Citation}}}} And what properties/parameters might those be?
:::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 18:09, 4 March 2023 (UTC)
::::::I meant some miscellaneous data about the reference, but I had nothing specific in my mind. Anyway, such metadata would be irrelevant for the citation and should be removed, so the best solution would be to display an error if any similar situation occurs. In other words, forget about my question. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:09, 4 March 2023 (UTC)
{{od}}
Deactivating edit request as still pending discussion and not ready to be implemented. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 22:15, 4 March 2023 (UTC)
::::I've changed my opinion, I disagree with using {{tl|Citation}} as the fallback mode. In my opinion, there are two good options – the fallback mode would retained, but it would issue a warning; or the fallback mode would be removed and an error would be issued if the module is unable to produce a valid template. I think the fallback mode (if retained) should be only temporary, and in the case a citation triggering the fallback mode appears, the citation (or, in special cases, this module) should be modified to produce a valid template. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 08:51, 5 March 2023 (UTC)
 
I'm reopening this edit request. The discussion above is not directly related to my proposed fix. I made minor changes to the fallback display of citations, which (the changes) are partly unrelated to the rest of the fix. If you dislike them, please replace the main module file with the sandbox revision 1142765292 (instead of 1142771233). The <s>below</s> above discussion is about completely changing the fallback display of citations (as the resulting citations are not formatted consistently with CS1/2), which is neither something I wanted to address in my fix, nor something I am experiened enough to do. Addressing the inconsistency of fallback mode-generated citations can (and, in my opinion, should) be done later by more experienced editors than me. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:43, 11 March 2023 (UTC)
 
:{{to|Janhrach}} would be good if we could tuck this one in. I need you to '''link''' to precisely the sandbox versions for [[Module:Wd/sandbox]] and [[Module:Wd/i18n/sandbox]] that you want to implement. And I need you to reassure me that your edits have been tested and are ready to go live. Thank you''!'' '''''[[User:Paine Ellsworth|<span style="font-size:92%;color:darkblue;font-family:Segoe Script">P.I.&nbsp;Ellsworth</span>]]'''''&thinsp;,&nbsp;[[Editor|<span style="color:black">ed.</span>]]&nbsp;[[User talk:Paine Ellsworth|<sup>put'er&nbsp;there</sup>]]&nbsp;<small>11:09, 25 March 2023 (UTC)</small>
::{{reply to | User:Paine Ellsworth}} The links are [https://en.m.wikipedia.org/wiki/Special:MobileDiff/1142771233] (sandbox) and [https://en.m.wikipedia.org/wiki/Special:MobileDiff/1142767581] (sandbox/i18n). My edits have been tested, the results are in [[User:Janhrach/sandbox|my sandbox]]. Please note that the third reference in the sandbox is supposed to trigger the fallback mode of displaying references, it is not a bug.
::[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:02, 26 March 2023 (UTC)
:::Because the 'fallback' does not look like a cs1|2 template rendering, I stand by my previous comment: {{tq|I would get rid of the fallback format as it exists now. If that is not possible, at the very least, the fallback format should look (to the reader) just like a cs1|2 template rendering.}} Get rid of the fallback or fix it.
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:32, 26 March 2023 (UTC)
::::{{ping | Trappist the monk}} I have removed the fallback mode, see [[User:Janhrach/sandbox|my sandbox]] for the output. One problem is that Wikidata doesn't seem to mandate any other reference parameters than URL. See the first error in [[Module:Wd/sandbox/testcases/1]]. The <code>sourced</code> command breaks, because one of the references triggers the (now inexistent) fallback mode, which can be considered a problem. Please let me know what you think. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:08, 28 March 2023 (UTC)
:::::Emitting a Lua script error is clearly the wrong thing to do because it misleads the reader into thinking that the problem is in the Lua module when it is really in the wikidata:
::::::<strong class="error">Lua error in Module:Wd/sandbox at line 250: A reference contains malformed parameters.</strong>
:::::Why would you have the module emit an error message like that? Error message must be meaningful or at the very least link to documentation that explains the error message. Further, using {{tag|strong}} and a larger font size for error messages is a lot like SHOUTING; don't do that.
:::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 13:58, 29 March 2023 (UTC)
::::::{{ping | Trappist the monk}} I have tweaked the output, please see my sandbox. Is it OK now? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:30, 29 March 2023 (UTC)
:::::::The appearance is better but the message:
::::::::{{color|#d33|Error: Reference contains a combination of parameters incompatible with Cite Web and Cite Q templates.}}
:::::::is wholly untrue, isn't it? If I go to [[:d:Q112795079#P279]] and look in the reference I find {{property|P854}}, {{property|P2093}}, {{property|P50}}, & {{property|P577}}. All of these appear in [[:d:Q112795079#P31]] and all but P50 appear in [[:d:Q212885#P348]]. The references created for those latter two are apparently rendered by {{tlx|cite web}}. Clearly then, the 'parameters' in Q112795079#P279 are {{em|not}} {{color|#d33|... incompatible with Cite Web and Cite Q templates.}}
:::::::
:::::::Why is {{tq|the first error in [[Module:Wd/sandbox/testcases/1]]}} no longer broken? It is one of the two <code>Q55|P1081</code> tests (don't remember which). It showed the shouted error message but doesn't show the new error message. Should it?
:::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 22:42, 29 March 2023 (UTC)
{{od}} {{ping | Trappist the monk}} In technical sense, the term "[incompatible] combination of parameters" includes the fact that the citation lacks the needed parameters. Since it will be probably unclear what it means, it can be replaced with something like: "Error: Unable to display the reference properly. See the documentation for details." The documentation would include something like this (under the subtitle of the error): "The Wikidata reference doesn't contain the minimal set of parameters (title and reference URL for Cite web, "stated in" for Cite Q) or has a set of parameters incompatible with both Cite web and Cite Q". As for the error that disappeared, the reason for its disappearance is that the new error message is returned from the ''getReference'' function to avoid terminating the whole script, as calling ''error()'' did. The "sourced" command counts error-returning references as valid, and I don't think it's a problem – there is no policy that only statements with references renderable with Cite web/Cite Q are considered ''sourced''. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:19, 30 March 2023 (UTC)
:Most editors at en.wikipedia are not technical. Error messages or the explanatory text {{em|linked}} from the error message must be written so that any editor can learn what is wrong and how to fix it. 'Technical' answers have no place in error messaging unless the 'fix' is only intended to be fixed by technical editors.
:
:As an example of poor documentation, look at {{slink|Template:Cite_Q|Module:Wd}}. That section is the only place where {{property|P248}} is mentioned. As it turns out, the mention is incorrect; the citation is rendered by {{tlx|cite web}}, not by {{tlx|cite q}}. I went looking because {{para|stated in}} is not a {{tld|cite q}} parameter just as {{para|reference url}} is not a {{tld|cite web}} parameter.
:
:Just because I was curious, I switched the example template at {{tld|cite q}} to use the ~/sandbox:
::<code><nowiki>{{Wikidata/sandbox|references|raw|Q2978|P2046}}</nowiki></code>
:::{{Wikidata/sandbox|references|raw|Q2978|P2046}}
:Really? Should that error message be there? The {{tld|cite web}} rendering produced by the live version of {{tlx|Wikidata}} is exactly the same as the reference produced by ~/sandbox – neither are 'good' citations but that is one of the huge failings of {{tld|cite q}}.
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 22:28, 30 March 2023 (UTC)
::{{Ping | Trappist the monk}} The example from the Cite Q documentation is wrong because new claims (about the area of Regensburg) have been added since the example was written. Now (as opposed to the time the example was written), there are '''2''' references supporting the newest claim (as opposed to the one that was intended to appear in the example), but they aren't enclosed in ''ref'' tags because of the ''raw'' command, so on the first look, they look like one citation. None of the references uses ''stated in'', so they can't be rendered using Cite Q. If you don't understand me, just look at [https://www.wikidata.org/wiki/Q2978#P2046]. On the "80.85 square kilometers" claim (which is inadvertently used on the documentation page), the first reference lacks a title, so it causes the error. The second reference is just a normal URL reference. The "80.81 square kilometers" claim is probably the one intended to appear in the example in the Cite Q documentation.
::As for the inexistent <code>|reference url</code> parameter, it isn't used because the <code>reference URL</code> Wikidata property is mapped to the <code>url</code> parameter of Cite web in [[Module:wd/i18n]]. The <code>stated in</code> property is mapped to the first (unnamed) parameter of Cite Q.
::As for the new error message suggested in my last comment, is something wrong with it? Is it still too technical? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:49, 31 March 2023 (UTC)
:::I wasn't trying to get you to justify or explain the poor documentation at {{tlx|cite q}}. I used it as an example of what {{em|not}} to do. Apparently I failed to communicate – a personal failing that has oft been commented on at en.wikipedia.
:::
:::{{color|#d33|Error: Unable to display the reference properly. See the documentation for details.}} What 'documentation' where? {{em|Link}} to it.
:::
:::{{tq|The Wikidata reference doesn't contain the minimal set of parameters (title and reference URL for Cite web, "stated in" for Cite Q) or has a set of parameters incompatible with both Cite web and Cite Q"}} A point I was trying to get across is that {{tlx|cite web}} does not have a parameter called {{para|reference URL}} and {{tld|cite q}} does not have a parameter called {{para|stated in}}. I don't know that it is necessary to distinguish between {{tld|cite web}} and {{tld|cite q}}. Perhaps you should avoid the word 'parameters' because wikidata doesn't have parameters. The {{em|linked}} help text should explain what properties are required and how to decide whether to use {{property|P248}} or to use {{property|P854}} and {{property|P1476}}.
:::
:::The {{em|linked}} help text should also describe how to find the reference that needs fixing. The {{tld|cite q}} documentation is an example worth noting. Wikidata change at the whim of wikidata editors who aren't necessarily wikipedia editors so error messages will pop up unexpectedly on en.wiki articles. Editors at en.wiki won't know why the error messages have suddenly appeared and don't know how and where to fix them. It is important that non-technical and/or novice en.wiki editors be told where to find the source of the error and be given instruction on how to fix that error.
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:30, 31 March 2023 (UTC)
::::Thank you for correcting my misunderstandings. In the next few days, when I'll have time, I'll start working on a concrete text for the module documentation. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:40, 31 March 2023 (UTC)
:::::{{ping|Trappist the monk}} I've written a new section for the module documentation and listed some minor changes [[User:Janhrach/new_wd_documentation|here]]. Can you please review it? While I was writing the documentation, I've noticed a potential bug in my proposed changes to the code of the module, but I haven't had time to fix it yet. And there is also another problem – there is a pending edit request at the bottom of this talk page. Until it is either accepted or denied, I can't make a final version of the (whole) code of the module implementing my proposed changes. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:41, 11 April 2023 (UTC)
::::::From your documentation: {{tq|or has properties not in the table above, the following error is returned ...}} Surely you don't actually mean that do you? Are you suggesting that a url with 'stated in' is an error condition? Other than that, I like it. I wonder if the two tables might be somehow combined for the avoidance of confusion ...
::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:27, 13 April 2023 (UTC)
{{od}} I have clarified the sentence you have mentioned. In the sentence I originally assumed it is clear that the module attempts to use Cite Q only after using Cite web has failed, but now I agree with you that the original sentence needed to be clarified. As for the tables, I don't think it's a good idea to merge them, because they describe different citation renderings which shouldn't be confused. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:03, 14 April 2023 (UTC)
 
:{{ping|Trappist the monk}} I've fixed the bug I've mentioned, so the code in the sandbox is now ready to be copied into the main module file. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:29, 20 April 2023 (UTC)
::{{ping|Trappist the monk}} The wording of my previous message is probably not clear. Just to clarify: Please copy [[Module:wd/sandbox]] and [[Module:wd/sandbox/i18n]] to [[Module:wd]] and [[Module:wd/i18n]], respectively. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:55, 30 April 2023 (UTC)
:::I came here to object to your use of {{para|authors}} in the generated citations. I do not know this module nor do I know and understand Wikidata. As such, I am not qualified to determine if your suggested changes are correct and harmless. You should reactivate the edit request to see if you can attract an editor who is qualified. Have you asked the module's primary author Editor [[User:Thayts|Thayts]]?
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 16:07, 1 May 2023 (UTC)
::::OK, so I will make another edit request as soon as I will have time for it. By the way, thank you for all your advice. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:59, 3 May 2023 (UTC)
 
=== Template-protected edit request on 3 May 2023 ===
 
{{edit template-protected|Module:Wd|Module:Wd/i18n|answered=yes}}
Please copy the revision 1150716473 of [[Module:wd/sandbox]] to [[Module:wd]] and the revision 1150510037 of [[Module:wd/sandbox/i18n]] to [[Module:wd/i18n]].
I've made several changes to processing of citations. For the explanation, see the text under the previous edit request template, but note that I've <u>additionally</u> removed the fallback mode of processing citations, because Trappist the monk convinced me that I shouldn't retain it. (See the above discussion.) I have also listed proposed changes to the module documentation at [[User:Janhrach/new_wd_documentation]]. It would be helpful if {{mention|Thayts|p=}} looked at my proposed changes to the module. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:41, 3 May 2023 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 16:56, 6 May 2023 (UTC)
::Thank you. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:05, 6 May 2023 (UTC)
 
== Support for rounding ==
 
One of the most common things I do with information I draw from Wikidata using this template is rounding, since it sounds terrible to say "the museum has approximately 14,747 items" rather than "the museum has approximately 15,000 items," which is easier to read and doesn't imply a false precision. However, the current functionality of the module requires me to fetch the raw value, round it, and then fetch the unit/references separately, which is very clunky. Would it be possible to build in functionality for rounding so that this can be simplified and used more widely? <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 21:25, 9 May 2023 (UTC)
 
:Might be better to use the "input" parameter on [[Template:Convert]], then you'll have full access to all of convert's options &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:48, 9 May 2023 (UTC)
::@[[User:MSGJ|MSGJ]], that wouldn't work unless you want to list a conversion, though, right? The specific example that prompted this request doesn't fall into that category (see [[Special:Diff/1154043077|this diff]]), nor do many others. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 22:00, 9 May 2023 (UTC)
:::Oh, I was thinking if there were units then it was probably a convertible quantity &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 22:55, 9 May 2023 (UTC)
 
== Non-ASCII numeric delimiter ==
 
This is probably not so important for enwiki, but people are copying the module to other wikis and might find it useful. When the <code>["numeric"]["delimiter"]</code> in [[Module:Wd/i18n]] is set to a non-7bit-ASCII value (for example, to <code>mw.ustring.char(0x202f)</code>, [[narrow no-break space]]) the <code>:reverse</code> method reverses UTF character bytes in
:<code style="font-size:90%">return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter'])''':reverse())''' .. right</code>
A quick solution is to first use some symmetric ascii-7 ''improbable'' character combination, such as <code>!@!</code>:
:<code style="font-size:90%">local temp_delimiter = (num:reverse():gsub("(%d%d%d)", "%1" .. "!@!"):reverse())</code>
:<code style="font-size:90%">return left .. temp_delimiter:gsub("!@!", p['numeric']['delimiter']) .. right</code>
[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 14:33, 26 May 2023 (UTC)
 
== References mapping ==
 
I cannot find the discussion, but I know I've talked a bit previously about how it can be difficult to map the properties used for references on Wikidata to the CS1 parameter fields here on Wikipedia, particularly when it comes to the website/work fields.
 
The [[Template:Wikidata#References|current mapping]] uses {{wpl|P248}} for {{para|website}}. That's generally good, although I often see "stated in" (mis-?)used on Wikidata for things that we'd consider here to be a publisher because they're not italicized (whereas websites/works are italicized). However, there are also other related Wikidata properties.
 
{{wpl|6333}} is sometimes used when the work/website doesn't have its own item. I think that it should probably map to {{parameter|website}}.
 
{{wpl|1433}} is also sometimes used. The distinction between it and "stated in" doesn't appear to be as well-defined as it could be.
 
I'd appreciate some high-level discussion about how we could improve this mapping. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 20:49, 7 June 2023 (UTC)
:{{slink|Template:Cite_Q|Bibliographic_parameters}} is the only listing that I know of; is that it?
:
:The talk page of lua module does not seem to me to be very {{tq|high-level}}. Perhaps find a more publicly visible place for your discussion?
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 21:27, 7 June 2023 (UTC)
:
:There are two other short lists at {{slink|Module:Wd|References}}.
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 21:33, 7 June 2023 (UTC)
::On visibility, I've notified [[WT:CS1]], [[WT:Wikidata]], and [[wikidata:Wikidata:Project chat]]. Together those will hopefully bring in some folks.
::The lists at [[Template:Wikidata#References]] are what I'm referring to, although it's interesting to see that Cite Q has its own list. We certainly want those to be in sync with each other. Cheers, <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 21:46, 7 June 2023 (UTC)
:I gotta say, I rarely use the work / website parameters with any kind of precision. Lots of times the citation is to a source that's published in print but accessed via the internet. I do a lot of cleanup of script-assisted refercing, and if the script does something dumb like keep the name of the website after a pipe or ndash in the {{code|1=title=}} parameter while filling out the {{code|1=website=}} parameter with the first bit of the URL, I'll just reparameterise the human-readable name of the website to {{code|publisher}}, since it displays the same to the reader. Also since you can't double up on {{code|website}} and {{code|work}}, I've put the name of the periodical (or whatever) in the {{code|work}} parameter, and the website in {{code|1=via=}}. I hope nothing critical is depending on using these parameters precisely, and if so I'd recommend as a first step that Citoid change its output from {{code|1=website=}} to {{code|1=via=}}. [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 23:35, 7 June 2023 (UTC)
::The cs1|2 templates produce [[COinS]] metadata for those readers who consume citations with reference management software ([[Zotero]] is one such tool – which, by the way, is a significant contributor to Citoid... we cannot complain about the quality of the data that it produces without we first put our own house in order). {{para|publisher}} is not defined for, so not included in, the metadata for {{tlx|cite web}} or for any of the periodical templates ({{tlx|cite journal}}, {{tlx|cite magazine}}, {{tlx|cite news}}). {{para|work}} is a generic alias of {{para|journal}}, {{para|magazine}}, {{para|newspaper}}, {{para|periodical}}, and {{para|website}}. Omitting these parameters from their associated templates prevents that important bit of bibliographic data from getting to Zotero and other reference management software. Similarly, {{para|work}} and its aliases are not defined for, so not included in, the metadata for book, encyclopedia, conference, etc templates.
::
::{{para|via}} is a visual-only parameter not defined for the metadata for any of the cs1|2 templates. It would be very wrong of Citoid to use that instead of the appropriate work parameter. Further, {{para|via}} has a specific purpose: to minimize astonishment when the reader lands at an on-line ___location that is different from the publisher's on-line ___location; see the (not really very good) [[Template:Cite web#csdoc_via|documentation]].
::
::It is good to {{tq|[parameterise] the human-readable name of the website}} but it should not be to {{para|publisher}}. {{para|website}} should only get the ___domain name when the source is best known by that name. See also: {{slink|Help:Citation_Style_1|Work_and_publisher}}. We are citing the publisher's work, not the company.
::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 00:14, 8 June 2023 (UTC)
:::I am trying to create the best citations possible – in general: sometimes I get lazy and perform the reparameterisations described above – and I don't want to come off as oppositional, since I recognise we're on the same team. But if {{code|1=website=}} {{tq|should only get the ___domain name when the source is best known by that name}}, why do scripts assign that parameter the ___domain name more than nineteen times in twenty? Can things be adjusted such that the {{code|1=website=}} parameter gets assigned the ___domain name for a whitelist of domains, a human-readable name when the appropriate function can determine one, and remains unassigned in all other cases? [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 05:16, 8 June 2023 (UTC)
 
== Problem in [[Template:Infobox Russian inhabited locality]] ==
 
I recently edited [[Kazan]] as part of a [[User:XOR'easter/sandbox/ReferenceExpander|citation repair project]], and one of its references displays the pink text {{!bxt|Error: Unable to display the reference properly. See the documentation for details.}}, with "the documentation" linking this module.{{pb}}The error is coming from [[Template:Infobox Russian inhabited locality]], in the bit about 2018 population estimates, where it calls <nowiki>{{wikidata|reference|P1082|P585=2018-01-01}}</nowiki>. I thought I'd ask here if anyone has any ideas how to resolve the error, but I'm open to redirection if there's a better place to ask, whether on wp-en or on wikidata. [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 18:41, 12 June 2023 (UTC)
 
:The issue probably is that the reference for "1,243,500" on [[d:Q900#P1082|Kazan's Wikidata object]] uses {{property|P143}}. —[[User:Dexxor|Dexxor]] ([[User talk:Dexxor|talk]]) 08:02, 13 June 2023 (UTC)
::<s>According to the documentation {{Q|P143}} references should be ignored. So perhaps the error is coming from the second reference (maybe the Russian title) instead?</s> More testing is needed. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 10:11, 13 June 2023 (UTC)
::Correction - the error ''is'' coming from the first reference. The module is correctly ignoring {{Q|P143}}, but then all it has is the {{Q|P854}} without any title so it can't use {{tl|cite web}}. If you add {{Q|P1476}} to the first reference, then it use the first reference. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 10:15, 13 June 2023 (UTC)
::I suspect what we would like to do is to ignore the whole reference if ''any'' of the reference properties include {{Q|P143}}. That would be a significant change to the way the module is currently coded. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 10:26, 13 June 2023 (UTC)
:::Can I ask, what would be the positives of doing so? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 06:40, 18 June 2023 (UTC)
:For now I have [https://www.wikidata.org/w/index.php?title=Q900&diff=prev&oldid=1914299740 deleted] the URL which was a dead link anyway. It now correctly displays the second reference for that value. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 10:29, 13 June 2023 (UTC)
 
Testing on {{Q|Q4115189}}:
{{wikidata|reference|Q4115189|P1082|P585=2018-01-01}}
{{reftalk}}
 
== {{wpl|P4656}} should be ignored ==
 
This module should ignore {{wpl|P4656}}. I have made a fix to [[Module:wd/sandbox|the module sandbox]]. For a sample output, see [[User:Janhrach/sandbox|my sandbox]]. Apart from ignoring P4656, my code ignores {{wpl|P813}} when P4656 is present but {{wpl|P854}} is not, as it is probable that P813 belongs to P4656. If there are no issues with my suggested changes, I'll file an edit request in several days. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 08:18, 18 June 2023 (UTC)
 
=== Edit request on 23 June 2023 ===
{{edit template-protected|Module:Wd|answered=yes}}
Please copy the contents of [[Module:wd/sandbox|the module sandbox]] to [[Module:wd|the main module page]]. The explanation of the changes is above. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:17, 23 June 2023 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 01:55, 24 June 2023 (UTC)
 
== gsub pattern bug? ==
 
I was editing the module on another wiki and the editor warned me of an invalid escape sequence in
:<code>mw.ustring.gsub(datavalue['amount'], "^\+(.+)$", "%1")</code>
 
If I'm reading [https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Character_class the manual] correctly, the escape character is indeed %, not \. So <code>\+</code> should be replaced with <code>%+</code> (twice). [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 21:44, 25 May 2023 (UTC)
:You are probably correct but try these in the debug console:
:#<code>=string.gsub ('+something', "^\+(.+)$", "%1")</code> → something 1
:#<code>=string.gsub ('+something', "^+(.+)$", "%1")</code> → something 1
:#<code>=string.gsub ('+something', "^%+(.+)$", "%1")</code> → something 1
:Number three is probably the 'most' correct. I expect that number 2 works because is doesn't make sense to quantify the zero-width assertion <code>^</code>. Does number 1 work because of a flaw? because <code>\</code> is a character-in-a-string-escape-character (similar to: <code>local pear_type_str = 'D\'Anjou'</code>)? I don't actually know.
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 22:25, 25 May 2023 (UTC)
::I'm only guessing (and mostly repeating your ideas), but it could be that whatever parses that pattern-string first reduces #1 to #2 (there's a mention of something similar with \ddd), which then works because + means nothing but + after that ^. I'd still fix this, so people don't get confused by those two error messages (❌). [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 23:47, 25 May 2023 (UTC)
:::What {{tq|error messages}}?
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 23:49, 25 May 2023 (UTC)
::::Start editing, next to line number 405 there's gonna be a red square that'll show the error message. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 09:39, 26 May 2023 (UTC)
:::{{ping|Ponor}} I've investigated this a bit and I've come to the same conclusion as you. But is using <code>gsub</code> really necessary? <code>tonumber</code> doesn't seem to have problems with <code>+</code> at the beginning of its input, so I think that removing the plus sign is unnecessary. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:49, 25 June 2023 (UTC)
::::@[[User:Janhrach|Janhrach]], I agree. It's just hard to tell what made people put it there, maybe things did not work back then. Which is not the reason to keep it there forever. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 15:26, 26 June 2023 (UTC)
:::::I've fixed the error in the sandbox by removing <code>gsub</code>. After that, another error of nearly the same kind was shown by the editor on the line 875, which I fixed by replacing <code>\</code> whith <code>%</code>. I have a sample output in [[User:Janhrach/sandbox|my sandbox]]. I've verified both of the examples execute the altered code lines and that output is also correct when <code>+</code> shouldn't be stripped from the input. If there is no problem with my changes, I'll make an edit request soon. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 11:56, 27 June 2023 (UTC)
 
=== Edit request on 30 June 2023 ===
 
{{edit template-protected|Module:Wd|answered=yes}}
Please copy the contents of [[Module:wd/sandbox|the module sandbox]] to [[Module:wd|the main module page]]. The explanation of the changes is above. For context, read the whole discussion please. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:58, 30 June 2023 (UTC)
:{{done}}<!-- Template:ETp --> &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 14:14, 30 June 2023 (UTC)
::Thank you. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:14, 30 June 2023 (UTC)
 
== Possible bug on Mark Lewis page ==
 
I am getting citation errors on the page [[Mark Lewis (filmmaker)]] for the code {{code|<nowiki>{{wikidata|references|P800}}</nowiki>}} Usually, that kind of error is caused because Wikidata doesn't have enough information to produce a valid citation. However, in this case, the citation information on Wikidata at [[d:Q6768591#P800]] is more than adequate. Is this a bug or am I using the template incorrectly? [[User:Daask|Daask]] ([[User talk:Daask|talk]]) 06:23, 6 July 2023 (UTC)
 
:{{ping|Daask}} Thank you for noticing this, it is a bug – the module doesn't recognize {{property|P1433}}. I will make an edit request fixing the bug soon. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:52, 6 July 2023 (UTC)
 
=== Edit request on 8 July 2023 ===
{{edit template-protected|Module:Wd|Module:Wd/i18n|answered=yes}}
Please copy [[Module:Wd/sandbox]] to [[Module:Wd]] and [[Module:Wd/sandbox/i18n]] to [[Module:Wd/i18n]]. It is a fix for the bug reported above. Sample output is [[User:Janhrach/sandbox|here]]. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 07:22, 8 July 2023 (UTC)
: {{done}} And you should consider [[WP:PERM/TPE|requesting template editor rights]], since you seem to know what you are doing. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 18:08, 10 July 2023 (UTC)
::Thank you, I will consider that option. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:52, 10 July 2023 (UTC)
:::Update: I don't satify the criteria 3 and 5 [[WP:TPEGRANT|here]], but when I will, I will make a request. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:31, 10 July 2023 (UTC)
:::: Looks like you satisfy 3 to me: Per [https://xtools.wmcloud.org/ec/en.wikipedia.org/Janhrach edit counter tools], 135 module edits + 18 template edits = 153 total edits. I agree that you're technically 1 sandbox short of 5. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 19:49, 10 July 2023 (UTC)
:::::{{ping|Pppery}} Oh, thank you for noticing that, I didn't to look at the template namespace, because I mistakenly thought my edit count there is negligible. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 12:45, 11 July 2023 (UTC)
 
== Thousands of broken references ==
 
Looking at [https://en.wikipedia.org/w/index.php?limit=500&offset=0&profile=default&search=%22Error%3A+Unable+to+display+the+reference+properly.+See+the+documentation+for+details%22&title=Special:Search&ns0=1 this search] there appears to be thousands of articles with reference errors resulting from imports from Wikidata. Is there any category tracking these errors or anyone attempting to fix the underlying issue? -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 13:11, 23 June 2023 (UTC)
 
:@[[User:ActivelyDisinterested|ActivelyDisinterested]], I've tried <nowiki>{{#invoke:wd|reference|raw|Q43148|P8843|P585=2000}}</nowiki>→{{#invoke:wd|reference|raw|Q43148|P8843|P585=2000}} It was missing a title on wikidata. Year 2003 is *still* without a title (here: {{Q|Q43148}}), so <nowiki>{{#invoke:wd|reference|raw|Q43148|P8843|P585=2003}}</nowiki>→{{#invoke:wd|reference|raw|Q43148|P8843|P585=2003}} [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 14:08, 23 June 2023 (UTC)
::Thanks but that's not what I'm asking. There are thousands of these, I'm wondering if that is being tracked. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 14:22, 23 June 2023 (UTC)
:::There is, apparently, no tracking in this module. We could add a category link, perhaps {{cl|Module:Wd reference errors}} or some such, to the error message at [[Special:Permalink/1153479440#L-14|Module:Wd/i18n line 14]]. Is there a better category name?
:::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:44, 23 June 2023 (UTC)
::::"Module:Wd reference errors" would be fine, but "Wikidata reference errors" could be more obvious. Also is there anyway to make the error more prominent? The more obvious the error the more motivated people are to fix them. At the moment the error in down in the reference section, but could it be displayed instead of footnote number? -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 15:14, 23 June 2023 (UTC)
:::::These error messages are specific to this module, not to all methods of fetching stuff from wikidata. {{tq|could it be displayed instead of footnote number?}} What do you mean by that?
:::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 15:31, 23 June 2023 (UTC)
::::::I thought that that might be the case, "Category:Module:Wd reference errors" would be fine.
::::::I mean could an error be displayed where the citation in the text would be, rather than in the reference section. So rather than <sup>[1]</sup>, there would be a message <sup>[some cutdown version of the error message]</sup>. Similar to how other inline messages work. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 15:56, 23 June 2023 (UTC)
:::::::What {{tq|inline messages}} replace a superscript reference indicator with a plain-text message? I have seen messages (as separate templates – {{tlx|failed verification}} for example) follow the reference indicator but never an outright replacement. I'm not enthusiastic about figuring out how to do that and am not sure it is desirable were it doable – I'm not really interested in doing significant work on this module. I am willing to add the category but beyond that, I leave it to someone else.
:::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 17:30, 23 June 2023 (UTC)
:::::::
:::::::{{cl|Module:Wd reference errors}} created.
:::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 17:42, 23 June 2023 (UTC)
::::::::Thanks Trappist. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 18:16, 23 June 2023 (UTC)
 
*After a bit of work with [[User:Ponor|Ponor]] I've just put through a set of titles for refs on Philippine town items, which should clear about 1500 pages out of this category when it's finished processing (hopefully later tonight). Sampling some of the others I think the majority are likely to be also missing a "title" field. However, there are a few complicated ones - eg I have no idea what is going on with [[Canadian English]], where the references ''seem'' to have the right metadata. [[User:Andrew Gray|Andrew Gray]] ([[User talk:Andrew Gray|talk]]) 22:38, 27 June 2023 (UTC)
*:Just to be clear, it was my unsuccessful attempt, and Andrew was kind enough to sort things out properly. I'm only thinking: wouldn't it be better to have a link in those red messages that takes you straight to wikidata, where a title is missing, instead of the generic message that leaves you clueless where and what needs to be done? [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 23:56, 27 June 2023 (UTC)
*:It's already at least 1400 down, nicely done. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 00:44, 28 June 2023 (UTC)
*::Thanks! Cleared off another 200-odd now. I think that might be the easiest ones but I'll see if there's others that can be solved in a batch - there seems to be some possibilities with Swiss data there but I haven't quite disentangled it yet.
*::Looking at [[Canadian English]] which I mentioned above, I ''think'' the problem here is that the reference statements have {{wpl|1810}}. This isn't supported by the mapping for either {{tl|cite web}} or {{tl|Cite Q}}, which I think is why it's going to an error message.
*::This particular case is a weird one, but in general this is a fairly common pattern for things which are sourced with an ID property - combine "named as" with {{wpl|248}} and an ID property - [https://www.wikidata.org/wiki/Q7529556#Q7529556$2FEF861C-EB11-49DC-9CFA-44EDB35A407E example]. I wonder then if it would be worth tweaking Cite Q so that it can treat {{wpl|1810}} as a backup to {{wpl|1476}} if an actual title is not present (the ID properties are already supported by Cite Q). That might clean up a swathe of them. [[User:Andrew Gray|Andrew Gray]] ([[User talk:Andrew Gray|talk]]) 23:26, 28 June 2023 (UTC)
*:::Don't quote me on this, but I believe this is all using Cite Web not Cite Q. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 00:29, 29 June 2023 (UTC)
*::::{{ping|ActivelyDisinterested}} Yes, you are right. And {{ul|Andrew Gray}} is right that the problem is with {{property|P1810}}. I think it is a good idea to modify this module to use P1810 as title when {{property|P1476}} is not present. By the way, I thank Andrew Gray very much for his work on eliminating the errors. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:32, 30 June 2023 (UTC)
*:::::I've implemented the suggested changes in [[module:wd/sandbox|the sandbox]]. A sample output is in [[user:Janhrach/sandbox|my sandbox]]. The first test shows that the module correctly removes {{property|P1810}}. The second and the third reference in the second test shows that the module uses P1810 as the title if {{property|P1476}} is missing. However, the output isn't correct – the replaced title is actually the name of the database. But this is just a consequence of the incorrect handling of database references. Until I will have completely fixed the handling of database references, I am not going to make an edit request fixing P1810. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:34, 1 July 2023 (UTC)
{{od}}{{ping|ActivelyDisinterested|Andrew Gray}} I've fixed the handling of database references. The sample output in [[User:Janhrach/sandbox|my sandbox]]. Previously, database references were displayed using Cite Q with an additional id parameter, see for example the reference no. 8 in my sandbox. Now, the module fetches {{property|P1687}} properties from the item in {{property|P248}}. Then a URL is generated from the first P1687 whose datatype is external-id and is present in the reference; the generated URL is then handled in the same manner as {{property|P854}}. Additionally, I have modified the handling of {{property|1810}} to use it as title only when a URL is present to avoid bugs. I would be happy if you reviewed my code. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:28, 3 July 2023 (UTC)
 
:@[[User:Janhrach|Janhrach]] the output there looks good, thankyou for looking into it! [[User:Andrew Gray|Andrew Gray]] ([[User talk:Andrew Gray|talk]]) 21:20, 4 July 2023 (UTC)
:I was hoping this would help clear down the cat, big it's doesn't seem to have happened. Wasy expectation wrong or is there some other update that has to happen? -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 12:14, 11 July 2023 (UTC)
::{{ping|ActivelyDisinterested}} I think most of the errors are caused by missing titles in URL-only references or similar. That couldn't be fixed any other way than by improving Wikidata. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 12:37, 11 July 2023 (UTC)
:::Thanks for the explanation. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 12:39, 11 July 2023 (UTC)
::::@[[User:ActivelyDisinterested|ActivelyDisinterested]] I think someone may have enabled a new infobox lookup or similar as well - it was down to about 1000 at one point and has now risen again. So I guess that new additions are outpacing any corrections. Wonder if it's possible to track those numbers somehow, hmm.
::::I'll see if I can figure out some more potential batch fixes on the WD side to try and bring it down again. [[User:Andrew Gray|Andrew Gray]] ([[User talk:Andrew Gray|talk]]) 16:59, 11 July 2023 (UTC)
:::::[https://petscan.wmflabs.org/ PetScan] allows you to output the content of categories (the output tab allows you to download the results). I do the same for my work on [[:Category:Harv and Sfn no-target errors]]. It would manually running the scan periodically though. -- LCU '''[[User:ActivelyDisinterested|ActivelyDisinterested]]''' <small>''∆[[User talk:ActivelyDisinterested|transmissions]]∆'' °[[Special:Contributions/ActivelyDisinterested|co-ords]]°</small> 17:58, 11 July 2023 (UTC)
::::::Very belatedly, but FYI I'm now running a regular script to check on this - logs the current number and the most recent item. Usually drifts down by a couple of items a day. Will keep an eye out for sudden spikes which indicate a batch that could be addressed.
::::::After some further investigation, it looks like the vast majority of these seem to be software version numbers that reference the release notes with a plain URL, and while it's straightforward to add a title to the reference ''manually'', it's unfortunately a bit beyond my abilities to write up a bot to do it at scale. [[User:Andrew Gray|Andrew Gray]] ([[User talk:Andrew Gray|talk]]) 20:58, 8 August 2023 (UTC)
 
=== Edit request on 5 July 2023 ===
{{Edit template-protected|Module:Wd|answered=yes}}
Please copy [[Module:wd/sandbox|the sandbox]] to the [[Module:wd|main module page]]. The new code fixes handling of database references (as described in my last reply in this discussion) and uses {{property|P1810}} as the reference title when a URL is present in the reference but {{property|P1476}} is not. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 12:15, 5 July 2023 (UTC)
 
:{{complete2}}. '''''[[User:Paine Ellsworth|<span style="font-size:92%;color:darkblue;font-family:Segoe Script">P.I.&nbsp;Ellsworth</span>]]'''''&thinsp;,&nbsp;[[Editor|<span style="color:black">ed.</span>]]&nbsp;[[User talk:Paine Ellsworth|<sup>put'er&nbsp;there</sup>]]&nbsp;<small>16:42, 5 July 2023 (UTC)</small>
::Thank you. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:34, 5 July 2023 (UTC)
:::''Happy to help!''&nbsp;'''''[[User:Paine Ellsworth|<span style="font-size:100%;color:darkblue;font-family:Segoe Script">Paine</span>]]'''''&nbsp;&nbsp;<small>18:56, 5 July 2023 (UTC)</small>
 
== Using appropriate CS1 templates ==
 
It appears that {{t|Wikidata}} always uses {{t|Cite web}}. Sometimes that differs a bit from e.g. {{t|Cite news}} or other CS1 templates, though. Would it be possible to improve the module so that it recognizes when it's citing a newspaper/book/journal and uses the appropriate template? <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 04:23, 2 September 2023 (UTC)
 
:{{ping|sdkb}} Basically, there are two types of sources on Wikidata: ones using {{property|P248}} and ones using {{property|P854}}. Per [[Wikidata:Help:Sources]], newspapers, books and journals should use the former option. Only citations containing P854 are formatted using {{tl|Cite web}}. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 06:48, 2 September 2023 (UTC)
::This touches on [[Module_talk:Wd#References_mapping|the discussion about mapping above]]. Currently, for something like a newspaper article, the correct procedure seems to be to use {{wpl|P248}} for the newspaper name and {{wpl|P854}} for the article URL. Only using P248 would be an incomplete citation, as it would not lead back to the specific article. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 16:02, 2 September 2023 (UTC)
:::{{ping|Sdkb}} {{property|P248}} should contain not the newspaper item, but the article item. The Wikidata guideline says that every cited article should have its own item. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 06:45, 3 September 2023 (UTC)
::::@[[User:Janhrach|Janhrach]], that would be wildly impractical for simple newspaper articles. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:40, 3 September 2023 (UTC)
:::::{{ping|sdkb}} I understand, but that's a Wikidata policy. I am not sure, but I think I have read somewhere on Wikidata about a tool for generating newspaper article items on demand – it may be useful. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:06, 9 September 2023 (UTC)
 
== Coordinates precision ==
 
Forgive me my laziness, I'm hoping someone will know the answer without digging too deep into the code. I would like <code><nowiki>{{#invoke:Wd|property|Q522100|P625|P518=Q1233637}}</nowiki></code> to return
* <code>43°26'N, 16°41'E</code>
instead of
* <code>{{#invoke:Wd|property|Q522100|P625|P518=Q1233637}}</code>.
How do I set the precision? I see it in the code, but not in any of the examples. Thanks. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 15:13, 24 September 2023 (UTC)
 
:{{ping|Ponor}} The code probably uses the precision set in Wikidata, not in Wikipedia. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:38, 27 September 2023 (UTC)
 
== Built-in citation needed function ==
 
Would it be possible to build in a mechanism for the references function of {{t|Wikidata}} to output a {{t|Citation needed}} tag if it does not come up with any references? For instance, when we use the template to fetch the number of students at a university, it's theoretically possible that someone in the future will update the {{wpl|2196}} (setting the more recent value to preferred rank) but not add references. If that happens, it'd be nice for there to be a citation needed tag rather than for the references function to just not display. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 04:21, 4 October 2023 (UTC)
:I'm seeing a use case for this sort of thing at [[Associated Students of Pomona College]], where [[Module:WikidataIB]] should be used instead of this module, per the documentation and a related RFC. Using that module will take care of sourcing for you and will decline to show data when sourced numbers are not available. You could tell the module what to display or output a tracking category if if can't get a sourced number. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 04:57, 4 October 2023 (UTC)
::@[[User:Jonesey95|Jonesey95]], thanks for the reply; I'll look into converting to [[Module:WikidataIB]] there. The particular use case that prompted me to ask here was the first sentence of {{section link|Pomona College|Student body}}, where the number of students is used in the prose, so just blanking isn't an option. When I was updating [[wikidata:Q7227384#P2196|the data]] for this semester on Wikidata, I tried waiting a moment to add the reference for the new data, hoping that I'd configured the <code>single</code> flags (or whatever it is I need to be configuring; perhaps I need to only allow <code>preferred</code>-ranked data?) well enough that it would identify that a reference is missing. But it just spit out all the references for the old data instead. The flags are a confusing enough part of the template that I just haven't been able to get them to work quite right. <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 05:41, 4 October 2023 (UTC)
::As far as I know WikidataIB does not yet display any references &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 09:06, 4 October 2023 (UTC)
 
== Adding names to the coordinates list ==
 
I'm using {{tl|GeoGroup}} on [[Misty Range]] where I pull the coordinates into the table of mountains using {{tl|wikidata}}:
<br/>e.g. <nowiki>{{wikidata | property | page=Mount Rae | linked | coord}}</nowiki> <br/>That works fine but when I click the OpenStreetMap link, the coordinates list on the left is showing "#1", "#2", "#3", "#4" for the names/labels for each coordinate. If you call {{tl|coord}} directly and pass the ''name'' parameter, then OSM will display that name rather than "#1". However, I don't see how can set the coordinates name when I'm using {{tl|wikidata}} to extract the coordinates. [[User:RedWolf|RedWolf]] ([[User talk:RedWolf|talk]]) 22:10, 4 September 2023 (UTC)
 
:{{ping|RedWolf}} From a quick look at the source code of the module, it seems that is doesn't implement named coordinates. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:55, 14 September 2023 (UTC)
 
:*Thanks. I wonder if we could add a new named argument such as "coords_title" and then modify Config:getValue() to append this argument (if given) to the URL it builds when datatype = 'globecoordinate'. [[User:RedWolf|RedWolf]] ([[User talk:RedWolf|talk]]) 17:19, 23 September 2023 (UTC)
 
*I have created [[Module:Titled_coords]] and its helper template {{tl|Titled_coords}} to address this issue. [[User:RedWolf|RedWolf]] ([[User talk:RedWolf|talk]]) 21:33, 20 October 2023 (UTC)
 
== Edit request ==
 
{{edit template-protected|Module:wd|answered=yes}}
Line 2006: please change "crimson" to "#d33" per above. Also change "4" on the line 1819 to "5".
[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:26, 26 October 2023 (UTC)
:{{done}}<!-- Template:ETp --> – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 14:36, 26 October 2023 (UTC)
 
== Problems with this module ==
 
I get it, semantic web shit is cool for nerds, but this doomed tech experiment is hurting Wikipedia instead of helping it. The people responsible should switch focus; their goal should be to help Wikipedia editors and not the likes of Google and LLMs and other cringe techbro buzzwords. I understand that the ideal solution, getting rid of wikidata, will not happen, so we should try to minimize the harm it is causing.
 
There are a bunch of problems with this module:
 
# This module shows errors, but it is '''not clear how to fix''' the errors unless you spend 73 hours trying to understand how it and Wikidata work. The solution should be two-fold:
#* It should be made clear on wikidata ''and'' in the article which attributes are missing/incorrect. Nota bene, currently this is explained in neither of those places. One or the other is not an acceptable solution. It should be explained in both places.
#* Someone should write a detailed tutorial/helppage. But a link to that is ''not enough''; in addition we need specific instructions which piece of data is causing the problem.
# The warning messages are '''alarmist and displayed very prominently''', even when it is an incredibly minor problem or not a real problem at all. A very large majority of the pages in [[:Category:Module:Wd_reference_errors|Category:Module:Wd reference errors]] do not have a problem that is big enough to warrant such a obnoxious warning message.
#*For example: A reference url without a title (which appears to be optional at Wikidata) is handled poorly. For comparison, <code><nowiki>{{Cite web|url=https://github.com/andresriancho/w3af/releases/tag/1.6.54}}</nowiki></code> produces:<br>[https://github.com/andresriancho/w3af/releases/tag/1.6.54 https://github.com/andresriancho/w3af/releases/tag/1.6.54]. <span style="color:#d33">{<nowiki/>{</span>[https://en.wikipedia.org/wiki/Template:Cite_web cite web]<span style="color:#d33">}}: Missing or empty |title= (</span>[https://en.wikipedia.org/wiki/Help:CS1_errors#citation_missing_title help]<span style="color:#d33">)</span><br>That still gives a clickable reference and the red message is less prominent. <br>The Wikidata equivalent instead shows nothing. No explanation of what is wrong or how to fix it. All you get is this message that explains nothing and links to generic advice that isn't applicable:<br><span style="color:crimson">Error: Unable to display the reference properly. See [https://en.wikipedia.org/wiki/Module:Wd/doc#References the documentation] for details.</span><br>
#The message '''doesn't even link to the reference URL'''.
#The message '''falsely claims it is an error''' when no error has occured. There is just a missing piece of wikidata. 99.99999% of people who see that message are not willing and able to add that piece of wikidata.
#The message '''doesn't even link to the place on Wikidata''' where the problem is.
#The message uses <span style="color:crimson">crimson</span> while other messages like the cite web template use <span style="color:#d33">#d33</span>.
 
This means that people would have to read and understand all that documentation, find the ___location where the reference is inserted, figure out they have to click on the pencil icon, discover an entirely new and incredibly unuserfriendly interface on a separate website and figure out how to fix the error there, then go back to the article to see if they actually managed to fix the problem, discover they have not or that there are other problems and repeat the process (newsflash: 99% of Wikipedia editors won't do all that, why are you trying to force them to).
 
Even if you do something that should be simple, e.g. you add an infobox to an article, you get the message and no way to fix it. For example {{tl|Infobox Swiss town}} causes problems for example in [[Lausanne]], [[Geneva]], [[Zug]], [[Montreux]], [[Bern]], [[Solothurn]] (I got too lazy to find more examples).
 
I understand that this is people's baby and the WMF probably wasted a fuckton of money on it; but it should be clear that this is a net negative for 99% of editors at the moment. Things used to be so simple. More complexity is not an improvement. [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 04:00, 24 October 2023 (UTC)
:That is quite a rant. I agree with one point, at least. In [[Lausanne]], reference #2 displays "Error: Unable to display the reference properly. See the documentation for details." instead of displaying "https://www.pxweb.bfs.admin.ch/pxweb/fr/px-x-0102020000_201/-/px-x-0102020000_201.px/table/tableViewLayout2/?rxid=c5985c8d-66cd-446c-9a07-d8cc07276160", which is the source that supports the population figure. Showing only the error message is unhelpful. Showing the URL along with a more explanatory error message would be helpful; something like "Error: url requires title in Wikidata" (with a link to the relevant section of P1082 in the article's Wikidata entry) might lead ambitious editors to fix the actual problem. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 04:26, 25 October 2023 (UTC)
:{{ping|Polygnotus}} On the problems you listed:
:# The relevant section is four-paragraph-long. While it doesn't directly describe how to fix a reference, it makes it clear when is the error printed. Everyone who doesn't understand can ask on this page. Yes, the messages could refer to specific parts of the reference which are invalid, I will work on that later. Note: this module is not directly related to Wikidata as a project, it is a <u>Wikipedia module</u> for rendering data.
:# Yes, the messages should be more specific. As for the messages being too alarmist, see [[Module talk:wd/Archive 1#Reference formatting bug when using "author name string" (P2093)|this discussion]]. [[User:Trappist the monk]] wanted an error message if the reference is not renderable using CS1, and I agree with them.
:# See 2.
:# See 2.
:# Ok, this should also be fixed.
:# This is a minor issue fixable with an edit request.
:In the end, all good arguments against Module:Wd can be summarized into following:
::The error massage should be more specific.
:Right now, I do not spend much time editing Wikipedia. The reference handling function should be cleaned up first. To fix it, it is needed to fix the testcases.
:[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:04, 26 October 2023 (UTC)
::The citation (reference #2 in [[Lausanne]]) is renderable using {{tl|cite web}}, though. It looks like this:
::
::{{cite web|url=https://www.pxweb.bfs.admin.ch/pxweb/fr/px-x-0102020000_201/-/px-x-0102020000_201.px/table/tableViewLayout2/?rxid=c5985c8d-66cd-446c-9a07-d8cc07276160}}
::
::The error message is incorrect. This basic problem is not yet fixed. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 14:44, 26 October 2023 (UTC)
:::{{ping|Jonesey95}} By "renderable using CS1", I meant without errors. Also, I mentioned the phrase only in the last comment. The documentation is more specific.
:::I know the error message should say what extra properties does the reference contain, or which needed properties it does not, but I will fix that later. Maybe the module should leave reporting a missing title for now, as a temporary solution. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:59, 26 October 2023 (UTC)
 
== Bot task: adding "title" to a reference url ==
 
It's Grumpy again; is there a bot that adds the title to a reference URL on Wikidata if its missing? It could simply scrape the HTML <nowiki><title></nowiki> tag. The results wouldn't be perfect, but of course they would be better than the current situation. The bot could leave a short message on the relevant talkpage explaining this is a bot action and humans are invited to make improvements where they see fit. [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 16:58, 26 October 2023 (UTC)
 
:I've asked on Wikidata. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:14, 27 October 2023 (UTC)
::{{ping|Janhrach}} I see your post [https://www.wikidata.org/wiki/Wikidata:Project_chat#Bot-related_question here] but shouldn't we ask on [[WP:BOTREQ]] instead? [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 10:19, 28 October 2023 (UTC)
:::This is an intriguing idea, but it'd have to be handled with care. Bot messages on every talk where this happens is not handling with care (it's asking for "external links modified" 2.0). <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:41, 28 October 2023 (UTC)
:::{{ping|Polygnotus}} (I assume you meant [[d:WD:BOTREQ]]) The page says that asking on the Project Chat is preferable, so I decided to ask there first. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:30, 1 November 2023 (UTC)
 
== Edit request 15 December 2023 ==
 
{{Edit template-protected|answered=yes}}
 
'''Description of suggested change: Add optional globalSiteId parameter, for getEntityId() usage to get the QID from a non-enwiki sitelink'''
 
'''Diff:''' See [[Special:Diff/1190036817]]
 
'''Testcase:''' See [[Special:Diff/1190040466]]
 
Example: {{tq|<nowiki>{{#invoke:wd/sandbox|label|raw|page=Crosslauf-Europameisterschaften 2009|globalSiteId=dewiki}}</nowiki>}} should yield Q1141358. Implemented on sandbox and verified all test cases pass. It should not affect any existing behavior, as it only adds a new feature. If there is no opposition to this change, I can implement it. --[[User:Habst|Habst]] ([[User talk:Habst|talk]]) 16:12, 15 December 2023 (UTC)
 
:What is the use case? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 16:30, 15 December 2023 (UTC)
::@[[User:MSGJ|MSGJ]], in my case, I wanted to use it to help translate foreign-language pages in my userspace. If I could easily (with a regex) translate all <nowiki>[[wikilinks]]</nowiki> in a dewiki article into <code><nowiki>{{#invoke:wd/sandbox|label|raw|page=wikilink|globalSiteId=dewiki}}</nowiki></code> (or a template that would make this syntax shorter), I could combine that with {{tl|LinkedLabel}} to effectively translate all the wikilinks in a dewiki article into their enwiki equivalent titles.
::This is very helpful, because often times when translating an article, even if you understand the words, it can be difficult to know for sure what the appropriate target for a wikilink is. This can currently be done manually by clicking each wikilink in dewiki and then clicking "view wikidata item", but that's a painstaking manual process that only works one link at a time. --[[User:Habst|Habst]] ([[User talk:Habst|talk]]) 21:48, 15 December 2023 (UTC)
:::Okay, sounds like a good idea! &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:52, 15 December 2023 (UTC)
:::: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 23:24, 22 December 2023 (UTC)
 
== Wikidata reference errors at [[Taguig]] ==
 
There are two. I have to go to work soon and don't have time to figure out what's wrong over at Wikidata; can I irresponsibly pass ownership of this problem to someone here who understands how to fix it? [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 13:58, 12 January 2024 (UTC)
 
:Well I've retrieved archived for the deadlinked 2015 and 2019 "poverty incidence" reference URLs at [[:d:Q1643]]: [http://web.archive.org/web/20230404000411/https://psa.gov.ph/sites/default/files/City%20and%20Municipal-level%20Small%20Area%20Poverty%20Estimates_%202009,%202012%20and%202015_0.xlsx 2015], [http://web.archive.org/web/20230404015723/https://psa.gov.ph/sites/default/files/Table%202a.%20Updated%20Annual%20Per%20Capita%20Poverty%20Threshold%2C%20Poverty%20Incidence%20and%20Magnitude%20of%20Poor%20Population%20with%20Measures%20of%20Precision%2C%20%20by%20Region%2C%20Province%20and%20HUC_2018.xlsx 2018].{{pb}}I can't figure out how to edit these in at the Wikidata item (which is greylocked) even in desktop view. [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 03:40, 13 January 2024 (UTC)
:{{ping|Folly Mox}} I have fixed that, the reference had missing a title. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 08:32, 13 January 2024 (UTC)
::Thank you for those fixes. Is there any way the error output of this module could be made a bit more specific? As a moderately technical editor with at least a basic understanding of where to look for Wikidata errors, I'm not sure how long it would have taken me to guess that the problem here was a missing {{code|title}}. [[User:Folly Mox|Folly Mox]] ([[User talk:Folly Mox|talk]]) 15:22, 13 January 2024 (UTC)
:::I have this in my to-do list, but I don't know when I'll do it. The problem is that the testcases are currently triplicated in three pages. I have started centralizing them, but it is tedious and repetitive, so I rarely work on this. I don't want to substatially modify the module until the testcases are ready. So until the testcases are centralized and the module is modified, I will answer editors' questions here. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:37, 13 January 2024 (UTC)
 
== Error ==
 
<code><nowiki>{{wikidata|references|P11698|eid=Q7227384}}</nowiki></code> ({{wikidata|references|P11698|eid=Q7227384}}) is displaying an error, presumably because the module is having trouble with [[wikidata:Q7227384#P11698|the statement]]'s reference including {{wpl|P958}}. It should be mapped to {{t|Cite web}}'s {{para|at}} parameter. Could this be fixed? <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 06:10, 1 February 2024 (UTC)
 
:{{ping|Sdkb}} I have made a fix in the sandbox:
:{{#invoke:wd/sandbox|references|P11698|eid=Q7227384}}
:I am not sure this is how it should be displayed, the meaning of "B22" would not be clear for me if I saw it in a citation while reading. What do you think? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 20:31, 3 February 2024 (UTC)
::{{re|Janhrach}} Looks good to me! My view is that it should be displayed the same as it would in CS1: <ref>{{cite web|title=Pomona College 2023–2024 Common Data Set|url=https://pomona.app.box.com/s/s82xr2o7pptlqxs17reg0nnfyandjcef|publisher=Pomona College|at=B22|access-date=1 February 2024}}</ref> I agree that the display in CS1 isn't ideal, but that's a larger issue for CS1 to deal with (and not a particularly dire one — having the specific ___location might help someone trying to verify the information, but it's not really going to harm anyone confused by it). Cheers, <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 23:01, 3 February 2024 (UTC)
:::Ok, so I will submit an edit request in several days if nobody will have complained. Thank you for reporting this. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 08:14, 4 February 2024 (UTC)
::::@[[User:Janhrach|Janhrach]], seeing no concerns, are we good to implement? <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 03:57, 8 February 2024 (UTC)
:::::{{ping|Sdkb}} Yes, we are. Considering you are a template editor, could you please make the change yourself, so that an edit request isn't needed? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:40, 11 February 2024 (UTC)
::::::{{done}} [[Special:Diff/1206234935|here]]. Please let me know if there are any issues. Cheers, <span style="color:#AAA"><small>&#123;{u&#124;</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}&#125;</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 15:58, 11 February 2024 (UTC)
::::::@[[User:Janhrach|Janhrach]] if you would like the TPE userright, please let me know, as I believe you meet the criteria &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:26, 11 February 2024 (UTC)
:::::::I believe I am one template edited short of one of the requirements. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:29, 18 February 2024 (UTC)
{{reflist-talk}}
 
== Accessing titles from other Wikipedias ==
 
{{courtesy link|Module talk:Wd/Archive 1#Titles from other wikipedias}}
 
Still interested in this feature: given a wikidata Q-id and an ISO-639 code 'xx', return the title of the article at xx-wiki for that item. Perhaps as in this mockup:
: <code><nowiki>{{wikidata|wikipedia|lang=es|eid=</nowiki>[[d:Q43287|Q43287]]<nowiki>}}</nowiki></code> → Imperio alemán
There's also another editor interested in this; adding {{u|Your Friendly Neighborhood Sociologist}}. Thanks, [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 08:59, 14 February 2024 (UTC)
 
:Theres a suggestion on the ''courtesy link''ed page to use <nowiki>{{#invoke:WikidataIB|getSiteLink|qid=Q43287|wiki=eswiki|ps=1}}</nowiki> >> {{#invoke:WikidataIB|getSiteLink|qid=Q43287|wiki=eswiki|ps=1}}, @[[User:Mathglot|Mathglot]]. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 12:18, 16 February 2024 (UTC)
:: {{re|Ponor}} Thank you for your comment. I thought I missed a reply in that discussion or something, but it turns out that it came from a different discussion in section {{slink|Module talk:Wd/Archive 1|Getting values (labels) from a local Wikipedia|nopage=yes}}, and unfortunately I never saw that one. Also, I believed the [[Special:Diff/1019358531|response]] I got in the original discussion that it wasn't possible, so this is a very pleasant surprise. That's some eagle-eyed sleuthing; thanks again! [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 23:12, 16 February 2024 (UTC)
:::Oh... thank you, @[[User:Mathglot|Mathglot]], I learned something new too. This could be made into a separate template, if needed, so other people can find it: {{tlx|sitelink|qid|wiki}} // {{tlx|sitelink|Q43287|es}} → [[:es:{{#invoke:WikidataIB|getSiteLink|qid=Q43287|wiki=eswiki|ps=1}}]], or whatever you wanna to call it. It's a 10 minute job. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 23:50, 16 February 2024 (UTC)
:::: {{re|Ponor}}, yeah, and creating a template wrapper for it got added to my list the minute you replied and I saw it was workable. Only for me, it's more like a 2–3 hour job: ten minutes to code and test it, just as you say; then maybe 30-45' to write the doc page and maybe create a couple of template shortcuts, and another hour-plus or so to hunt down some RW examples in a few languages, and another hour or so to write the test cases page. Maybe I need to go to perfectionist jail for a while {{wink}}. I think it might need several redirect names; probably 'sitelink' is a good template name, but won't mean much to those who think 'foreign wikipedia title' and it's not obvious to me how to ensure it is findable; all your suggestions would be welcome.
:::: As it happens, I'm deep into a wrapper creation right now: [[Draft:HasTemplate]], which is going to be incredibly useful once it is released. It's got a backstory that is turning out to be a lot more complex than I ever expected; you can look at [[Template talk:Template parameter value#Can it just detect if the template is there|this discussion]] if you're curious, but fair warning: it really gets into the weeds on some things, so what I thought was going to be a terse, one-sentence, one-response discussion, is way more than that. (Feel free to wade in there, if you're not afraid of drowning in the details.) So, I will definitely write {{tl|sitelink}} (or whatever we decide to call it) but you never know when something that seemed like a ten-minute thing at the time, turns out to have all sorts of little issues around it and goes on a lot longer, but I hope not! [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 00:33, 17 February 2024 (UTC)
:::::Well... I did something here: [[Template:Sitelink]] :) People will probably find it in its category, with other similar templates. Need to figure out how to make the foreign titles wikilinked, nothing like <nowiki>[[:es:xxxx|]]</nowiki> worked.
:::::* <nowiki>{{sitelink|es|qid=Q43287}}</nowiki>: {{sitelink|es|qid=Q43287}}
:::::* <nowiki>{{sitelink|fr|title=German empire}}</nowiki>: {{sitelink|fr|title=German empire}} (was cheap to get)
:::::* <nowiki>{{sitelink|fr}}</nowiki> in any article should also work
:::::Feel free to play further! And whoever's reading this. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 01:22, 17 February 2024 (UTC)
:::::: Well, you just saved me ten minutes. {{wink}} (I went ahead and updated the doc a bit more; see what you think.) I tested {{tlx|sitelink|fr}} at [[German Empire]], and it worked perfectly, although there probably won't be much call for that. On the other hand, being able to use it from the associated Talk page would be very useful; I tested it at [[Talk:German Empire]], and of course no big surprise that it returned empty. Any way it could be updated to detect namespace, i.e., switch to {{tl|SUBJECTPAGENAME}} if it were on the Talk page? That would be very useful. [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 02:52, 17 February 2024 (UTC)
:::::::@[[User:Mathglot|Mathglot]]: I have a few usecases on my 'other' wiki, for example when pointing readers to full documentation page for templates taken from enwiki, as in {{sitelink|hr|title=Template:Get QID|linked=x}} (ha! I used <nowiki>{{sitelink|hr|title=Template:Get QID}}</nowiki> here). I'm pretty sure something can be done about the talk pages, let me think about it. Should that be one wiki's talk page to another wiki's talk page or something else? One can always use QIDs and page titles, I wonder if adding more complexity to our little wrapper template would be worth it. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 14:17, 19 February 2024 (UTC)
 
== "Not enough memory" errors ==
 
At [[Comparison of cross-platform instant messaging clients]], many of the table entries are displaying {{red|Lua error: not enough memory.}} for various {{tl|wikidata}} calls. I don't know anything about wikidata lookups, just passing along a message left on that article's talk-page. [[User:DMacks|DMacks]] ([[User talk:DMacks|talk]]) 04:13, 27 February 2024 (UTC)
:And it would be nice to have a better fallback in the future. Clicking on the links results currently in a not very helpful popup. https://i.imgur.com/IyXvE6p.png & [[MediaWiki:Scribunto-common-no-details]] should probably link to this page so people can get help if they need it & [[MediaWiki:Scribunto-lua-error]]. [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 04:33, 27 February 2024 (UTC)
::FWIW: The article source, at the bottom, shows "Lua memory usage: 52428782/52428800 bytes" in the limit report. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 18:28, 28 February 2024 (UTC)
 
== A systematic way to avoid reference errors may be needed ==
I wonder, looking at [https://en.wikipedia.org/w/index.php?title=Category:Module:Wd_reference_errors&from=Com just the "Comparison of ..."] articles in {{cl|Module:Wd reference errors}} (currently 1,181 pages), whether a change to the module might help fix some of these errors. Having an error message displayed instead of a reference, especially when nothing has changed in the Wikipedia article, is not good practice. It may be helpful for someone familiar with this module and with Wikidata's structure to look through a sample of these errors to see if a default setting like "prefer the most recent reference when a reference is requested" or a similar preference might help fix some of these errors. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 18:55, 28 February 2024 (UTC)
 
:{{ping|Jonesey95}} The vast majority of the errors are caused by missing titles. The error messages were introduced into this module as a result of [[/Archive_1#Reference formatting bug when using "author name string" (P2093)|this discussion]]. I do agree that the current message, which doesn't specify what exactly caused the issue, is not good, and I plan to fix that in some time. However, this might be a complex problem, and I don't think I will have time for that in several months, at least.
:As for the errors specifically, you might want to propose a change the module to not need titles in Wikidata references. In that case, you should read the mentioned discussion. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:51, 5 March 2024 (UTC)
::A template-based reference that is missing a title is (a) incomplete, and should generate an error message, and (b) should generate an error message saying specifically that the title is missing. I hope that will not be difficult to achieve. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:15, 5 March 2024 (UTC)
:::So we can do nothing about the number of the errors, except editing Wikidata. (Making a Wikidata bot adding titles to references is possible, but I can't do so.) As for no. 2, I am going to fix that ''sometime''. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:59, 5 March 2024 (UTC)
::::A missing title is not an error and should not generate an error message. I asked about making a wikidata bot to add titles to references and all I got was [[Module_talk:Wd/Archive_1#Bot_task%3A_adding_%22title%22_to_a_reference_url]] 6 months ago you also said "''Right now, I do not spend much time editing Wikipedia''".[https://en.wikipedia.org/w/index.php?title=Module_talk:Wd&diff=next&oldid=1181989022] Why do we have to depend on 1 busy volunteers spare time to fix this important problem? Perhaps some of that $180.2 million of WMF revenue could be spent on something actually useful? [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 20:24, 5 March 2024 (UTC)
:::::See [[WP:BAREURL]]. If not an error message, then at least append {{tl|Bare URL inline}} to tag the reference for cleanup. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 20:31, 5 March 2024 (UTC)
 
== Reference call returns blank on te.wikipedia.org in one case ==
 
On te.wikipedia.org, the code used in infobox template for displaying reference is not working in some cases.
Example url: https://te.wikipedia.org/wiki/%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%A4%E0%B1%8D%E0%B0%AF%E0%B1%87%E0%B0%95:ExpandTemplates
 
template code that does not work<br>
 
<nowiki>{{#invoke:wd|references|Q18395504|P2046}}</nowiki>
 
similar template code that works<br>
 
<nowiki>{{#invoke:wd|references|Q18395504|P1082|P585=2011}} </nowiki>
 
 
On en.wikipedia.org at the URL https://en.wikipedia.org/wiki/Special:ExpandTemplates the code works for both cases.
 
The Templates and Modules involved are replicated on Telugu Wikipedia from English Wikipedia. I request help to address the problem.--[[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 10:43, 20 February 2024 (UTC)
 
:{{ping|Arjunaraoc}} I think I have found out the cause of the issue, but I am not certain. Could you send me more examples of this bug?
:I didn't have much time for Wikipedia recently, and I think I won't have in the immediate future, so don't expect this to be fixed in less than ~2 weeks. I will ping you when a fix is ready. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:19, 23 February 2024 (UTC)
::@[[User:Janhrach|Janhrach]], The code that I cited is used in 670+ pages on Telugu wikipedia. I found the references call with P854, P1476 working properly ([[d:Q60165513]] and corresponding Telugu Wikipedia page https://te.wikipedia.org/wiki/%E0%B0%87%E0%B0%82%E0%B0%95%E0%B1%8A%E0%B0%B2%E0%B1%8D%E0%B0%B2%E0%B1%81_%E0%B0%AE%E0%B0%82%E0%B0%A1%E0%B0%B2%E0%B0%82). So I updated almost all entries to use the working code. So while this is not a priority, let me know when the fix is ready. [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 10:53, 27 February 2024 (UTC)
::@[[User:Janhrach|Janhrach]], Today I found another test case where the code works on both English and Telugu Wikipeidas
::
::<pre>{{#invoke:wd|references|Q60165552|P2046}}</pre>
::<pre>{{#invoke:wd|references|Q60165552|P1082|P585=2011}} </pre>
::
::Hope that helps.. [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 07:04, 28 February 2024 (UTC)
:::{{ping|Arjunaraoc}} I think I know what causes the issue, but I am sure I won't have time to fix the issue in the next two weeks, if not more. Be patient, please. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:22, 5 March 2024 (UTC)
:{{ping|Arjunaraoc}} The fix is ready in [[Module:wd/sandbox|the sandbox]]. If there are any problems, write to me here. Keep subscribed to this topic, so you will be notified if anybody raises an issue with this change. Thank you for reporting this bug.
:To everybody: In accordance with the policy, I will wait for several days until I update the main module. Please review my changes. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:11, 22 March 2024 (UTC)
::@[[User:Janhrach|Janhrach]], Thanks for the fix. I tested it on Telugu wikipedia and found the the test cases working. [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 00:38, 23 March 2024 (UTC)
::{{done|Module updated.}} [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 08:11, 1 April 2024 (UTC)
 
== Getting [[Template:Update tracker]] working with qualifiers ==
 
I've been working on developing {{t|Update tracker}} and its child {{t|Update tracker item}}, templates for articles that use {{t|Wikidata}} that create a table for the talk page that lists which information needs to be updated (convenient for subjects like colleges that have a lot of data that needs updating every year).
 
I've gotten it mostly functional, except that I can't figure out how to get it to work with qualifiers (see [[Template:Update_tracker_item/testcases|the testcases]]). To function, it needs to call extra qualifier commands only when the {{para|qualifier}} or {{para|qualifier-value}} parameters are defined. I don't know of a way to conditionally add extra parameters, though, and keeping them blank causes an error.
 
Does that make sense? Anyone able to help? <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 14:05, 10 April 2024 (UTC)
 
 
:@[[User:Sdkb|Sdkb]]: what do you mean by "there's an error" (in your testcases)? Is it an error thrown by the module or is it just the wrong data that you're getting? I suppose you tried
 
<syntaxhighlight lang="wikitext">
{{Wikidata |qualifier |single |{{{property|}}} |P585 |eid={{{entity|}}} |{{{qualifier|}}}={{{qualifier-value|}}} }}
</syntaxhighlight>
:Did you leave out the vertical bars in the last two variables? I did a quick test in your code, previewing your test cases while editing, and the previous code did return some values and no obvious errors.
 
:I see another problem here / for {{Q|Q10664609}}. This:
:* <nowiki>{{Wikidata|qualifier|single|eid=Q10664609|P1128|P585|P518=Q5428874}}</nowiki>→ {{Wikidata|qualifier|single|eid=Q10664609|P1128|P585|P518=Q5428874}} (current WD value is 2019)
 
:seems alright. However, in
:* <nowiki>{{Wikidata|qualifier|single|eid=Q10664609|P1128|P585}}</nowiki> → {{Wikidata|qualifier|single|eid=Q10664609|P1128|P585}}
:you'd expect the result to be 2020 (right?), but without any qualifiers the call returns the first of the two values of:
:* <nowiki>{{Wikidata|qualifier|eid=Q10664609|P1128|P585}}</nowiki> → {{Wikidata|qualifier|eid=Q10664609|P1128|P585}}
:This would require a change on WD, another "applies to" or "rank: preferred", I believe.
 
:Although, this does seem to work, so {{para|qualifier}} should be given with no value when there are other nonempty qualifiers for the property:
:* <nowiki>{{Wikidata|qualifier|single|eid=Q10664609|P1128|P585|P518=}}</nowiki>→ {{Wikidata|qualifier|single|eid=Q10664609|P1128|P585|P518=}}
:[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 12:56, 10 April 2024 (UTC)
::Thanks for the reply, {{u|Ponyo}}! The error I'm referencing came from the fact that {{para|qualifier}} and {{para|qualifier-value}} are optional, and the most simple use case (the first two test cases) leave them out. The previous code I tried removed the equal sign if they were not present, causing the template to evaluate as <syntaxhighlight lang="wikitext">{{Wikidata |qualifier |single |{{{property|}}} |P585 |eid={{{entity|}}} | }}</syntaxhighlight>, where the pipe and blank parameter at the end causes it to become blank. Curiously, using your more basic method, the template evaluates as <syntaxhighlight lang="wikitext">{{Wikidata |qualifier |single |{{{property|}}} |P585 |eid={{{entity|}}} | = }}</syntaxhighlight>, which I didn't even try because I presumed it would produce even more of an error, but it actually seems to cause it to work as intended. So that resolves my problem, although I don't trust that blank equals signs will always be okay for {{t|Wikidata}} as it evolves in the future, so if there's a more durable solution that'd be good to know about. <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 19:45, 10 April 2024 (UTC)
:::@[[User:Sdkb|Sdkb]]: glad it worked (wasnt' sure what exactly wasn't working). I don't think the ''blank equals sign'' will cause any problems; when there's nothing on its left, it should be discarded. If, however, you want to run some tests on your variables, you can try <syntaxhighlight lang="wikitext">{{#if:…{{{qualifier|}}}…| {{Wikidata|…|{{{qualifier}}}={{{qualifier-value}}}}} | {{Wikidata|…}} }}</syntaxhighlight> Someone more familiar with parsers and stuff might tell us if there's a better way; something tells me there has to be a hard-coded = sign, and not its replacements. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 20:23, 10 April 2024 (UTC)
:::The same test, using the nothing-on-the-left-of-equals-sign trick: <syntaxhighlight lang="wikitext">{{Wikidata |qualifier |single |{{{property|}}} |P585 |eid={{{entity|}}} |{{#if: some function of {{{qualifier|}}} and {{{qualifier-value}}} | {{{qualifier}}} | }} = {{{qualifier-value}}} }}</syntaxhighlight> [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 20:30, 10 April 2024 (UTC)
 
== Current population value ==
 
[[:Wikidata:Q6045892]] page contains population values between 2007-2022. However, when I type the [[:wikidata:Property:P1082]] value, the template calls the population value for 2007. What should I do to have it call up the population value for the most recent year?
:<code><nowiki>{{wd|property|Q6045892|P1082}}</nowiki></code> → {{wd|property|Q6045892|P1082}}
Thank you. [[User:Sadrettin|Sadrettin]] ([[User talk:Sadrettin|talk]]) 10:48, 7 April 2024 (UTC)
 
:You have at least two options, @[[User:Sadrettin|Sadrettin]]:
:* <nowiki>{{wd|property|Q6045892|P1082|P585=2022}}</nowiki> >> {{wd|property|Q6045892|P1082|P585=2022}}
:* Change the rank of the latest property on wikidata to preferred
:[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 13:08, 7 April 2024 (UTC)
 
:<syntaxhighlight lang="wikitext">
{{#invoke:wd
|property
|P1082
|P585={{#invoke:Wikidata
|getRawQualifier
|qualifier=P585
|property=P1082
|sort=P585
|invert=true
|limit=1
}}
}}
</syntaxhighlight>
:The above filters the multiple values of population (P1082 property) by the latest year (P585 qualifiers). If you add <code>|P459=Q6042918</code> after <code>|P1082</code>, then the result is also filtered by determination method. [[User:Serresmap|Serresmap]] ([[User talk:Serresmap|talk]]) 18:55, 18 April 2024 (UTC)
::{{ping|Serresmap}} Thank you for your reply. When I wrote this code exactly, it didn't work. Could there be a problem? Could you please check again? --[[User:Sadrettin|Sadrettin]] ([[User talk:Sadrettin|talk]]) 08:41, 23 April 2024 (UTC)
 
== Reference without title ==
 
If a reference doesn't have a title, the URL isn't shown and "Error: Unable to display the reference properly. See the documentation for details." is shown instead.<br>
Would it be possible to not use <nowiki>{{</nowiki>[[Template:Cite web|Cite web]]<nowiki>}}</nowiki> if there's no title so that the URL is shown? [[User:The RedBurn|The RedBurn]] <small>([[User Talk:The RedBurn|ϕ]])</small> 15:59, 11 May 2024 (UTC)
:This is an as-yet unaddressed problem with the module. See [[#A_systematic_way_to_avoid_reference_errors_may_be_needed|above]]. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 03:47, 13 May 2024 (UTC)
:I plan to improve this error message; in the next ~3 months, if nothing wrong. But I agree with you it would probably be better if we let {{tl|Cite web}} to report missing titles. I thinks so because if the reference rendering fails, the module will need to report two errors (one for {{tl|Cite web}} missing/unknown param on Wikidata, and one error for {{tl|Cite Q}}) – this would be probably too confusing for non-technical editors.
:Is anybody opposed to this change?
:—[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:35, 25 May 2024 (UTC)
::I have made the said change to the sandbox. Here is a result sample:
:::{{#invoke:wd/sandbox|references|Q69678|P1082}}
::Original behavior, for comparison:
:::{{#invoke:wd|references|Q69678|P1082}}
::&ndash; [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:32, 7 June 2024 (UTC)
{{reflist-talk}}
::{{ping|The RedBurn}} Oops, I misread {{tq|1=to not use {{tl|Cite web}} }} in your comment as "to use {{tl|Cite web}}". As for this, we could probably not; see [[Module talk:Wd/Archive 1#Reference formatting bug when using "author name string" (P2093)|this]] discussion. To quote an editor from the discussion: {{tq|1=Titles are required so when <code><nowiki>{{cite web}}</nowiki></code> emits a missing title error, that is a good thing, because someone can go to wikidata and fix it}}.
::As for the change I did (even though it's not what you proposed), what do you think of it?
::–[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 06:40, 9 June 2024 (UTC)
:::Your change is great, I actually thought {{T|Cite web}} was the culprit for hiding the URL when there's no title. [[User:The RedBurn|The RedBurn]] <small>([[User Talk:The RedBurn|ϕ]])</small> 06:29, 10 June 2024 (UTC)
::::Ok, I went ahead and updated the module. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:18, 10 June 2024 (UTC)
:::::{{ping|Janhrach}} This is a huge improvement, thank you! [[User:Polygnotus|Polygnotus]] ([[User talk:Polygnotus|talk]]) 19:42, 15 June 2024 (UTC)
 
== Wikipedia article link in plain form needed ==
 
While creating a variant template for use on Andhra Pradesh Village articles which uses{{tl| Infobox settlement}}, I needed wikipedia site link text in plain form so that I can change the visible text to remove suffixes in label names like district or mandal. I am unable to do that, as the current linked form gives a full fledged link with site link text and label as its visible text. I am unable to process such text as the response has pipe symbol in it. Is there any other way to get only Wikipedia article link text in plain form? [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 11:18, 21 June 2024 (UTC)
 
:I think this module could not output sitelinks (i.e. interwiki links hosted in Wikidata), linked or not. Could you clarify what exact arguments are you giving to the template call? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:08, 21 June 2024 (UTC)
:[[Template:Sitelink]] or parts of its code? [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 13:42, 21 June 2024 (UTC)
::@[[User:Ponor|Ponor]], Thanks for your help. It worked. I used the corresponding function from {{tl|WikidataIB}} in my code. @[[User:Janhrach|Janhrach]], Your response is correct. I wanted the sitelink in plain text form for the same language, instead of link form with label. [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 00:57, 22 June 2024 (UTC)
 
== {{prop|143}} and {{prop|4656}} in references ==
 
I propose to modify the module to ignore references containing these properties. This seems to be the correct way of handling them – these references should not contain any information useful for Wikipedia references. Any thoughts? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:17, 15 June 2024 (UTC)
 
:@[[User:Janhrach|Janhrach]], Agree. Non Wiki references are only proper references. [[User:Arjunaraoc|Arjunaraoc]] ([[User talk:Arjunaraoc|talk]]) 11:13, 21 June 2024 (UTC)
:I have made the change to the sandbox. References containing {{property|P3452}} are also fully ignored. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:41, 21 June 2024 (UTC)
::{{done}}: module updated. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:49, 23 June 2024 (UTC)
 
== 2 urls in source ==
There are 2 URLs in the source of the 2023 population data on this page: [https://www.wikidata.org/wiki/Q123751?uselang=en#P1082 reference URL] However, one of them appears on Wikipedia. Is it possible for 2 URLs to appear? [[User:Sadrettin|Sadrettin]] ([[User talk:Sadrettin|talk]]) 10:21, 24 June 2024 (UTC)
 
:No, it is not possible for a Wikipedia reference to have two URLs. I am not sure if the Wikidata reference you mentioned is valid; it is possible the reference should be split into two (the first reference would contain the first URL, and the second reference would contain the second URL) even if the other metadata are the same. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 07:36, 29 June 2024 (UTC)
 
== Update ==
 
I made some substantial changes to the sandbox. I simplified the internal logic of the citation-rendering function and renamed local variables to less cryptic names. No visible behavioral changes changed should happen. Some testcases are [[User:Janhrach/sandbox3|here]]. If there is no opposition to the changes for several days, I will update the main module. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:59, 5 August 2024 (UTC)
 
:{{done}}: module updated. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:50, 9 August 2024 (UTC)
 
== Another update ==
 
I once again altered the internal workings of the citation-rendering function in the sandbox, but also /i18n. Apart from a bugfix, in this update I tried to make much template- and param-specific behavior (previously hardcoded into the function) configurable in /i18n. Changes to /i18n are not backward-compatible. Some testcases are [[User:Janhrach/sandbox3|here]]. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:40, 15 August 2024 (UTC)
 
:Thanks for the info &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 18:46, 15 August 2024 (UTC)
:{{done}}. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 09:45, 26 August 2024 (UTC)
 
== Reference error message improvement ==
 
Finally, I improved the reference error messages. The code is in the sandbox. <code>/i18n</code> has also been modified. You can see the difference of the outputs [[User:Janhrach/sandbox3|here]]. I appreciate your feedback. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:17, 27 August 2024 (UTC)
 
:{{done}}. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:06, 2 September 2024 (UTC)
 
==Discussion at Template talk:Wikidata entity link § Not picking up mul labels from Wikidata entities==
[[File:Symbol watching blue lashes high contrast.svg|25px|link=|alt=]]&nbsp;You are invited to join the discussion at [[:Template talk:Wikidata entity link#Not picking up mul labels from Wikidata entities|Template talk:Wikidata entity link §&nbsp;Not picking up mul labels from Wikidata entities]]. [[User:Peaceray|Peaceray]] ([[User talk:Peaceray|talk]]) 01:10, 30 August 2024 (UTC)<!-- [[Template:Please see]] -->
 
:@[[User:Thayts|Thayts]], [[User:Janhrach|Janhrach]], et al.: What do you think? I was thinking to change [[Module:Wd#L-704]] from <syntaxhighlight lang=lua inline>label = mw.wikibase.getLabelByLang(id, self.langCode)</syntaxhighlight> to <syntaxhighlight lang=lua inline>label = mw.wikibase.getLabelByLang(id, self.langCode) or mw.wikibase.getLabel(id)</syntaxhighlight> (at least as an interim step). Is this the right thing to do or should we just remove <code>getLabelByLang()</code> all together? Currently it is also being (mis)used at [[Module:Wd#L-1294]] (with a hardcoded "en" for the language). Incidentally this module currently also uses <code>getDescription()</code> (and not <code>getDescriptionByLang()</code>) at [[Module:Wd#L-2523]]. It seems like the language usage (and their fallbacks) is not very unified here. Thank you, —[[User:Uzume|Uzume]] ([[User talk:Uzume|talk]]) 15:11, 30 August 2024 (UTC)
::I am not familiar with the Wikibase API. As for the status quo, it is not good and I already have had to fix a bug arising from a lack of label fallback. I don't know whether <code>getLabel</code> provides a good fallback mechanism, and I don't now have time to check the documentation. (Though maybe tomorrow I will have.)
::As for the {{tq|hardcoded "en"}}, it is required that the language is hardcoded, because the fetched label is used in a Geohack call. (However, I find it much preferable for this string to be fetched from a WD property and not from the label, because in the future, there will be no guarantee that the label will be accepted as a Geohack param.) [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:26, 1 September 2024 (UTC)
:::Update: I found the documentation is linked in the linked discussion, so I didn't have to search for it. It seems that it is desirable use getLabel only. There may arise some issues, but they would (in my speculation) only affect multilingual wikis. I will look into this possible bug later. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 19:36, 1 September 2024 (UTC)
::::The hypothetical bug I have mentioned quite probably won't arise, so ignore this part of the comment. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 17:53, 2 September 2024 (UTC)
 
===Proposed fix===
I made a fix to the sandbox. Sample output:
*English label:
**live module: {{#invoke:wd|label|Q46}}
**sandbox: {{#invoke:wd/sandbox|label|Q46}}
*Multilingual label:
**live module: {{#invoke:wd|label|Q42}}
**sandbox: {{#invoke:wd/sandbox|label|Q42}}
—[[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:36, 8 September 2024 (UTC)
 
:{{done}}. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:29, 12 September 2024 (UTC)
 
== Property mapping and ignoring unrecognized parameters ==
 
I was brought here by the following citation errors which had ''too much information'':
{{collapse top}}
# [[d:Q625794#P569]] {{demo inline|<nowiki>{{wikidata|references|Q625794|P569}}</nowiki>}}
# [[d:Q625794#P570]] {{demo inline|<nowiki>{{wikidata|references|Q625794|P570}}</nowiki>}}
# [[d:Q625794#P20]] {{demo inline|<nowiki>{{wikidata|references|Q625794|P20}}</nowiki>}}
{{reftalk}}
{{collapse bottom}}
 
This is partially just an edit request to add some properties to the property mapping. {{Wikidata property link|P50}} and {{Wikidata property link|P291}} are common citation parameters that need to be added to the property mappings documented at {{slink|Template:Cite Q#Bibliographic parameters}} and {{slink|Template:Wikidata#References}}. I would further map {{Wikidata property link|P136}} to {{para|[[Help:Citation Style 1#Type|type]]}} and {{Wikidata property link|P1433}} to {{para|[[Help:Citation Style 1#Work and publisher|work]]}}.
 
However, I also think that this template/module refusing to produce any citation when there are unrecognized parameters is not ideal. I suggest that it should ignore unrecognized parameters without error messages in published articles, and only show a green warning message on previews.
 
{{small|Pinging {{u|Sdkb}} from their prior interest at {{slink|Module talk:Wd/Archive 1#References mapping}}.}}
 
[[User:Daask|Daask]] ([[User talk:Daask|talk]]) 08:03, 24 September 2024 (UTC)
 
:As for the errors containing {{tq|too much information}}, there were repeated complaints that the previous error message, which only indicated that an error had occured and linked to the documentation, was unclear. And I think too little information is a lesser problem than too much information, especially when there is no middle ground.
:As for the requested mappings, the usage of the mentioned properties in WD refs is not standard per [[wikidata:Help:Sources]].
:Ignoring unknown properties is problematic, because some properties may be deliberately left from the Cite web mapping to force the module to use Cite Q. This will be very important if new output templates are added, which is something I want to do eventually. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:06, 27 September 2024 (UTC)
::{{re|Janhrach}} I apologize for my unclear comment. My concern was not that the error message was verbose, but rather that the error was caused by Wikidata having too much information about the citation. [[User:Daask|Daask]] ([[User talk:Daask|talk]]) 15:36, 27 September 2024 (UTC)
:::I have made some edits to the refs on Wikidata, and I will also modify the module later. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 18:01, 27 September 2024 (UTC)
::::I have added support for {{prop|P291}} into the Cite web mapping. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:20, 5 October 2024 (UTC)
:::::Why? When citing a web source, that source exists somewhere (or multiple somewheres) on the intarwebs but is not tied to a physical ___location. Just because a box can be filled, it does not mean that it should be filled.
:::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 13:44, 5 October 2024 (UTC)
::::::I added the property because the reference number two above displayed an error, as it contained the P291, which was not in the mapping. Is the usage of "Bloomington" in <code>publication-place</code> in the above reference incorrect? Should all instances of usage like this be removed from Wikidata? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:58, 5 October 2024 (UTC)
:::::::Yes, incorrect. And because you are citing a website, the proper parameter is {{para|website}} not {{para|publisher}}. Wikidata should contain correct data. The problem there is that there are few if any standards so editors will fill-in the boxes because 'omg!-there-is-an-empty-box!-I-must-fill-it!' All that you can do is recognize that and choose {{tlx|cite web}} parameters appropriately.
:::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:12, 5 October 2024 (UTC)
::::::::OK, I fixed the incorrect publication-place properties on WD and reverted my edits to this module. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 14:24, 5 October 2024 (UTC)
::::::::May I ask why you think ''Kinsley Institute'' should be in <code>website</code>, not in <code>publisher</code>? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 16:48, 5 October 2024 (UTC)
:::::::::Because we cite the {{em|work}} ({{para|website|Kinsey Institute}} in this case – note spelling) not the publisher (Indiana University).
:::::::::—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 18:38, 5 October 2024 (UTC)
::::::::::Is the Kinsey Institute a work? It quite seems to match the definition of "publisher" from the Cite web documentation ({{tq|The [[publisher]] is the ''company'', ''organization'' or other legal entity that publishes the work being cited.}}).
::::::::::We could say that we cite the institute's website, which has the same name as the institute. Is this what you mean?
::::::::::(Thanks for the spelling correction; I sometimes misread words and misspell them afterwards.)
::::::::::– [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 12:55, 11 October 2024 (UTC)
 
== Summing values across items ==
 
Hi,
 
I am already using this module to call values for specific items (in my case, political parties, such as their number of members).
 
Is there a way to sum these values for several items that are all instances of an item. For instance, the parties I deal with are all instances of "European political parties", and I am trying to sum their values to display the result (e.g., the sum total number of members of all European political parties).
 
Is these feasible one way or another?
 
Thanks! [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 07:47, 21 October 2024 (UTC)
 
:This is not possible with this module. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 15:41, 25 October 2024 (UTC)
::Thanks for the reply! And too bad. [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 07:48, 28 October 2024 (UTC)
 
== Capitalisation ==
 
Hi,
Is there a way to change the capitalisation of results? I am trying to call Wikidata to provide the description on Wikipedia articles but Wikidata says descriptions should not be capitalised, while Wikipedia English needs capitalisation. Is there a way to capitalise the first letter of the resulting string?
Thanks! [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 14:16, 9 December 2024 (UTC)
:{{slink|Help:Magic_words|ucfirst}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 14:30, 9 December 2024 (UTC)
::I am so bookmarking this. Thanks a lot! [[User:Julius Schwarz|Julius Schwarz]] ([[User talk:Julius Schwarz|talk]]) 15:22, 9 December 2024 (UTC)
 
== Retrieving multiple wikidata property values in one call ==
 
I am trying to retrieve multiple property values in one call but it is ignoring the other properties I give so I only ever get one property value. I must not be giving things in the correct order but none of the examples help me. For example, given a mountain name, I want to retrieve the elevation, prominence, mountain range, coordinates and the first ascent significant event.
So given this:
P4552 = mountain range
P2044 = elevation
P2660 = prominence
P625 = coordinates
P793 = significant event; Q1194369 = first ascent; P585 = point in time
I can get all the values if I code one call per property but how do I code it so I can get all the properties in one call?
The documentation for the "property" command says "Returns the requested property – or list of properties". Yet, I see no example or syntax of how to specify this list of properties.<br/>
 
If I code the following, I only get the value of property P2044.<br/>
<nowiki>{{#invoke:wd|property|qualifier|page=Mount Robson|P2044|P2660|P4552|P625|P793|Q1194369|P585}}</nowiki>
[[User:RedWolf|RedWolf]] ([[User talk:RedWolf|talk]]) 19:32, 23 January 2025 (UTC)
 
:Have you tried using <code>properties</code> instead of <code>property</code>? [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 20:45, 23 January 2025 (UTC)
::Yes, first thing I tried but it's not for specifying multiple properties to return but rather for returning multiple values of the given property. [[User:RedWolf|RedWolf]] ([[User talk:RedWolf|talk]]) 22:04, 23 January 2025 (UTC)
:::It seems that this module does not support this functionality – the diagram at [[Module:Wd#Positional arguments]] apparently says only one <code>property_id</code> argument is supported. The description you quoted from the documentation probably refers to using <code>properties</code>. [[User:Janhrach|Janhrach]] ([[User talk:Janhrach|talk]]) 13:29, 24 January 2025 (UTC)
 
== Retrieve foreign Wikipedia page title ==
 
I want to use the template to retrieve the foreign Wikipedia title of an article, given the local title. As an example: I have 'Eiffel Tower', and I want to retrieve the name '''Eiffelturm''' from the name of the corresponding page on de-wiki, according to the information available at the bottom of page [[d:Q243#sitelinks-wikipedia|Q243]].
 
I am new to the wikidata template, and I have discovered how to do some of what I need to do, for example: I see that <code><nowiki>{{wikidata|label|raw|page=Eiffel Tower}}</nowiki></code> gives me back {{kbd|{{wikidata|label|raw|page=Eiffel Tower}}}}. I see how to get various properties, like where it is located:
* <code><nowiki>{{wikidata|property|page=Eiffel Tower|P17}}</nowiki></code> ⟶ {{wikidata|property|page=Eiffel Tower|P17}}
But I don't see what the property name or id of the foreign wikipedia property is, so I can retrieve the German page title. What I want logically, I think, is something like this, maybe:
* <code><nowiki>{{wikidata|qualifier|page=Eiffel Tower|P99999|de}}</nowiki></code> ⟶ Eiffelturm
where {{kbd|P999999}} is an imaginary property number for 'Wikipedia language link' and {{kbd|de}} is the language code for the foreign Wikipedia containing the title I am looking for. But I can't find a property value for Wikipedia site link. There must be a property or something for the wikipedia names, but I can't find it. Maybe it's not a property, but something else? [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 02:11, 10 March 2025 (UTC)
 
:@[[User:Mathglot|Mathglot]]: [[Template:Sitelink]] or the code within. [[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 05:42, 10 March 2025 (UTC)
:: Oh, I forgot about that one, and I even had a hand in writing some of the documentation for it. Thanks! [[User:Mathglot|Mathglot]] ([[User talk:Mathglot|talk]]) 09:53, 10 March 2025 (UTC)
 
== "Multilanguage" not working ==
 
I noticed that the example <code><nowiki>{{wikidata|property|multilanguage|Q55|P1549|P407=Q36846}}</nowiki></code> on [[Template:Wikidata]] no longer works – the output is empty. This seems to happen generally when trying to retrieve language-specific values of P1549 using "multilanguage".
 
Does anyone know how to fix or work around this issue? --[[User:Volvox|Volvox]] ([[User talk:Volvox|talk]]) 18:40, 9 April 2025 (UTC)
 
: {{Reply|Volvox}} It appears that <code>multilanguage</code> itself works, as in the following for the {{Prop|1549}} property of {{Q|55}}.
: <code><nowiki>{{wikidata|property|multilanguage|Q55|P1549}}</nowiki></code> (show one value)
:: {{wikidata|property|multilanguage|Q55|P1549}}
: <code><nowiki>{{wikidata|properties|multilanguage|Q55|P1549}}</nowiki></code> (show all values)
:: {{wikidata|properties|multilanguage|Q55|P1549}}
: I think the problem might be that {{para|P407|Q36846}} as shown in that example is looking for a {{Prop|407}} qualifier containing {{Q|36846}}, which is not how the {{Q|21044568}} datatype stores the language. You can see how it is stored by expanding the following.
{{Collapse|title=Output of <code><nowiki>{{examine|P1549|qid=Q55}}</nowiki></code>|content={{examine|P1549|qid=Q55}}}}
: Not sure if there is a way to fix this without an update to [[Module:wd]]. Perhaps someone having more experience with this module would know. -- [[User:Zyxw|Zyxw]] ([[User talk:Zyxw|talk]]) 03:14, 27 April 2025 (UTC)
 
:: Also, to show it does work when there are {{Prop|407}} qualifiers, see the following for the {{Prop|856}} property of {{Q|7565108}}.
:: <code><nowiki>{{wikidata|property|multilanguage|Q7565108|P856}}</nowiki></code>
::: {{wikidata|property|multilanguage|Q7565108|P856}}
:: <code><nowiki>{{wikidata|property|multilanguage|Q7565108|P856|P407=Q5287}}</nowiki></code> (in {{Q|5287}})
::: {{wikidata|property|multilanguage|Q7565108|P856|P407=Q5287}}
:: <code><nowiki>{{wikidata|property|multilanguage|Q7565108|P856|P407=Q150}}</nowiki></code> (in {{Q|150}})
::: {{wikidata|property|multilanguage|Q7565108|P856|P407=Q150}}
:: To see how this is stored, expand the following.
{{Collapse|title=Output of <code><nowiki>{{examine|P856|qid=Q7565108}}</nowiki></code>|content={{examine|P856|qid=Q7565108}}}}
:: -- [[User:Zyxw|Zyxw]] ([[User talk:Zyxw|talk]]) 03:58, 27 April 2025 (UTC)