Template talk:RelatedWikipedia

WikiProjects tracking
Aim is to remove the RelatedWikipedia, RelatedCommons and RelatedCommonsCat templates when they reference the same as show via wikidata in the In other projects sidebar (directly or via redirect in the other project). If there is no direct equivalent page but a reference is desired then the rel=y parameter can be used in RelatedWikipedia and RelatedCommonsCat which will create an info box at the bottom of the page. (Once clean-up complete the extra parameter can be made default and removed). [ Refresh ]

No action required, will be emptied by bot

 * Category:Articles with Related Wikipedia same as Wikidata, (on 2018.01.26 was 21243). Currently -
 * Action: Once other categories clean then remove template. Template does not show entry in side bar.
 * Category:Articles with Related Commons category same as Wikidata, (on 2018.01.26 was 7119). Currently -
 * Action: Once other categories clean then remove template. Template does not show entry in side bar.
 * Category:Articles with Related Commons page same as Wikidata, (on 2018.01.26 was 2004). Currently -
 * Action: This could be changed to reference the Commons Category (but that can be another name). ( Will remove template by bot once other categories clean)

No action required, will be what remains

 * Category:Articles with Wikipedia links related to but different to article. Currently -
 * Intentionally different Wikipedia link labelled using rel=y parameter
 * Category:Articles with Commons links related to but different to article. Currently -
 * Intentionally different Commons Category link labelled using rel=y parameter

Possible investigation and areas for expansion

 * Category:Articles without Wikipedia links (via Wikidata), (on 2018.01.26 was 2450). Currently -
 * Check again for Wikipedia link, maybe merge of different Wikidata objects due to language variations.
 * Consider w:Template:Wikivoyage redirect to create w:Category:Redirects to Wikivoyage. (but limit)
 * Category:Articles without Wikipedia links, (on 2018.01.26 was 1749), (on 2018.01.26 was 1559). Currently -
 * Labelled by template no Wikipedia link, worth rechecking. Now redundant, template to be removed.

Needs attention

 * Category:Articles with Wikipedia links different to Wikidata, (on 2018.01.26 was 3350), (on 2018.05.01 was 2148). Currently -
 * Action: Investigate why different. Edit to be same or fix other issues. Often just a move of Wikipedia page, and pointing at redirect, in which case just remove template.
 * If different but related (and relevant) reference add rel=y parameter.
 * Category:Articles with Commons category links different to Wikidata, (on 2018.01.26 was 624), (on 2018.05.01 was 154). Currently -
 * Action: Investigate reason and fix. This maybe just a move and redirect of the commons category, in which case just remove the template.
 * If different but related (and relevant) reference add rel=y parameter.
 * Category:Articles with Wikipedia links and none on Wikidata (on 2018.01.26 was included in category above), (on 2018.05.01 was 412). Currently -
 * Action: Identify issue, probably edit or merge of Wikidata
 * If related (and relevant) reference consider adding rel=y parameter.
 * Category:Articles with Commons page links different to Wikidata, (on 2018.01.26 was 330), (on 2018.05.01 was 0). Currently -
 * Action: Correct, probably rename of Commons page. Edit to RelatedCommonsCat
 * Category:Redirects connected to a Wikidata item, (on 2018.04.29 was 360), (on 2018.05.01 was 377), (on 2018.05.01 was 591). Currently -
 * Can Wikidata point to another Wikivoyage article, if not delete Wikidata entry referencing Wikivoyage.

