Page MenuHomePhabricator

Create wikidata badges to indicate when sitelinks point to Wikipedia redirect pages
Open, Needs TriagePublic

Description

Task: add two new badges to the list of badges that editors can add to sitelinks.

Badge #1 is for a sitelink to a redirect. The icon to use is File:Symbol_redirect_arrow_grey.svg . The associated Item is Q70893996.

Badge #2 is for an intentional sitelink to a redirect. The icon to use is File:Symbol_redirect_arrow_blue.svg . The associated Item is Q70894304.

BDD
GIVEN a sitelink
WHEN editing the sitelink
THEN I can chose new badges to indicate redirects

Acceptance criteria:


Original report:

As a Wikidata editor,

  • I would like to be able to see when a sitelink is pointing to a redirect page on the Wikipedia.
  • I would like to be able to distinguish an intentional sitelink to a redirect (marked by Template:Wikidata redirect on the Wikipedia)
  • in WDQS queries I would like to be able to identify sitelinks that point to redirects rather than full articles, when assessing the coverage of a topic

As a Wikipedia reader,

  • I would like a subtle indication if a sidebar sitelink will be taking me to an article on a related subject (via a redirect), rather than a strictly parallel article

This can be achieved rather simply, by creating two new Wikidata badges, one to indicate a sitelink to a redirect, a second to indicate an intentional sitelink to a redirect.
The badges could be maintained and kept updated by a community bot regularly (daily?) running an SQL query to identify sitelinks to redirects (with and without the template), and comparing it with a SPARQL query to identify the sitelinks on Wikidata with badges

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptOct 14 2019, 10:48 AM

Background:

Mostly, the existence of a sitelink to a redirect indicates a potential data problem on Wikidata: a sitelink that has been left over when two Wikipedia articles have been merged, but no corresponding merge has been made on Wikidata. A sitelink to a redirect can therefore be a strong indication that an item on Wikidata is a duplicate of another one, and should be merged with it. However, at the moment it is not possible for somebody browsing a Wikidata article to readily spot that a sitelink points to a redirect. A badge to identify this would bring the fact into plain sight.

On the other hand sitelinks to redirects may also (sometimes) be created intentionally, most commonly to preserve decent interwiki linkage when different Wikipedias have adopted different article strategies for a subject with a "Bonnie and Clyde" issue. At present eleven wikipedias allow such intentionally sitelinked redirects to be marked with a Template:Wikidata redirect template. On English Wikipedia this currently has almost 26,000 transclusions. A community RfC on Wikidata in 2017-2018 confirmed that there was community consensus to allow sitelinks to be added to redirects in this way, matching the results of an earlier RfC in 2013. Both the Wikidata Help:Handling sitelinks overlapping multiple items help page and the Wikidata:Notability policy page give advice on how such sitelinks to redirects may be created.

Nevertheless, a strong theme in the most recent RfC was that such redirects need to be much more clearly visible and distinguishable.

Creating two new Wikidata badges, one to mark a sitelink to a redirect, and a second to mark an intentional sitelink to a redirect, would be the obvious (and comparatively easy) way to achieve this.

Jheald updated the task description. (Show Details)Oct 14 2019, 11:36 AM

The badges, and corresponding bot, might be a nice quick win for Wikidata's 7th birthday.

Yeah adding two badges is easy enough. We just need the name and the icon for it.

agray added a subscriber: agray.Oct 14 2019, 12:26 PM
Jheald added a comment.EditedOct 14 2019, 4:52 PM

Thanks Lydia. I've started a thread at Wikidata:Project_chat#Badges_for_sitelinks_to_redirects to quickly see if there are particular icons people would prefer; and created two items, Q70893996 ("sitelink to redirect") and Q70894304 ("intentional sitelink to redirect") where we can start to assemble translations.

At the moment, I'm thinking perhaps File:Symbol redirect arrow blue.svg for the links in Wikipedia sidebars, and either File:Symbol_redirect_blue.svg or File:Symbol_redirect_blue.svg on the Wikidata item pages, in blue for redirects identified as "intentional", or in grey where this is not so clear. But people may come up with better suggestions.

