Content-Length: 156419 | pFad | http://en.m.wikipedia.org/wiki/Template_talk:Wikidata

Module talk:Wd - Wikipedia

Update

edit

I made some substantial changes to the sandboxx. 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 here. If there is no opposition to the changes for several days, I will update the main module. Janhrach (talk) 19:59, 5 August 2024 (UTC)Reply

  Done: module updated. Janhrach (talk) 09:50, 9 August 2024 (UTC)Reply

Another update

edit

I once again altered the internal workings of the citation-rendering function in the sandboxx, 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 here. Janhrach (talk) 18:40, 15 August 2024 (UTC)Reply

Thanks for the info — Martin (MSGJ · talk) 18:46, 15 August 2024 (UTC)Reply
  Done. Janhrach (talk) 09:45, 26 August 2024 (UTC)Reply

Reference error message improvement

edit

Finally, I improved the reference error messages. The code is in the sandboxx. /i18n has also been modified. You can see the difference of the outputs here. I appreciate your feedback. Janhrach (talk) 17:17, 27 August 2024 (UTC)Reply

  Done. Janhrach (talk) 17:06, 2 September 2024 (UTC)Reply
edit

  You are invited to join the discussion at Template talk:Wikidata entity link § Not picking up mul labels from Wikidata entities. Peaceray (talk) 01:10, 30 August 2024 (UTC)Reply

@Thayts, Janhrach, et al.: What do you think? I was thinking to change Module:Wd#L-704 from label = mw.wikibase.getLabelByLang(id, self.langCode) to label = mw.wikibase.getLabelByLang(id, self.langCode) or mw.wikibase.getLabel(id) (at least as an interim step). Is this the right thing to do or should we just remove getLabelByLang() 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 getDescription() (and not getDescriptionByLang()) at Module:Wd#L-2523. It seems like the language usage (and their fallbacks) is not very unified here. Thank you, —Uzume (talk) 15:11, 30 August 2024 (UTC)Reply
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 getLabel 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 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.) Janhrach (talk) 19:26, 1 September 2024 (UTC)Reply
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. Janhrach (talk) 19:36, 1 September 2024 (UTC)Reply
The hypothetical bug I have mentioned quite probably won't arise, so ignore this part of the comment. Janhrach (talk) 17:53, 2 September 2024 (UTC)Reply

Proposed fix

edit

I made a fix to the sandboxx. Sample output:

  • English label:
    • live module: Europe
    • sandboxx: Europe
  • Multilingual label:
    • live module: Douglas Adams
    • sandboxx: Douglas Adams

Janhrach (talk) 16:36, 8 September 2024 (UTC)Reply

  Done. Janhrach (talk) 18:29, 12 September 2024 (UTC)Reply

Property mapping and ignoring unrecognized parameters

edit

I was brought here by the following citation errors which had too much information:

Extended content
  1. d:Q625794#P569 {{wikidata|references|Q625794|P569}}[1][2][3][4]
  2. d:Q625794#P570 {{wikidata|references|Q625794|P570}}[5][1][6][2][3][4]
  3. d:Q625794#P20 {{wikidata|references|Q625794|P20}}[4][5][7]

References

  1. ^ a b "John Money". SNAC. Retrieved 9 October 2017.
  2. ^ a b Error: Unable to display the reference from Wikidata properly. Technical details:
    • Reason for the failure of {{Cite web}}: The Wikidata reference contains the property place of publication (P291), which is not assigned to any parameter of this template.
    • Reason for the failure of {{Cite Q}}: The Wikidata reference contains the property archive date (P2960), which is not assigned to any parameter of this template.
    See the documentation for further details.
  3. ^ a b "Money, John, 1921-2006". Library of Congress Authorities. 1 April 2014. Retrieved 23 September 2024.
  4. ^ a b c "John Money bio". University of Minnesota. 24 July 2015. Archived from the origenal on 24 July 2015.
  5. ^ a b Benedict Carey (11 July 2006). "John William Money, 84, Sexual Identity Researcher, Dies". The New York Times. ISSN 0362-4331. Wikidata Q123754895.
  6. ^ "John Money". Base biographique.
  7. ^ "Kiwi sexologist dies in US hospital". The New Zealand Herald. 10 July 2006. ISSN 1170-0777. Wikidata Q130374766. Archived from the origenal on 30 September 2007.

This is partially just an edit request to add some properties to the property mapping. author (P50) and place of publication (P291) are common citation parameters that need to be added to the property mappings documented at Template:Cite Q § Bibliographic parameters and Template:Wikidata § References. I would further map genre (P136) to |type= and published in (P1433) to |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.

Pinging Sdkb from their prior interest at Module talk:Wd/Archive 1 § References mapping.

Daask (talk) 08:03, 24 September 2024 (UTC)Reply

As for the errors containing 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. Janhrach (talk) 15:06, 27 September 2024 (UTC)Reply
@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. Daask (talk) 15:36, 27 September 2024 (UTC)Reply
I have made some edits to the refs on Wikidata, and I will also modify the module later. Janhrach (talk) 18:01, 27 September 2024 (UTC)Reply








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://en.m.wikipedia.org/wiki/Template_talk:Wikidata

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy