Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
Line 677:
:Not currently, but I'm having plans to introduce it in the next update. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 17:42, 10 February 2021 (UTC)
{{talkref}}
== Reference naming/duplication redux ==
I see in the archive that {{u|Mike Peel}} brought up [[Module_talk:Wd/Archive_1#Reference_names|reference naming for this template]] a while back. I've been encountering a similar issue, so I wanted to raise it again to see if we can figure something out.
Reference reuse is working fine when sourcing the same fact from Wikidata twice (say, in both the infobox and the lead), since we can just use <code><nowiki>{{wikidata|references|Pxxx}}</nowiki></code> twice and they'll be merged. However, it isn't working when the same reference is used both from Wikidata to support one fact and in the article to support another. In this case, even if the display is exactly the same, the references remain separate. Moreover, it wouldn't be advisable to replace the article-based reference with the Wikidata-based one, since the Wikidata one could switch to a new reference that doesn't support the second fact. (Let me know if the above is confusing and I can provide an example.)
Would we be able to figure out any way so that the software can identify references that display the same and merge them, even if one comes from Wikidata and the other does not? <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 20:59, 10 February 2021 (UTC)
{{tracked|T274432}}
:Hmm, experimenting a bit, this goes a little beyond just Wikidata. <code><nowiki><ref name="Name1">Foobar</ref><ref name="Name2">Foobar</ref></nowiki></code> display as two references (<ref name="Name1">Foobar</ref><ref name="Name2">Foobar</ref>), not one as they should, so the problem seems to be that the name difference alone throws off the software. I created a phab task. Even if we could have a working <code><nowiki>{{wikidata|references|P4700|refname=Name1}}</nowiki></code>, we wouldn't want to reuse <code><nowiki><ref name="Name1"/></nowiki></code> for instances where a difference fact is being supported, since the Wikidata reference could change. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 21:06, 10 February 2021 (UTC)
::They display as two references because the name attribute is different. They only get merged if the name attribute is equal. I believe this is quite fundamental to the way references work in Mediawiki. If you want this module to use the same name attribute for any reference with the same contents that is defined in the article itself, then I guess the only thing that could be done is to get the article text (something that I've just figured out how to do as mentioned in the [[#Dates don't respect MDY tag|Dates don't respect MDY tag]] section) and scan for references. However, this is quite cumbersome and if the references are off by a few characters or show stuff in a different order, this is not going to work. On the other hand, if the references use the {{tl|Citation}} template then we might be able to match on parameter values, but this still goes wrong quickly if a parameter has been set that this module doesn't recognise. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 23:11, 10 February 2021 (UTC)
As I suggested on [[Template talk:Cite Q]], if the reference is described by a Wikidata item, for example:
{{#invoke:wd|property|references|Q15243200|P2923}}
which uses {{Q|Q25198336}}, then the most appropriate name for this reference is Q25198336. Then if this reference is used again in the article, the same name can be used to group them together. — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 12:20, 11 February 2021 (UTC)
:That would be possible indeed. However, {{tl|Cite Q}} has more parameters than just the QID, for example "pages", "chapter" and "access-date". [[Module:Wd]] gives different names to such references that have the same QID but different parameters (because they are not completely the same). If you wouldn't do that, then only one would become prominent (and on some wikis even cause conflict errors) which might not be applicable to all instances. Also, this only works for references for which {{tl|Cite Q}} can be used. [[Module:Wd]] also uses {{tl|Cite web}} for references that contain a URL. [[User:Thayts|<span style="color:#466383;font-family:Georgia;font-style:italic;letter-spacing:1px">Thayts</span>]] [[User talk:Thayts|<span style="color:#7892A5">•••</span>]] 18:27, 11 February 2021 (UTC)
::{{u|MSGJ}}, you seem to be talking about something different. Here's an example of what I'm trying to fix: at [https://en.wikipedia.org/w/index.php?title=Scripps_College&oldid=1006234399 this revision of Scripps College], the academic staff count in the infobox has been converted to draw from Wikidata, with the code (slightly simplified) <code><nowiki>{{wikidata|property|references|normal+|current|single|P1128|P518=Q5428874}}</nowiki></code>, generating {{tq|Academic staff: {{wikidata|property|references|normal+|current|single|P1128|P518=Q5428874|page=Scripps College}}}}. However, the Common Data Set is also used to support Scripps' student body size in the body of the article, using the more typical code <code><nowiki><ref name=CommonDataSet19-20>{{cite web|url=http://www.scrippscollege.edu/assessir/wp-content/uploads/sites/30/2019-2020-CDS_FINAL-4.pdf|title=Scripps College Common Data Set 2019-2020 |publisher=Scripps College}}</ref></nowiki></code>, generating <ref name=CommonDataSet19-20>{{cite web|url=http://www.scrippscollege.edu/assessir/wp-content/uploads/sites/30/2019-2020-CDS_FINAL-4.pdf|title=Scripps College Common Data Set 2019-2020 |publisher=Scripps College}}</ref>. These references are exactly the same, but they are not merged because the ref names are different (this is the bug I created a phab ticket for). We want to keep them separate in the code because, although they are using the same source, they are supporting different facts, and if the Wikidata reference is updated, it might switch to something that supports only the faculty count, not the student body size. However, we want them to be merged in the display for the reader because they are currently the same source. I'm pretty sure there's no way to do that until the phab ticket is resolved. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 20:02, 11 February 2021 (UTC)
{{talkref}}
|