Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1,477:
: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}}
::– [[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 — Martin <small>([[User:MSGJ|MSGJ]] · [[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=]] 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 § 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)
|