If we add those badges, we should remove the mechanism that prevents adding redirects as sitelinks (per 2017 redirect RfC). I can remember one situation in German Wikipedia where a user got in trouble because they disabled/re-enabled too many redirects to link them to Wikidata, and some community members including an admin considered that as vandalism that had to be stopped.

Thus, if we do it, let's do it properly. Can someone link relevant phab topics?

There is some sense in what MisterSynergy says, but I also think there is sense in what @deryckchan wrote in the RfC (here), namely that there still ought to be some warning if someone tries to sitelink to a redirect page, and the user should be made to actively confirm that they didn't want to instead link to the redirect target. Otherwise I could see us ending up with a lot of accidental sitelinks to mis-spellings, which the present system mostly keeps us safe from.

For the most part the present workaround methods to allow a sitelink to be created to a redirect seem to mostly work acceptably enough (once a user knows about them). I can see that they may make life more difficult for large-scale programmatic addition of sitelinks to redirects; but for the moment let's get the badges in place first, so the community becomes much more aware of the existing sitelinks to redirects; then when that's in place we can come back to the question of whether it should be made easier to create new ones.

@Lydia_Pintscher - Having now kicked a few possibilities around on Project Chat, can we go for creating badges with:

As MisterSynergy said at Project Chat, if people want a change once they see how they look, that's easy enough later. But these look good for the time being.

Presumably the system already knows what size to scale the SVGs to for display -- at Project Chat I have been testing what they look like at 20px tall for the links on the wikidata item page, and 10px tall for the links in the sidebars of Wikipedia articles. Different scalings might be needed for screens with more pixels per inch, but as SVG is already used for the wikisource badges, I presume that's all coded in already.

Thanks for making this a reality.

From a totally different pov (wikisource), this would be nice too for links to "work pages" that can be DISAMBIG, but also REDIRECT as long as we have only 1 edition of a text... :)

JAnD added a subscriber: JAnD.Oct 17 2019, 6:54 AM
WMDE-leszek updated the task description. (Show Details)Feb 10 2020, 9:22 AM

This is apparently a sub-task of T54564, which is the Bonnie and Clyde problem (see on Wikidata Help:Handling_sitelinks_overlapping_multiple_items). I think the best solution is to radically delete all redirects from Wikidata, certainly not to add badges to them

Jane023 removed a subscriber: Jane023.

Change 571737 had a related patch set uploaded (by Itamar Givon; owner: Itamar Givon):
[mediawiki/extensions/Wikidata.org@master] Add badges for redirect sitelinks

https://gerrit.wikimedia.org/r/571737

Change 571738 had a related patch set uploaded (by Itamar Givon; owner: Itamar Givon):
[operations/mediawiki-config@master] Add definitions for redirect badges

https://gerrit.wikimedia.org/r/571738

Change 571737 merged by jenkins-bot:
[mediawiki/extensions/Wikidata.org@master] Add badges for redirect sitelinks

https://gerrit.wikimedia.org/r/571737

Change 571738 merged by jenkins-bot:
[operations/mediawiki-config@master] Add definitions for redirect badges

https://gerrit.wikimedia.org/r/571738

Mentioned in SAL (#wikimedia-operations) [2020-02-24T12:37:10Z] <ladsgroup@deploy1001> Synchronized wmf-config/InitialiseSettings.php: [[gerrit:571738|Add definitions for redirect badges (T235420)]] (duration: 00m 56s)

Mentioned in SAL (#wikimedia-operations) [2020-02-24T12:38:23Z] <ladsgroup@deploy1001> Synchronized wmf-config/InitialiseSettings.php: [[gerrit:571738|Add definitions for redirect badges (T235420)]], take II, the cache issue (duration: 00m 56s)

Jheald added a comment.Mar 2 2020, 9:46 AM

I tried to add an "intentional sitelink to redirect" badge on the English sitelink for asteroid 6765 Fibonacci, but got "Could not save due to an error. The save has failed."

Is there something else that needs to be enabled, and/or does it need special permissions to be able to add such badges?

I tried to add an "intentional sitelink to redirect" badge on the English sitelink for asteroid 6765 Fibonacci, but got "Could not save due to an error. The save has failed."

Is there something else that needs to be enabled, and/or does it need special permissions to be able to add such badges?

I was able to reproduce it. Basically you can add the badge to any sitelinks except the redirects (that redirect to another item).

{"errors":[{"code":"failed-save","module":"wbsetsitelink","*":"The save has failed."},{"code":"wikibase-validator-sitelink-conflict","module":"wbsetsitelink","*":"The link [https://en.wikipedia.org/wiki/List_of_minor_planets:_6001%E2%80%937000 enwiki:List of minor planets: 6001\u20137000] is already used by Item [[Q313483|Q313483]]. You may remove it from [[Q313483|Q313483]] if it does not belong there or merge the Items if they are about the exact same topic."},{"code":"failed-save","data":{"messages":[{"name":"wikibase-api-failed-save","parameters":[],"html":{"*":"The save has failed."}},{"name":"wikibase-validator-sitelink-conflict","parameters":["[https://en.wikipedia.org/wiki/List_of_minor_planets:_6001%E2%80%937000 enwiki:List of minor planets: 6001\u20137000]","[[Q313483|Q313483]]"],"html":{"*":"Site link <a class=\"external text\" href=\"https://en.wikipedia.org/wiki/List_of_minor_planets:_6001%E2%80%937000\">enwiki:List of minor planets: 6001\u20137000</a> is already used by item <a href=\"/wiki/Q313483\" title=\"Q313483\">Q313483</a>. Perhaps the items should be <a href=\"/wiki/Special:MyLanguage/Help:Merge\" title=\"Special:MyLanguage/Help:Merge\">merged</a> and one of them <a href=\"/wiki/Special:MyLanguage/Wikidata:Deletion_policy\" title=\"Special:MyLanguage/Wikidata:Deletion policy\">deleted</a>? Request deletion of one of the items at <a href=\"/wiki/Wikidata:Requests_for_deletions\" title=\"Wikidata:Requests for deletions\">d:Wikidata:Requests for deletions</a>, or ask at <a href=\"/wiki/Wikidata:Interwiki_conflicts\" title=\"Wikidata:Interwiki conflicts\">d:Wikidata:Interwiki conflicts</a> if you believe that they should not be merged."}}]},"module":"wbsetsitelink","*":"The save has failed."}],"servedby":"mw1227","*":"See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes."}
Jheald added a comment.Mar 2 2020, 4:46 PM

That's a bit of a problem, given what the badges are for...

Lydia_Pintscher reopened this task as Open.Mar 2 2020, 8:18 PM

Urgh yeah :/
Ok let's check what we can do.

Was also able to reproduce, but getting a different error:

{"errors":[{"code":"failed-save","module":"wbsetsitelink","*":"The save has failed."},{"code":"abusefilter-disallowed","data":{"abusefilter":{"id":52,"description":"Badge added","actions":["disallow"]}},"module":"wbsetsitelink","*":"\u29fcabusefilter-warning-badge\u29fd"},{"code":"failed-save","data":{"messages":[{"name":"wikibase-api-failed-save","parameters":[],"html":{"*":"The save has failed."}},{"name":"abusefilter-warning-badge","parameters":["Badge added",52],"html":{"*":"<b>Warning:</b> You are trying to add/remove badges to this item. At local Wikipedias adding or removing badges are done by consensus. Saving this edit was blocked and should be done only by administrators or trusted users. If you think you are correct, please <a href=\"/wiki/Wikidata:Administrators%27_noticeboard\" title=\"Wikidata:Administrators&#39; noticeboard\">contact an administrator</a>."}}]},"module":"wbsetsitelink","*":"The save has failed."}],"servedby":"mw1345","*":"See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes."}

@Ladsgroup How did you reproduce yours?

ItamarWMDE added a comment.EditedMar 5 2020, 10:32 AM

Clarification: Error above was reproduced in production for the item and sitelink mentioned in this ticket:

https://www.wikidata.org/wiki/Q568417
https://en.wikipedia.org/wiki/List_of_minor_planets:_6001%E2%80%937000#765

@ItamarWMDE I have granted you confirmed rights on wikidata, so you should be able to avoid the abuse filter now. Sorry about that

@DannyS712 Thank you, this is much appreciated.

Any progress on this?

Being able to add Wikidata sitelinks to redirects is important in my opinion because of things like French Wikipedia having an article about Proxima Centauri c but English just having a redirect that could become an article. Because it it is difficult to add a link to redirects from Wikidata, when someone turns ones like this into an article there is a high chance of duplicate items being made.

Also, having redirects connected to Wikidata is good because if I were looking for more detailed info and knew French or another language that happened to have an article about the planet, I could easily find that it did and read that instead.

Thanks, hope this gets fixed soon!

Sorry. We've been swamped a bit with other urgent tings but this is still on the campside radar so hope we can get back to it within the next month.

Any progress on this?

Being able to add Wikidata sitelinks to redirects is important in my opinion because of things like French Wikipedia having an article about Proxima Centauri c but English just having a redirect that could become an article. Because it it is difficult to add a link to redirects from Wikidata, when someone turns ones like this into an article there is a high chance of duplicate items being made.

Also, having redirects connected to Wikidata is good because if I were looking for more detailed info and knew French or another language that happened to have an article about the planet, I could easily find that it did and read that instead.

Thanks, hope this gets fixed soon!

Note that this requires action on the Wikipedia side, not the Wikidata side. Maybe if this was implemented somewhere and the community actually started using it, we could have a more useful discussion about this.

Change 602412 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/core@master] Make following redirects in MediaWikiPageNameNormalizer optional

https://gerrit.wikimedia.org/r/602412

Change 602422 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Do not follow redirects on setting sitelinks

https://gerrit.wikimedia.org/r/602422

I set up a set of patches that basically allows redirects to be set in wikidata as sitelink (whether if they have a badge or not). Is that acceptable @Lydia_Pintscher ?

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptJun 4 2020, 8:21 PM

For context, Wikidata now has over 85,000 sitelinks to redirects on English Wikipedia alone. Of those, at least 27,000 are intentional (to deal with the 'Bonnie and Clyde problem'). Perhaps it's time that we stop forcing people to use the workaround and accept that allowing sitelinks to redirects hasn't broken Wikidata and in fact is a good idea. The main objection that @Lydia_Pintscher and others raised at the RFC was that "it isn't clear how to keep the 'good' ones apart from the 'bad' ones", but the badging system (and existing templates like {{Wikidata redirect}}) provide a solution to that problem. I support merging @Ladsgroup's patch and hope others will consider it with an open mind.

kaldari added a comment.EditedJun 25 2020, 6:35 PM

This will solve T54564?

@Eugene - If you mean this specific task, no. If you mean Ladsgroup's patches discussed above, yes.

seav added a subscriber: seav.Jul 1 2020, 12:57 AM

Given that we now have the badges, I think it would make sense to automatically apply the batch when creating a sidelink to a redirect and not just allow people to create unbadged sitelinks to redirects.

@Addshore - Both Amir and myself have tried to ping @Lydia_Pintscher by Phabricator and email several times over the last six months to see if she had any remaining objections to merging https://gerrit.wikimedia.org/r/602412 and https://gerrit.wikimedia.org/r/602422. Neither of us have heard back, so I'm going to assume that silence means consent in this context. Unless you know something that we don't, it seems like we should move ahead with these patches, as there is community consensus in favor of this approach. (See RFC and Wishlist proposal.) As I mentioned above, it seems like Lydia's previous objections have been resolved by the redirect badge and templates like {{Wikidata redirect}}. What do you think?