Checks

 * Wikivoyage pages referencing Wikipedia, Commons and DMZE via link (on 2018.01.20 was 24,608), (on 2018.01.26 was 0)
 * [?project=wikivoyage&depth=10&categories=Articles_without_Wikipedia_links_(via_Wikidata)&negcats=Articles_without_Wikipedia_links&comb%5Bsubset%5D=1&show_redirects=no&doit=1 maybe should but do not have] no Wikipedia link (on 2018.01.20 was 894).
 * Or could link to related but not exact (Wikidata) Wikipedia page, or Wikidata pages need merging.
 * [?project=wikivoyage&depth=10&categories=Articles_without_Wikipedia_links&negcats=Articles_without_Wikipedia_links_(via_Wikidata)&comb%5Bsubset%5D=1&show_redirects=no&doit=1 do but should not have] no Wikipedia link (on 2018.01.20 was 194) (on 2018.04.28 was 0)
 * Action: Usually swap no Wikilink template for RelatedWikipdia, occasionally correction to Wikidata.
 * Wikivoyage articles without Wikidata entry (on 2018.04.28 was 158)
 * Find Wikipedia page that matches and add to its Wikidata page, or create new Wikidata item.
 * [?project=wikivoyage&depth=10&categories=Articles_with_Related_Commons_category_same_as_Wikidata&negcats=Articles_with_Related_Wikipedia_same_as_Wikidata&comb%5Bsubset%5D=1&show_redirects=no&doit=1 same Commons cat, not same Wikipedia] (on 2018.05.5 was 417)
 * Action: Often indication of Wikipedia redirect page, if so remove RelatedWikipdia, occasionally correction to Wikidata.
 * [?project=wikivoyage&depth=10&categories=Articles_with_Wikipedia_links_different_to_Wikidata&negcats=Articles_with_Related_Commons_category_same_as_Wikidata&comb%5Bsubset%5D=1&show_redirects=no&doit=1 differnt on Wikipedia, same on Commons] (on 2018.05.5 was 1266)
 * Action: Could be indication of Wikipedia redirect page or similar overlapping page, if so remove RelatedWikipdia, occasionally correction to Wikidata.
 * Category:Pages using RelatedSites Currently -

Tasks

 * remove underscore, either edit article to change underscore for space or make template smarter to not differentiate. Done, template upldated.
 * Redirects. Find method to identify page references that are redirects.
 * Design a better format for link boxes of RelatedWikipedia and RelatedCommonsCat.

