Page MenuHomePhabricator

Create wikidata badges to indicate when sitelinks point to Wikipedia redirect pages
Closed, ResolvedPublic

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.

Q18989614 - Wikidata.png (159×431 px, 15 KB)

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

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

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)

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."}

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

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?

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

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 ?

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.

This will solve T54564?

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

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?

If there are no objections within the next two weeks, I'm planning on +2ing https://gerrit.wikimedia.org/r/602412 and https://gerrit.wikimedia.org/r/602422.

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602422/ still seems like a product decision by @Lydia_Pintscher and or @Samantha_Alipio_WMDE that needs to happen here.
It's a pretty large change to the status quo of this functionality, and the current state was a conscious decision made years ago (from memory).

Looking at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602422 this changes all input of site title to NOT be normalized.
This will probably lead to a large number of sitelinks being created as redirects, rather than just for the cases discussed here and in T54564 etc.

Briefly looking at T235420#5932084 it sounds like this could have a solution that doesn't change all sitelink title input.
This comment suggests that the issue is that badges can not be created on sitelinks that are redirects.
Is that functionality alone enough to meet the requirements here?
This ticket is after all about "Create wikidata badges to indicate when sitelinks point to Wikipedia redirect pages", not "do not use canonical pages names (including following redirects) when sitelinks are created"

@Addshore I agree with you that it could be solved diffrently. But come on, orriginal task is from Aug 6 2013, and still it is impossbile to add redirect! Many wikis have template like {{tl|wikidata redirect}}, Wikidata has already two badges for this purpose. But all that is useless without this patch. Thus or merge this one, or solve that other way but no more 7 years of discussions!

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602422/ still seems like a product decision by @Lydia_Pintscher and or @Samantha_Alipio_WMDE that needs to happen here.

In that case, would you mind asking one of them to respond here or at T54564? They do not seem to be responsive to Phabricator pings.

Looking at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602422 this changes all input of site title to NOT be normalized.
This will probably lead to a large number of sitelinks being created as redirects, rather than just for the cases discussed here and in T54564 etc.

That is correct.

Briefly looking at T235420#5932084 it sounds like this could have a solution that doesn't change all sitelink title input.
This comment suggests that the issue is that badges can not be created on sitelinks that are redirects.
Is that functionality alone enough to meet the requirements here?
This ticket is after all about "Create wikidata badges to indicate when sitelinks point to Wikipedia redirect pages", not "do not use canonical pages names (including following redirects) when sitelinks are created"

Either solution is fine with me, but just ignoring everyone isn't a good solution. The Wikidata community clearly favors allowing redirects as sitelinks and has been doing it via a workaround for a long time now. There's no good reason (that I've heard) to make it difficult.

@Lydia_Pintscher and I chatted today and we came to the conclusion that the current state of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/602422 is probably not the right approach, (per my comment at T235420#6791998)

A solution that would work would be Allow redirects to be used as sitelinks when one of the redirect related badges is set on the sitelink

This would mean that:

  • Default behaviour remains the same
  • If you want to create a sitelink for a redirect you can, IF you create it with the badge
  • If you want to add a redirect related badge to an existing sitelink then you can.

Looking at the patch lots of the code will end up being reused, but it will need the addition of some checks etc to optionally pass MediaWikiPageNameNormalizer::NOFOLLOW_REDIRECT into the service etc.

Not sure if this should remain in the TODO of the iteration or go throguh story time again as the specific details of what needs to / is to be done has changed quite a lot
cc @WMDE-leszek

reiterating on presenting the task to the dev team, making estimation etc would be beneficial in this case, I'd think

From task inspection: We also think this isn't super clear and will move it back to the main board for now.

Edit: Didn't quite know where to move it. Put it on the main board on top of prioritized product so it doesn't get lost.

Addshore's suggested way forward from 10 February seems very sensible.

In particular, it would finally allow bots to add the badges to triage existing sitelinks-to-redirects, which currently they are not able to easily do. This at the very least should be facilitated.

Lydia_Pintscher claimed this task.

I'm really sorry for all the time this takes. The delays are largely on me being swamped. Thank you so much for your patience.
Since the original badges are added now and this ticket is getting fairly convoluted I moved the remaining steps of actually making the badges usable to this new ticket: T278962 I'll move this to the top of the list of things to pick up by the team.

Change 602422 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/Wikibase@master] [WIP] Do not follow redirects on setting sitelinks

Reason:

This was done in I7bac9e6a25.

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