Module talk:Wd

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Janhrach (talk | contribs) at 17:19, 23 February 2024 (→‎Reference call returns blank on te.wikipedia.org in one case: Reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconWikidata
WikiProject iconThis module is within the scope of WikiProject Wikidata, a collaborative effort to improve Wikipedia's integration with Wikidata.
If you would like to participate, please visit the project page.

Edit request 15 December 2023

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: {{#invoke:wd/sandbox|label|raw|page=Crosslauf-Europameisterschaften 2009|globalSiteId=dewiki}} 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. --Habst (talk) 16:12, 15 December 2023 (UTC)[reply]

What is the use case? — Martin (MSGJ · talk) 16:30, 15 December 2023 (UTC)[reply]
@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 [[wikilinks]] in a dewiki article into {{#invoke:wd/sandbox|label|raw|page=wikilink|globalSiteId=dewiki}} (or a template that would make this syntax shorter), I could combine that with {{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. --Habst (talk) 21:48, 15 December 2023 (UTC)[reply]
Okay, sounds like a good idea! — Martin (MSGJ · talk) 21:52, 15 December 2023 (UTC)[reply]
 Done * Pppery * it has begun... 23:24, 22 December 2023 (UTC)[reply]

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? Folly Mox (talk) 13:58, 12 January 2024 (UTC)[reply]

Well I've retrieved archived for the deadlinked 2015 and 2019 "poverty incidence" reference URLs at d:Q1643: 2015, 2018.
I can't figure out how to edit these in at the Wikidata item (which is greylocked) even in desktop view. Folly Mox (talk) 03:40, 13 January 2024 (UTC)[reply]
@Folly Mox: I have fixed that, the reference had missing a title. Janhrach (talk) 08:32, 13 January 2024 (UTC)[reply]
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 title. Folly Mox (talk) 15:22, 13 January 2024 (UTC)[reply]
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. Janhrach (talk) 15:37, 13 January 2024 (UTC)[reply]

Error

{{wikidata|references|P11698|eid=Q7227384}} ([1]) is displaying an error, presumably because the module is having trouble with the statement's reference including section, verse, paragraph, or clause (P958). It should be mapped to {{Cite web}}'s |at= parameter. Could this be fixed? {{u|Sdkb}}talk 06:10, 1 February 2024 (UTC)[reply]

@Sdkb: I have made a fix in the sandbox:
[1]
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? Janhrach (talk) 20:31, 3 February 2024 (UTC)[reply]
@Janhrach: Looks good to me! My view is that it should be displayed the same as it would in CS1: [2] 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, {{u|Sdkb}}talk 23:01, 3 February 2024 (UTC)[reply]
Ok, so I will submit an edit request in several days if nobody will have complained. Thank you for reporting this. Janhrach (talk) 08:14, 4 February 2024 (UTC)[reply]
@Janhrach, seeing no concerns, are we good to implement? {{u|Sdkb}}talk 03:57, 8 February 2024 (UTC)[reply]
@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? Janhrach (talk) 09:40, 11 February 2024 (UTC)[reply]
 Done here. Please let me know if there are any issues. Cheers, {{u|Sdkb}}talk 15:58, 11 February 2024 (UTC)[reply]
@Janhrach if you would like the TPE userright, please let me know, as I believe you meet the criteria — Martin (MSGJ · talk) 21:26, 11 February 2024 (UTC)[reply]
I believe I am one template edited short of one of the requirements. Janhrach (talk) 19:29, 18 February 2024 (UTC)[reply]

References

  1. ^ a b "Pomona College 2023–2024 Common Data Set". Pomona College. B22. Archived from the original on 19 February 2024. Retrieved 17 April 2024.
  2. ^ "Pomona College 2023–2024 Common Data Set". Pomona College. B22. Retrieved 1 February 2024.

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:

{{wikidata|wikipedia|lang=es|eid=Q43287}} → Imperio alemán

There's also another editor interested in this; adding Your Friendly Neighborhood Sociologist. Thanks, Mathglot (talk) 08:59, 14 February 2024 (UTC)[reply]

Theres a suggestion on the courtesy linked page to use {{#invoke:WikidataIB|getSiteLink|qid=Q43287|wiki=eswiki|ps=1}} >> Imperio alemán, @Mathglot. Ponor (talk) 12:18, 16 February 2024 (UTC)[reply]
@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 § Getting values (labels) from a local Wikipedia, and unfortunately I never saw that one. Also, I believed the 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! Mathglot (talk) 23:12, 16 February 2024 (UTC)[reply]
Oh... thank you, @Mathglot, I learned something new too. This could be made into a separate template, if needed, so other people can find it: {{sitelink|qid|wiki}} // {{sitelink|Q43287|es}}es:Imperio alemán, or whatever you wanna to call it. It's a 10 minute job. Ponor (talk) 23:50, 16 February 2024 (UTC)[reply]
@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 . 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 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 {{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! Mathglot (talk) 00:33, 17 February 2024 (UTC)[reply]
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 [[:es:xxxx|]] worked.
  • {{sitelink|es|qid=Q43287}}: Imperio alemán
  • {{sitelink|fr|title=German empire}}: Empire allemand (was cheap to get)
  • {{sitelink|fr}} in any article should also work
Feel free to play further! And whoever's reading this. Ponor (talk) 01:22, 17 February 2024 (UTC)[reply]
Well, you just saved me ten minutes. (I went ahead and updated the doc a bit more; see what you think.) I tested {{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 {{SUBJECTPAGENAME}} if it were on the Talk page? That would be very useful. Mathglot (talk) 02:52, 17 February 2024 (UTC)[reply]
@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 Predložak:Get QID (ha! I used {{sitelink|hr|title=Template:Get QID}} 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. Ponor (talk) 14:17, 19 February 2024 (UTC)[reply]

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

{{#invoke:wd|references|Q18395504|P2046}}

similar template code that works

{{#invoke:wd|references|Q18395504|P1082|P585=2011}}


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.--Arjunaraoc (talk) 10:43, 20 February 2024 (UTC)[reply]

@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. Janhrach (talk) 17:19, 23 February 2024 (UTC)[reply]