We need to remove all the RelatedSites links
Back in the WikiTravel days, we used an extension called RelatedSites to create interwiki links to Commons and Wikipedia in the sidebar. We now have these links created semi-automatically by Wikidata. See, for example, the sidebar at United States. It has a sidebar section called "In other projects" which links to the Commons category, the Wikipedia article and various other wikis. It then has a redundant "Related sites" section which again links to the Commons category and the Wikipedia article. The first section is created automatically via the Wikidata site links. The second section is created by links that are hard-coded into the WikiText of the Wikivoyage United States page. There is no reason for us to have both and the WMF would love to stop maintaining the RelatedSites extension and remove it. Before they can do that though, we need to remove all the hard-coded links, otherwise they will turn into regular red-links in the articles. Is anyone interested in creating a bot to do this? Are there any concerns with doing this? Kaldari (talk) 20:49, 18 January 2018 (UTC)


 * The Wikidata links only work well when there is a 1:1 relationship between WV and WP articles - which is most but not all articles. For instance see Lynton and Lynmouth. I think that we first need to consider how handle links in these cases - maybe a text box in "Go next", which could allow more than one link in such cases. AlasdairW (talk) 21:09, 18 January 2018 (UTC)
 * That sounds like a good idea (and how most other projects handle such cases). Kaldari (talk) 21:53, 18 January 2018 (UTC)
 * Is there a way to list pages using the relatedsites option like United States of America ? Any chance of generating a category when used so we can check against wikidata entries and Category:Articles without Wikipedia links (via Wikidata). --Traveler100 (talk) 21:59, 18 January 2018 (UTC)


 * Right now, the only method is to search (example), but that probably isn't very useful for bots. I'll create a Phabricator task to add such pages to maintenance categories (which will require a bit of hackery since these are just links rather than templates). Kaldari (talk) 22:11, 18 January 2018 (UTC)
 * Useful search syntax, thanks. Thinking about this more I have another idea. We could replace the link entry in all articles with a template which has the same name reference to Wikipedia. The template however checks via Wikidata if the Other Project link is the same, if so does not create a related link, if not it creates the related sites link or an inline see also link. --Traveler100 (talk) 07:22, 19 January 2018 (UTC)
 * In any case, I don't think we can completely eliminate the need to have extensions which the ability to place links into the sidebar. We used to have three different extensions placing different sidebar links, mw:extension:RelatedArticles, mw:extension:RelatedSites and mw:extension:Insider. The related articles extension was replaced with another extension (with, confusingly, the same name) which places the links at the bottom of the page. Wikidata is a partial replacement for RelatedSites, but only a partial replacement - as it only handles the case wher'e there's a 1:1 correspondence between Wikivoyage and another project. Insider (Docents) has no replacement. As such, the claims that WMF "won't have to maintain this anymore" are badly premature. If anything, I would've liked to see an extension created that replaces all three by allowing the tag to contain the more general "add sidebar link to section X with title Y and link target Z" instead of arbitrarily abandoning all page-specific sidebar links. K7L (talk) 14:19, 19 January 2018 (UTC)
 * How common is it that Wikivoyage pages don't have correspondence on other projects? I imagine that would be rare. It's important to understand that there is a real cost to keeping the RelatedSites extension maintained. Even if no features are added and no bugs are fixed, the code still has to be kept up to date with newer versions of MediaWiki and PHP, sometimes requiring significant refactoring (for example, the recent shift to extension registration). Because the WMF is such a small organization, that means not having as much time and resources to work on other projects that will be of much more benefit to Wikivoyage, like maps. Kaldari (talk) 22:46, 19 January 2018 (UTC)
 * As a first step how about using RelatedWikipedia. The pagename  could be replaced by  in all articles. This template is currently set to do the same thing, but also creates some administration categories we can use to check page links. It can then later be changed to use different method of showing the link and not duplicating the link if the same as the Other projects link in the sidebar. --Traveler100 (talk) 21:13, 19 January 2018 (UTC)
 * That's a really nice idea! Should we do the same for Commons links? Kaldari (talk) 22:50, 19 January 2018 (UTC)
 * Yes can set that up too. Can run a bot to make the change but would like some input from other regular contributors before doing so. This will edit most articles on the site but initially will not change anything about how the page looks or works. --Traveler100 (talk) 07:15, 20 January 2018 (UTC)
 * Anyone know what the #invoke:Wikidata syntax is to retrieve Commons link for a page? Sometimes it is under Other Sites commons, sometimes under P373 (Commons Category).--Traveler100 (talk) 07:46, 20 January 2018 (UTC)
 * Think will have different templates for referencing a Commons page and an Commons category. RelatedCommons and RelatedCommonsCat. have not work out the correct syntax yet to get commons page, but have written bot to make change if/when decide to go with this. --Traveler100 (talk) 10:53, 20 January 2018 (UTC)
 * The Commons category is almost (but not quite always) much better to link to than the Commons page, as it tends to be where all of the relevant photos are (or at least are linked from, in subcategories). -- Ikan Kekek (talk) 13:06, 20 January 2018 (UTC)
 * Agree but first step would not change what decision someone has made. It will however create categories so you can easily find and go through the articles referencing the Commons page rather than the category. --Traveler100 (talk) 13:31, 20 January 2018 (UTC)
 * OK worked out the code for Commons page from Wikidata. Templates and bot ready to go if other think we should change the syntax (but at this point no change to page or function). --Traveler100 (talk) 17:14, 20 January 2018 (UTC)
 * There are just under 7000 pages with a Dmoz link, should I get the bot to remove it from all articles?
 * Yes, please. I tried to save DMOZ but it's a dead issue. :/ —Justin ( koavf ) ❤T☮C☺M☯ 07:01, 21 January 2018 (UTC)
 * Agree, there were some tentative efforts to save DMOZ, but I think it's best to remove those links now. Kaldari (talk) 00:16, 23 January 2018 (UTC)

First step - test sample
Updated the pages and categories in Category:North America. Please check, if no issues found will in later (say 12 hours) start the bot on the rest of the site.

First interesting result is the categories are showing links that are either redirect pages or no longer existing categories. --Traveler100 (talk) 19:41, 21 January 2018 (UTC)
 * A large number of articles with Wikipedia links different to Wikidata are due to the moving of Wikipedia pages so are pointing to redirects. I am trying to find a programmatic way of checking this but cannot get Module:Redirect to work across projects. See Template:RelatedWikipedia/sandbox. Anyone with an idea? --Traveler100 (talk) 19:55, 22 January 2018 (UTC)
 * That might be tricky to solve. Any idea how common that is? Would it be feasible to just put those cases into a special category for a human to review and make a decision? Kaldari (talk) 00:19, 23 January 2018 (UTC)
 * I would say about 25% of Wikipedia sidebar references do not match the Wikidata name. Of those most, maybe 90% but that is what is difficult to check, are just a different because of a move/redirect. The rest are reference to close but not exact articles on Wikipedia. I am splitting those that are difference to the wikidata name but differentiating within that group I have not found a way yet. --Traveler100 (talk) 06:50, 23 January 2018 (UTC)
 * It looks like there are also some weird links like Special:Search/Alamosa, Colorado. I assume those should either be changed to a category or removed. Kaldari (talk) 20:04, 23 January 2018 (UTC)
 * First step done. Related sites controlled by templates. Now need to check and clean up the data and look at changing how handled and displayed. --Traveler100 (talk) 23:32, 25 January 2018 (UTC)

Remove RelatedWikipedia
What is the purpose of RelatedWikipedia? We already have "In other projects" followed immediately by "Related sites". Just remove related sites entirely, since we are not linking DMOZ or Citizendium and Commons and Wikipedia are linked as other projects... What am I missing here? —Justin ( koavf ) ❤T☮C☺M☯ 07:32, 23 January 2018 (UTC)
 * The long term aim is to get rid of the Wikipedia link in articles. This template is the first step. There are a number of articles that do not have a direct equivalent WIkipedia page but have a relatedpagename  link to a similar and useful page. Simply removing the link from all articles would remove that information. Swapping the link to the template allows us first to see how many of these there are. Also with a very minor change to the template can automatically removed "Related sites" entries that are exactly the same as "In other sites" entries. The current running update chances nothing in the pages but set up a template that allows for quick changes. --Traveler100 (talk) 08:06, 23 January 2018 (UTC)
 * Thanks. This is a perfect thing for in the future. It's possible to have a property like "Wikivoyage fallback" and define where users should be pointed on en.wp in case there isn't a single one-to-one corresponding article. —Justin ( koavf ) ❤T☮C☺M☯ 08:16, 23 January 2018 (UTC)

Next step
Now we need to get the Wikivoyage community to empty out all of these maintenance categories by reviewing and syncing the Wikidata entries (before the RelatedSites extension is turned off): Any idea how we can drum up volunteers to do that? Kaldari (talk) 21:34, 6 February 2018 (UTC)
 * Category:Articles with Wikipedia links and none on Wikidata ( pages)
 * Category:Articles with Wikipedia links different to Wikidata ( pages)
 * Category:Articles with Commons page links different to Wikidata ( pages)
 * Category:Articles with Commons category links different to Wikidata ( pages)
 * FYI, RelatedSites may be turned off fairly soon. If you want to comment on this, go to mw:Talk:Code stewardship reviews/Feedback solicitation/RelatedSites. Kaldari (talk) 21:39, 6 February 2018 (UTC)
 * Maybe at d:Wikidata:Project chat? I mean, I can help too. —Justin ( koavf ) ❤T☮C☺M☯ 21:39, 6 February 2018 (UTC)
 * Well we could reschedule Cotm activities. --Traveler100 (talk) 22:01, 6 February 2018 (UTC)
 * Any idea how to pragmatically identify redirects on another project? --Traveler100 (talk) 22:01, 6 February 2018 (UTC)
 * If the RelatedSites gets turned off before all the categories get cleaned up can easily change the template to show Wikipedia and  Commons links in a box at the bottom of pages. --Traveler100 (talk) 22:05, 6 February 2018 (UTC)
 * The wikitext editor needs to be altered, as at the moment it has Sidebar Templates: which give the two templates which we are no longer using. Either the new related templates should be substituted or these two should just be removed. Unfortunately I don't know anything about how this can be done.
 * I went ahead and removed the templates from the editor (after no one responded to my comments on the talk page). Kaldari (talk) 16:13, 11 February 2018 (UTC)
 * I think that we also need to get others involved in the discussion about what form the replacement links should take, then the related templates can be altered to achieve this. And thank you to Traveler100 for all the hard work on the new templates. AlasdairW (talk) 22:15, 6 February 2018 (UTC)


 * I changed your comment to have auto-updating numbers. —Justin ( koavf ) ❤T☮C☺M☯ 08:52, 11 February 2018 (UTC)
 * Oh cool! Kaldari (talk) 16:13, 11 February 2018 (UTC)
 * Looks like no one is migrating the links. Any chance we could start a community drive to fix these? Kaldari (talk) 17:31, 6 March 2018 (UTC)
 * For what it's worth, I did take a look at a few of these awhile ago. What do you propose is the solution to (e.g.) Beech_Forests_of_Europe? —Justin ( koavf ) ❤T☮C☺M☯ 08:39, 7 March 2018 (UTC)
 * For that one, I would just remove the RelatedWikipedia link (since it's pointing to an outdated redirect). Kaldari (talk) 16:44, 7 March 2018 (UTC)
 * The redirects, generally to the correct page, are a problem. There are a large number of them and I cannot see an automatic method of identifying, checking and/or correcting them. --Traveler100 (talk) 10:03, 7 March 2018 (UTC)
 * My suggestion would be: If the page is in Category:Articles with Wikipedia links different to Wikidata and the RelatedWikipedia link points to a redirect, just remove the RelatedWikipedia link, under the assumption that the Wikidata link is more up to date. This might not be 100% accurate, but it will be right most of the time. Then we can manually fix the ones that are left. Kaldari (talk) 16:44, 7 March 2018 (UTC)
 * But I cannot see a method in template or with AWB script to identify a redirect in a sister project link. --Traveler100 (talk) 22:30, 7 March 2018 (UTC)
 * Yeah, I think you would have to write a proper bot for that (that used the MediaWiki API to check for redirects). Kaldari (talk) 19:05, 9 March 2018 (UTC)

So there are a number of pages with related Wikipedia links that are to article that are not direct equivalents but of interest. Please take a look at this as a method of handling it. Removed need for Related on sidebar and provides a method of marking checked articles. --Traveler100 (talk) 15:02, 18 March 2018 (UTC)

Please help migrate related site links
The RelatedSites extension (which creates the links in the "Related sites" sidebar section) will be disabled sometime in the next few months. In most cases, this won't cause any problems since these links are now automatically created by the Wikibase client extension (under the "In other projects" sidebar section). For example, on the article Africa (permalink in case someone fixes it), the links under "Related sites" are repeated under "In other projects" and are exactly the same links. In some cases, however, these links differ. There can be many causes of this: one link is more up to date (e.g. reflecting a page move on Wikipedia); one link is wrong (e.g. linking to a disambiguation page instead of the exact topic); one link is more specific or general (e.g. linking to a city instead of a region); two Wikidata items need to be merged, etc. Please help to resolve these difference before the extension is disabled. Here are the pages that need to be fixed: If the link in the "In other projects" section is the better link, simply remove the RelatedWikipedia, RelatedCommons, or RelatedCommonsCat template from the page. If the link in the "Related sites" section is the better link, please update the data in Wikidata to match it and then remove the template from the Wikivoyage page. If you have questions, please ping me or Traveler100. Thanks! Ryan Kaldari (WMF) (talk) 18:47, 9 April 2018 (UTC)
 * Category:Articles with Wikipedia links and none on Wikidata ( pages)
 * Category:Articles with Wikipedia links different to Wikidata ( pages)
 * Category:Articles with Commons page links different to Wikidata ( pages)
 * Category:Articles with Commons category links different to Wikidata ( pages)


 * Unfortunately there are some special cases which I don't think Wikidata can handle. For example both Rail travel in Canada and Across Canada by train use RelatedWikipedia to link to Rail transport in Canada. I understand that the Wikidata page can only take one Wikivoyage link. I think that we should look at how to handle these (and the cases where the two links are different).
 * Maybe the related templates could become a text box in "Go next", like the WP template Wikivoyage that is used to link in the other direction. I would also like this to allow for multiple WP links (max 5?), but I am happy to back down on this if it is a step too far for some. AlasdairW (talk) 23:06, 9 April 2018 (UTC)
 * Was thinking along similar lines. In the sandbox of the related template there is a version that makes the Wikipedia a reference box if it is not the same as that on Wikidata. --Traveler100 (talk) 06:01, 10 April 2018 (UTC)
 * RelatedWikipedia updated, will not display the Wikipedia link in the Related Sites section of the side bar if it is identical to the In other projects name. If the parameter rel=y is added the sidebar entry will be moved to an info box at the bottom of the page. --Traveler100 (talk) 12:24, 27 April 2018 (UTC)
 * See tasks for May Collaboration of the month. --Traveler100 (talk) 07:38, 1 May 2018 (UTC)
 * I processed 10 articles from the second category: Eight were redirects and thus redundant, while two were erroneous. This is a small sample but it seems to indicate that a mass removal might not be such a bad idea for this category. Cheers! Syced (talk) 05:50, 8 May 2018 (UTC)

✅ all main-space articles have been fixed, still a few user pages and project pages using RelatedSites. --Traveler100 (talk) 14:44, 27 May 2018 (UTC)