Module talk:Cycling race

Add topic
Active discussions

See also:

There is no automatic archiving set up for this talk page.

test the moduleEdit

Converted tableA to use MW HTML libraryEdit

Hello, I converted tableA function to use HTML_library. I think it made the function more readable. I think it does not take too much resources. Learning it took not that much time and you can mix this API with plain HTML. I propose to use this more in this module. --Papuass (talk) 16:09, 11 December 2019 (UTC)

This will not have a huge impact of how the module works, but it will make easier to work with code and ensure that all tables look the same (right now they do not). I think this was one of reasons why enwiki decided to stop using it. --Papuass (talk) 11:34, 12 December 2019 (UTC)
Hello, it is true that the output of the module right now looks like <td><th>blabla</td></th>, which is less readable than | ||blabla. However with some HTML, it will look like the first, I suppose. I will read it and maybe make a try, but I am not convinced it will solve the readability problem. Psemdel (talk) 10:05, 27 December 2019 (UTC)
here an example of such coding. Psemdel (talk) 10:12, 27 December 2019 (UTC)
I know it is not a complete solution, but at least it makes it easier to not forget to close some HTML tags. --Papuass (talk) 10:35, 27 December 2019 (UTC)
I cannot read sorry, I thought you wanted it to be done. It was a good idea, it is quite clear now. Psemdel (talk) 12:43, 31 December 2019 (UTC)
  Done I will try on new_classification. Psemdel (talk) 16:44, 31 December 2019 (UTC)

  Done I did it for all functions. I also tried to make the code better. I suppose, we can still improve by looking for code written twice. There can still be some typo here and there. Psemdel (talk) 17:56, 6 January 2020 (UTC)

Great job, that made code a bit smaller and now it is easier to improve. --Papuass (talk) 08:42, 7 January 2020 (UTC)

UCI ProTeamEdit

In connection with the change in the status of teams, he created another Pro Team (Q78464255). When the name of the World Teams changed, we indicated both the old and the new. Until the season has begun and the team seasons for 2020 have been created:

  • Q20638319 UCI ProTeam (2005-2014) — current UCI WorldTeam (2015–.....) (Q6154783)
  • Q78464255 UCI ProTeam (2019-.....) — former, ex-UCI ProContinental Team (2005-2019) (Q382927)

And add to the module if we use. Only a big request with separate (new) values from the translation (transcription) local function headoftableIII(x), and not use the ones already there. For ru-wiki, I made them all hyperlinks so that they lead to the necessary article about the status of the team. — GAN (talk) 13:51, 14 December 2019 (UTC)

I created UCI Women’s WorldTeam (Q80425135), I hope it was not already there. Psemdel (talk) 11:08, 31 December 2019 (UTC)
Psemdel, je suis paumé là pour le coup. Par exemple, je voudrais afficher dans l'infobox pour Saison 2005 de l'équipe cycliste MrBookmaker-Sports Tech la notion d'équipe continentale professionnelle et non UCI ProTeam. Car actuellement c'est anachronique. Maintenant on a 3 éléments wikidata qui s'appelle UCI ProTeam, c'est très complexe à comprendre. Bordurie (talk) 19:33, 3 January 2020 (UTC)
@Bordurie:, j'avoue que là l'UCI s'est surpassé! L'idée de GAN, c'est que ce n'est pas la catégorie qui a changé de nom, mais une nouvelle catégorie. Autrement dit, il faut changer tous les items des équipes conti. Psemdel (talk) 15:09, 4 January 2020 (UTC)
@Psemdel: So can you update the code in order to when the team have Q78464255 (if no articles created here) use the link for Q382927? Due here at Q382927 all wikis have article to UCI Pro Continental and UCI ProTeam. Repf72 (talk) 01:56, 9 January 2020 (UTC)
Yes, it can be done. Psemdel (talk) 20:27, 9 January 2020 (UTC)

Reuse of code at Danish WikipediaEdit

For your information: I have copied some code from the module to other modules at dawiki. The iterator statements and the functions getStatementForTime and flag is used in da:Modul:Flag. The table flags is used in da:Modul:Flag/data.

I used these modules in another little module da:Modul:Wikidata løbshistorie which creates a child infobox with history data for races: First edition, Editions, First winner, Most wins, Most recent. You may want to look at it for inspiration or your own use. If you have any questions I will try to help. --Dipsacus fullonum (talk) 22:58, 19 January 2020 (UTC)

On WP:fr we have also something similar: fr:Module:Infobox/Descriptif course cycliste2 (probably not so well coded as you do). Psemdel (talk) 13:12, 9 February 2020 (UTC)

Propolsal: Move tables of constants to separate data module(s)Edit

I propose that all large tables with only constant strings, numbers and boolean values are moved into one or two data modules. This will be all the l10nDef and other translation tables, the flags table, the jersey and jersey color tables, the classes tables, the formats table, the blacklist tables, the UCI tables for the calendar and maybe other tables.

The data modules can then be loaded into Module:Cycling race with the mw.loadData function which will mean that the tables will only be loaded and parsed once for each page instead for as now in every use of {{#invoke:}}.

You could put all data into one data module, but I think two might be better: Module:Cycling race/data for data which are used by all users, and Module:Cycling race/l10n for localization data. You could then save more memory by removing the localization data for all other languages than your own and only make localization updates at your local wiki. That have obvious advantages, but may also make maintenance harder when new functionality is added or changed. I think both solutions will give significant faster loading of pages which have many tables made by different parts of the module. I would to hear your opinions about this. --Dipsacus fullonum (talk) 00:56, 21 January 2020 (UTC)

I would support that but I am interested in suggestions how to ensure that all modules are copied to other wikis. This would also allow to keep only relevant translations on every wiki (one of problems enwiki users indicated when they decided to remove this module). --Papuass (talk) 19:22, 21 January 2020 (UTC)
I have considered the translations more. I think it is necessary to keep all translations to all languages here at Wikidata. Otherwise it would be too much trouble when new texts to be translated are made. But that doesn't mean that every wiki needs to have all the translations. You could remove the unneeded translations when you copy the module from Wikidata to your local wiki. To test the possibilities I made a small module in a sandbox in da:Modul:Sandkasse/Dipsacus fullonum/Modul:Sandkasse (permanent link to current verson). It is rather crude and may not work correctly, but shows the idea. It is used at da:User:Dipsacus fullonum/sandkasse/skabelon. --Dipsacus fullonum (talk) 13:16, 22 January 2020 (UTC)
You already make this offer a few time ago. At that point, I was quite sceptic, because we lose the "everything is updated at once" that mentioned Papuass. However, I am ready to change my mind as:
  • A big critic that we get all the time about this code, is that it is too long (for sure). Most of the lines are however those "data".
  • You explain, it would save memory. There, I trust your good computer science knowledge.
  • 2 years ago, the code changed all the time, requiring an easy update step. Now, I think the code has reached a mature state. I don't have idea for new functions. We improved the structure this winter, to make it more clear. I expect (hope) the number of updates to decrease quite significantly in this year. Psemdel (talk) 13:40, 9 February 2020 (UTC)
The amount of data will be the same, so it not save memory as such. It will make pages load faster if they have many templates which use Module:Cycling race because it takes considerable time to create and initialise tables in lua, and that will only be done once if the data is in a separate data module. --Dipsacus fullonum (talk) 18:20, 9 February 2020 (UTC)
I started some experiment, but it needs some work. Psemdel (talk) 16:44, 29 March 2020 (UTC)
In details, I made a Module like that [[1]], I call it in [[2]] with
local l10n = mw.loadData("Module:Psemdel2")

but it sends me an error " data for mw.loadData contains unsupported data type 'function'." Any idea? Psemdel (talk) 20:05, 29 March 2020 (UTC)

@Psemdel: The error message in very clear. As described in the manual data loaded with the mw.loadData function may not contain functions but only constants (strings, numbers, booleans and tables). So only the tables and data can be moved to a data module, while the functions using the data cannot. I suggest making a generic translate function which takes a table of translations as one of its arguments. The data module may look like this
  startlist = {"Liste des participants", "Num", "Coureur","Pos","Directeur sportif :", "AB", "HD", "NP", "DQ", "route", "chrono", "et", "sans équipe", "afficher", "masquer" }

  startlisttable = {"Liste des participants", "Num", "Coureur", "Équipe", "Pos" }

  race_reference = {"Source : ", "Sources : " }
It can then be used like this:
local l10n = mw.loadData("Module:Psemdel2")
local function translate(translations, index)
	return translations[index]

local translated_text = translate(l10n.startlist, 5) .. translate(l10n.startlisttable, 3)
  .. translate(l10n.race_reference, 1) .. 'etc.'
--Dipsacus fullonum (talk) 20:59, 29 March 2020 (UTC)
PS. The translate function can even be obmitted:
local l10n = mw.loadData("Module:Psemdel2")
local function translate(translations, index)
	return translations[index]

local translated_text = l10n.startlist[5] .. l10n.startlisttable[3]
  .. l10n.race_reference[1] .. 'etc.'
But then error handling may be harder. --Dipsacus fullonum (talk) 21:05, 29 March 2020 (UTC)
I can read now, sorry, without example in the doc, it is always difficult to understand how it works/should work. I will work further when I have some time. Psemdel (talk) 06:45, 30 March 2020 (UTC)
  Done Psemdel (talk) 13:29, 31 March 2020 (UTC)

Adaptation for french wikinewsEdit


Could someone adapt that module for french wikinews. There are two changes to make :

  • Color of tables for french wikinews should be #BCE1FF instead of #FFDF80
  • Links to others articles should not use [[ ... | ... ]] but {{w| ... | ... }}

Thanks --Mattho69 (talk) 20:02, 8 March 2020 (UTC)

@Mattho69: We don't do wikinews here. And why the second point? Psemdel (talk) 11:08, 22 March 2020 (UTC)

We need a new item "postponed" when a cycling race is postponedEdit

Hi Guys. I'm checking Kit to translate but I didn't find an item when a cycling race is POSTPONED (not cancelled at all) to another date. This item is important because Giro de Italia 2020 was postponed (not cancelled) and I need show that caption within /listofwinners to Giro de Italia list of winners by year, but I need add an item within the property winner when the race was postponed. Does anyone agreeing with me? Let me know. Thanks! --Douglasfugazi (talk) 01:18, 14 March 2020 (UTC)

Ok Psemdel (talk) 11:07, 22 March 2020 (UTC)

New bib (like jersey)Edit


I have create a bib for team's classification Q87718074, but the background color of listofstagesclassification don't change from white to the same yellow of yellow jersey (general classification). Can you do it ?

Thanks, AirSThib (talk), the 16:05, 14 March 2020 (UTC).

1. This jersey is already there. Wikidata:WikiProject Cycling/Kit to translate/Jerseys. All of them without the phrase "leader after the stage."
2. The holder of a jersey with a color number is not highlighted by the module.

GAN (talk) 16:25, 14 March 2020 (UTC)

@GAN: Thanks for your answer ; I haven't see this item. So I have highlighted the column and it's a success ! Thanks, AirSThib (talk), the 16:43, 14 March 2020 (UTC).

30th NovemberEdit

Just for info, I found out why there is/was the 30th November bug. For recalling, in wikidata there is let's say 2013 and the date is displayed 30 November 2012 :/. In fact, it happens if the month is "00" (instead of "01") and the day also "00". Psemdel (talk) 11:12, 22 March 2020 (UTC)

@Psemdel: I that case the real bug is that the precision field of the date value isn't tested. If the precision is "year", the values for month and day may be 0 or any other value and should never have been used. --Dipsacus fullonum (talk) 22:39, 26 March 2020 (UTC)
I agree, that the bug was on our side. I implemented a test to see if month is 00. Maybe a test with the property precision would be better. Don't hesitate to modify. Psemdel (talk) 18:47, 31 March 2020 (UTC)
I just found the code and I will modify it. Dates are often encoded as "YYYY-00-00" when the precision is year, but month and day can be any values so test for the value '00' isn't adequate. --Dipsacus fullonum (talk) 21:28, 31 March 2020 (UTC)


To handle previous issue and improve the reliability of the module, especially concerning names, I introduced some UnitTests: Module:Cycling race/Test, results are in the discussion page. So we can test the small functions separately. More tests should be implemented. Of course for the big functions, it won't work, but still it is an improvement. Psemdel (talk) 12:02, 26 March 2020 (UTC)

Without parameter?Edit

Is it possible to change this module so that it also works without a q-value as parameter? Then it would use the q-value for the page it is included on.--Pirker (talk) 16:58, 9 July 2020 (UTC)

The infobox work according this principle. It is less flexible, as you cannot display on a page information from another page: for instance the stages of a Tour. You can have a look here: [3], [4]. I cannot say exactly which part of the code do that. Psemdel (talk) 11:44, 28 October 2020 (UTC)


Hi! Anyone know how to get a proper ProCyclingStats race ID at PCS's website? I created Q98148687 but couldn't find "raceid" at their website as typical link there is like ([5]). 99kerob (talk) 14:42, 8 August 2020 (UTC)

The 'instance of' property is being overusedEdit

Please see Wikidata talk:WikiProject Cycling#The 'instance of' property is being overused. I've started a discussion there which would heavily affect this module. –IagoQnsi (talk) 01:28, 13 August 2020 (UTC)

I see it now. So to sum up:
Current Proposed
instance of (P31) Amstel Gold Race (Q478174)
instance of (P31) 1.UWT (Q22231106)
instance of (P31) cycling race (Q15091377)
sports season of league or competition (P3450) Amstel Gold Race (Q478174)
competition class (P2094) 1.UWT (Q22231106)

It seems reasonable to me. What is your opinion on the topic? Psemdel (talk) 15:45, 22 October 2020 (UTC) Inventar of the things to change in the module then:

  • raceLink, insert P3450
  • getMainRaceLink, insert P2094 and P3450
  • fn_race, for UCI test insert P3450
  • fn_getClassInfo, to be rewritten in accordance with fn_race.
  • maybe nationalchampionships_main
  • stageinfobox, insert P3450
  • infobox, insert P3450

For Infobox on WP:fr :

  • Module:Infobox/Cycliste, no change
  • Module:Infobox/Descriptif course cycliste2, use P279 for the class, it should be harmonized.
I implemented the feature in the module. If we decide to use other properties, the change won't be long... Psemdel (talk) 13:14, 23 October 2020 (UTC)

In all rationality, the "teamCats" (UCI World Tour, Professionnal...), should be also moved from P31. P2094 instead maybe? Psemdel (talk) 08:50, 24 October 2020 (UTC) When we speak property P5138 instead of P361 for the team season could be an idea. Psemdel (talk) 19:33, 30 October 2020 (UTC)

Still no opinion on this topic? Psemdel (talk) 18:56, 30 November 2020 (UTC)
We should progress on the topic. Now we have both systems that can run parallel. It is confusing. I don't get the feeling there is a consensus on the topic. For instance P2094 is used for "women cycling" sometimes which makes it not available for the "classes"... Any other idea? Psemdel (talk) 15:14, 15 May 2021 (UTC)

UCI ProSeriesEdit

To display the title of the ProSeries calendar add in Module:Cycling_race/l10n at the end of calendar_translate text , "UCI ProSeries"GAN (talk) 11:47, 17 September 2020 (UTC)

Wikidata:WikiProject Cycling/Kit to translate/National teamsEdit

All possible variants of national teams for all countries. A part may have duplicates, since it was not possible to double-check everything. — GAN (talk) 10:32, 27 September 2020 (UTC)

@GAN: Thank you for creating and maintaining these structures in the first place! I'm currently trying to understand what's there and how the data is structured. I have a question of understanding: Is this table specifically about road bicycle racing (Q3609), or more generally about cycle sport (Q2215841) (including road racing, but also cyclocross, MTB, track, etc)?
For the national teams of Hungary and the USA, most likely there was a mistake - I fixed it. — GAN (talk) 12:05, 3 July 2021 (UTC)
Is this intentional? E.g., to pick a hypothetical example, if one ever want to have a "Belgium men's elite national cyclocross team", would that become a part of Belgium national cycling team (Q86916217), tagged with sport (P641) cyclo-cross (Q335638), or would that go into an entirely different structure?
National teams in other disciplines. Yes, they will enter the structure. It is only advisable to place them in a separate table (separate article), for convenience (mtb, track, cyclocross).
This list was originally created for ease of searching for prefabs when using "Module:Cycling race". Which is mainly used for road cycling. Therefore, there are only national road teams. — GAN (talk) 12:05, 3 July 2021 (UTC)
PS: The "elite B" category seems to be used by Egypt only? -- Rz98 (talk) 11:09, 3 July 2021 (UTC)
Elite "B" - on the Tour de France, sometimes several national teams competed from the old - en: 1939 Tour de France. I also met 2-3 national teams at African races. — GAN (talk) 12:05, 3 July 2021 (UTC)
  • @Rz98: I marked the answers after your questions.

I can suggest the following structure option:
national cycling team:
- national road cycling team:
-- men
-- women
-- men's U23
-- women's U23
- national track cycling team:
-- men
-- women
GAN (talk) 12:05, 3 July 2021 (UTC)

  • @Rz98: If you plan to create teams in other disciplines, then yes. If not, then decide for yourself. If you change, can you rename it to Russian at the same time? The file contains the necessary for this and the names of the main teams in other disciplines in Russian if you decide to create.— GAN (talk) 14:06, 3 July 2021 (UTC)

Infobox for raceEdit

Is there any plans to create an infobox for race (in addition to the one for race edition) with number of editions, last winner, name history, category etc.? Pirker (talk) 14:08, 30 September 2020 (UTC)

The fr-wiki has a separate template module with this functionality. — GAN (talk) 14:35, 30 September 2020 (UTC)
It would be great to add that here the same way as other parts of module are added. I would love to use it on but importing it from is too hard for "non-technical" user like me :(. 99kerob (talk) 15:29, 14 October 2020 (UTC)
It is separated, because it uses Module:Infobox (Q13107716), which is separated from this module. It also makes it easy to replace information from wikidata with local information in wikipedia. Infobox is however available for all wikis, so, normally (edit: I had a look, the code does look different in pl and fr...), you can just copy/paste the code from fr-wiki to WP:pl. Psemdel (talk) 15:27, 22 October 2020 (UTC)
I don't really know how long it would be to program such a function. If it is reasonable, I will give it a try. Psemdel (talk) 08:52, 24 October 2020 (UTC)
So I added a new function raceinfobox. Thanks to GAN for the checking. I also added new unit tests. The "get_local_content" is present, but I am no expert from this point. PS: I try to optimize a few things tomorrow. Psemdel (talk) 12:10, 30 October 2020 (UTC)
@Psemdel: Thanks for your work! So it is not ready yet? Will you write an instruction how to import that at each wiki when you will finish? For now I simply copied French subpage into Polish Wiki but it doesn't work there (I guess that pl:Moduł:Cycling race needs to be updated but I don't want to mess it up ;). 99kerob (talk) 14:03, 30 October 2020 (UTC)
@99kerob:, yes wait until tomorrow, I just noticed small things (a translation is missing for instance). And yes, a documentation is needed. I ping when I am done. Psemdel (talk) 15:24, 30 October 2020 (UTC)
@99kerob:, I improved the code according to Dipsacus fullonum's one. It should be ok. Psemdel (talk) 10:10, 31 October 2020 (UTC)

@Psemdel: I updated the module and copied all the translations. Does not work. Throws an error related to the race categoryШаблон:Cycling_race/raceinfobox andШаблон:Cycling_race/calendarcustom And you can't manually set your image. Even on fr-wiki {{Cycling race/raceinfobox|Q1810324 |Image = Crystal Clear app kworldclock.png}} {{Cycling race/infobox|Q1810324 |Image = Crystal Clear app kworldclock.png}} added translation for the line "number of races for a specific year"

if not details[1].content
where missing. But still not correct. To be continued. Psemdel (talk) 20:53, 3 November 2020 (UTC)
  Done Psemdel (talk) 21:35, 3 November 2020 (UTC)

To answer GAN:

  • I would place the block of official names in front of the winners
On WP:fr we put it below the "name" so all information about names is at the same place
Then at least swap the list of names and the logo (you can show how to put the list of names down - I'll try to change it locally in the ru-wiki). And you can make it possible to resize the image manually. The default 300px is sometimes a lot. Race names by date are not sorted. The template for cycling teams in the French wiki is similar in structure, but there the previous names are located at the bottom of the template

GAN (talk) 07:20, 1 November 2020 (UTC)

  Done Sorting and names before winners. Psemdel (talk) 20:53, 3 November 2020 (UTC)
  • make right after the main title and in front of the image the ability to add arbitrary text on a white background
Still not sure what is needed?
  • Can a display be made for multiple winners of team races?
Actually it is working, it is just that I used team season as winner, so Specialized-Lululemon 2012 != Specialized-Lululemon 2013. Given the number of TTT in a season, I don't invest time in that.
Clear. With teams, you can also try using for seasons — GAN (talk) 07:20, 1 November 2020 (UTC)
  • Support for more languages (including Russian) for official titles. Russian races are officially called in Russian.
On WP:ru the russian name will be displayed. On WP:fr not, because "nobody" can read that over here.
  • Main title format for infoboxes -> font size, position and size of the icon. The main color of all templates. You can make it possible to set these parameters at once for all infoboxes for a particular wiki.
I inserted the silver theme from WP:da (good idea). Which setting do you want exactly? Psemdel (talk) 10:10, 31 October 2020 (UTC)
|style="background:#FFDF80; font-size:15px;" | [[File:Cycling (road) pictogram.svg|left|27px]] '''ABCabc'''
  Done Size slightly reduced (260px instead 300 px). Psemdel (talk) 20:53, 3 November 2020 (UTC)

There were problems with admins related to the design of templates.GAN (talk) 07:20, 1 November 2020 (UTC)

I may have forgot one #FFDF80. I don't really see what is the problem, if the different wiki use different background color :D. Psemdel (talk) 19:07, 1 November 2020 (UTC)
The problem is not because of the background color, but because of the wide and large header of the text :) — GAN (talk) 21:38, 1 November 2020 (UTC)

@Psemdel: The mod version is the same on all three wikis. But race categories are displayed differently
classLink = classLink(classID) causes an error in ru-wiki, so I had to replace classLink = classLink

GAN (talk) 18:17, 1 November 2020 (UTC)

I will have a look, but I cannot say when. Psemdel (talk) 19:07, 1 November 2020 (UTC)
@GAN: I already write about that at my discussion. Race categories are displayed differently because category is "hidden" from infobox if particular Wiki don't have an article about that circuit - if at you will create article for example about UCI Africa Tour missed categories for Tour de Senegal will appear at infobox automatically (I created missed articles about UCI Continental Series at yesterday at it is now working that way). I think that should be changed and in such case when such Wikipedia don't have an article about circuit linked at Wikidata just info about category without a link should be displayed in infobox instead of hiding that info. 99kerob (talk) 20:26, 1 November 2020 (UTC)
@99kerob: Happened. But some of the articles have not yet been created for the convenience of checking the solution to the problem. — GAN (talk) 21:38, 1 November 2020 (UTC)
@Psemdel, GAN: I don't know why (I guess it has something in common with last GAN's edits) but now exact problem happened to Template:Cycling race/victories at which is strange because a few days ago it worked fine. Now info about categories for races that has a link as a P:P361 to circuit that don't have an article at (for example UCI Europe Tour 2018) just disappeared and made a terrible effect on many pages - see for example pl:Uno-X Pro Cycling Team. I don't know how but it should be corrected ASAP as template is used in over 30 pages. 99kerob (talk) 19:55, 3 November 2020 (UTC)
There is a problem with the module when compared to its old version. Now in the draft Psemdel I write in detail with examples. — GAN (talk) 20:03, 3 November 2020 (UTC)
There was a confusion between a variable name and function name (LUA does not make the difference). Moreover pl:Uno-X Pro Cycling Team has no class, no chance that a class is displayed. Psemdel (talk) 20:53, 3 November 2020 (UTC)


Hi every one, I've got a big news Today. Wikidata has lots of advantages for the display of cycling-data, however it also creates some boring and redundant tasks, such as creating team season for instance. In 2017, I programmed myself a bot/script in Python to automatize all these things (I am not the only one, Repf72 has also one, if I am right). The code was always open, but still I cannot expect from all wikipedia cycling contributors to know Python. That's why I programmed this year a web site: for this purpose. You can for instance import rankings or start list directly. As written on the main page, I will grant the rights progressively to the new users. All feedbacks are welcome, there is surely still many points to improve. Psemdel (talk) 15:27, 22 October 2020 (UTC)

Women UCI classes?Edit

Most of the UCI classes are the same for men and women: 1.1, 2.1... It makes understanding of the data somewhat difficult. As we are anyhow thinking of moving the classes from P31 to something else, it may be the right time to think over. Should we create 1.1 (Women),... Of course, this won't be displayed (this is easily solved, there are not so many classes). What do you think? Psemdel (talk) 07:21, 31 October 2020 (UTC)

(I move that here)
To define women's races, I can offer d:P2094 --> d:Q920057
But in the men's calendar it is now more difficult:
  • five continental tours. Races in which they have the same categories
  • several races (French in South America and Russian near China) that were included in different continental tours
  • a race can be included in several calendars at once. For example, a national cup or a U23 category race in an adult and youth cup
  • the race can change the category, but not change the calendar. Was one-day, but became multi-day or vice versa
(it's like for a cycling team - a team category and a usi code)
Therefore, I would suggest separately display the category separated by commas (,) and separately the calendar through "
" :using for example "d:P642"
Ok, so this solution was too easy. We have to look for the circuit/calendar, understood. UCI is not ruled from computer scientists. I already use P642 for that, so it is definitely ok. P2094 for the class or for women cycling? We will have to decide those points as written above, and use some bots to put it clean. It will become the chaos otherwise. Psemdel (talk) 09:47, 31 October 2020 (UTC)
you can still make a request to add new elements "d" --- "calendar / tournament" which includes the race and "UCI race category" — GAN (talk) 10:02, 31 October 2020 (UTC)

P1813 and Aleksandr Vlasov/Alexander Wlassow/Aleksandr WłasowEdit

Hi! I noticed a problem at module for a small group of cyclists whose "original" names are written in cyryllic. In different languages there are used different types of transcription from cyryllic into latin alphabet (for example Александр Власов will be "Aleksandr Vlasov" in English, "Alexander Wlassow" in German and "Aleksandr Własow" in Polish)". In most cases it is solved by displaying a name from a label for each cyclist. But there is a problem when such cyclist has also set an info like official name or short name because module don't use a specific language for each Wikipedia but he first one set at Wikidata - for example Q3341512 has set both an official name in French ("Nikita Stalnov") and Polish ("Nikita Stalnow") which are different (as we use different transcriptions from cyryllic) but on Polish Wikipedia French version instead of Polish one is displayed as it was added earlier on Wikidata. Same problem appeared also for Vlasov but I solved it by deleting these claims. In case of Stalnov it can't be done that way as he changed his surname (he was using one surname until 2014 and other one since 2015) and it can't be displayed properly via a label. 99kerob (talk) 15:38, 3 November 2020 (UTC)

@99kerob:, it is an interesting case. I don't see any easy solution. Name is really the most difficult topic: no name is bad, bad name is bad also. Psemdel (talk) 19:04, 3 November 2020 (UTC)
I tried something in the code, (detection of "vna" and "vitch" in the russian label). I have however no mean to test on wiki fr. Psemdel (talk) 16:02, 7 November 2020 (UTC)

Season 2021Edit

In addition to races, created a list for teams

GAN (talk) 18:04, 17 November 2020 (UTC)

If the export function from UCI website works again, it will be even possible like last year for me to create the women races at once. But it is not working for month now at my place... Psemdel (talk) 19:52, 20 December 2020 (UTC)
@Psemdel: This? (talk) 10:13, 21 December 2020 (UTC)
No, I mean there is an export (to excel) button on the UCI website. So you can export the result, and then reimport then with whatever you want (an API would be more elegant, but I don't know if there is one). I use my bot to do that. Unfortunately this export button make an 404 for 3 month now on Chrome, and for 3 weeks on Firefox at my place... Psemdel (talk) 18:59, 21 December 2020 (UTC)
Is this button here? I made this file using it in Firefox. — GAN (talk) 19:24, 21 December 2020 (UTC)
Almost the same, but in ranking (then there is no pdf) or in result. And then it does not work. Psemdel (talk) 16:52, 31 December 2020 (UTC)

Text style in infobox headlinesEdit

The headline in infoboxes as created by the function infoInitTab() have the CSS style font-size:175%; The big letters are criticized on dawiki where the headline in infoboxes is usually font-size:125%; font-weight:bold;. I have looked at other Wikipedias and it seems that it is normal elsewhere as well. Will anyone protest if I change infoInitTab to this? --Dipsacus fullonum (talk) 18:19, 30 November 2020 (UTC)

No problem for me. Psemdel (talk) 18:55, 30 November 2020 (UTC)

Rider infoboxEdit

I inserted an alpha version of rider infobox. Still some works to do:

  •   Done Managed team does not work
  •   Done Test the use of local data
  •   Done Documentation

Other to do for the next weeks:

  •   Done Implement the changes from GAN
  •   Done I implemented a distinction between road/mountain bike... though the use of qualifiers P642. It works fine for rider infobox, but I should also adapt the other functions.
  • "Slavic" plurals (singular = 1, 2-4 = plural type 1, >5 = plural type 2...)
Ok, I fear that I will introduce more mistake than solve them...

When the changes are done, many tests to do. So be patient before copying to your Wikipedia! Psemdel (talk) 12:09, 31 December 2020 (UTC)

  • @Psemdel: Awesome news! How can I help with testing? 99kerob (talk) 12:16, 31 December 2020 (UTC)
@99kerob:, thank you for the feedback. In 1 or 2 weeks when everything is finished, I ping you. Then, you should try using the new function on one rider and see what happens in Polish, if it is fine for a second rider and so on. There are always so many cases to consider that a few cycles are necessary. Psemdel (talk) 16:06, 31 December 2020 (UTC)
@99kerob:, it should work.


  • Does the infobox needs a minimum width?
  • Do we display the flags? On WP:fr we normally display the nationality of the rider, but it is difficult to get the conversion France --> French in all languages, at least I don't know any easy way. So I display the country now. With flag is nice, but there is a huge problem with USSR (red flag :D) for all those who born there.
  • Do we display the country of birth? On WP:fr we relly on hyperlink to clarify.
  • Do we split between amateur and pro team? It is son on WP:fr and WP:en.

Technical issue: how to display "Between the title and the photo to add. You need to manually add a short name in your native language with the language specified" Psemdel (talk) 13:33, 9 January 2021 (UTC)

  • @Psemdel: I tried it in my draftbox at for some cyclists. It looks really nice. Some things to discuss:
    • What is "Lateralisation"? Is it a parameter to declare if person is left- or right-handed? ;) I thing that we don't need such parameter in infobox (same as blood group) - definitely not important for a cyclist, I have never seen such info in any infobox
I agree and comment it out.
    • "Awards" looks really strange - check for example how it looks for Lance Armstrong. This parameter on Wikidata contains completely different things as national orders, sport awards etc. Wikidata miss a lot of data for this parameter (compare article about Lance at to Wikidata item), moreover even if we will add all missed data section with Lance's awards in infobox will be much longer that other parts of infobox (at I guess that it could be even longer than whole article ;)). Do we really need such parameter?
Obviously, it looks weird. I freeze input from Wikidata on that.
    • Some time ago at we decided to delete "weight" parameter from all sportpersons infoboxes as this is a parameter which change a lot for each person during their life. Is it possible to hide this parameter just for our Wiki?
I insert a parameter for that. On WP:fr we normally have also no weight.
    • Parameter "Managerial teams" is for a teams that such cyclist was a sports director? I guess so but I cannot find any example which will display this parameter in infobox so I want to clarify that ;). If yes which parameter at Wikidata we should use at (former) cyclist's item to display that in infobox?
    • If we want to separate amateur and pro teams teams marked as club cycling team should be also displayed in "amateur teams" section (it is even a subclass for amateur cycling team at Wikidata) - now they are displayed in same section as UCI teams
    • Speciality is now imported from P:P413. If this parameter is missed (for most items it is missed) shouldn't we just use P:P641 instead?
I don't know what is the traduction in polish, but in French P641 is only sport. So we would have "cycling" all the time, which is not useful in my opinion.
    • In case of an age of cyclist there is a French word "ans" which should be translated through "l10n" subpage
That is the point where I wanted the "slavic plural". Good that you remind it.
    • If athlete joined a team during a season a number for month is displayed which looks quite weird for me (for example "4.2017-2018" in case of Stanisław Aniołkowski). Wouldn't it be better to display it in way "[name of the month] year-year", which will in this case "kwiecień 2017-2018" for We rather use that way at our wiki
It is difficult to read then, as the column is narrow. You can insert it, but I won't do it. It depends on the language. In German, it is quite normal to give the number of the month instead of its name for instance.
    • At we also have a link to Commons at bottom of infoboxes (check for example: pl:Piotr Brożyna). Is it possible to add it too? A small link on the left side of the screen above interwikis are quite hard to catch for users
It is normally displayed on the left bar, if it is documented in wikidata (not the case for Piotr Brożyna). But ok, I can add it.
    • For country of birth I think that we don't need, hyperlink to the place is a good solution, country will make it really difficult (for example if someone was born in Tallinn in 1987 right country will be Soviet Union, not Estonia which will make a lot of troubles)
    • Flags are difficult topic ;). Some people likes them, some not, I don't have any strong opinion on them
    • For nationalities I just translated that parameter as "country" so it can be displayed that way, I don't see a problem here 99kerob (talk) 19:37, 9 January 2021 (UTC)
Thanks for the feedback, I look in detail tomorrow. Psemdel (talk) 19:46, 9 January 2021 (UTC)
  • @Psemdel: I copied your changes into Polish Wiki but it causes a problem with rider infobox (check pl:Wikipedysta:99kerob/brudnopis100), probably because phrase "age" is missed in "Module:Cycling race/l10n". I have also one more suggestion for rider infobox: we should also use "P1559" for non-Latin names and surnames (for example for Russian cyclist we should also have in infobox his name and surname written in cyryllic). 99kerob (talk) 15:02, 15 January 2021 (UTC)
    • I would suggest the following order of output: first "birth name (P1477)" and then "name in native language (P1559)". As these values may differ. "P1559" is more likely for people who have changed their last name and / or first name. — GAN (talk) 15:27, 15 January 2021 (UTC)
      • @99kerob: Added age WD and pl-wiki. Check your draft. — GAN (talk) 15:49, 15 January 2021 (UTC)
      • The module has a 50th translation for the rider template translate("riderinfobox",50). The module has a 50th translation for the rider template. And I counted fewer translations for this section. "thinking emoticon". — GAN (talk) 15:49, 15 January 2021 (UTC)
Yes I had to add 2 new translations for those plural. About P1559 why not, so for the top of the infobox? The number of properties that we use for names is really huge. Psemdel (talk) 09:45, 16 January 2021 (UTC)
        • @Psemdel:I would leave the top line for free text addition. To be able to indicate, if necessary, the name of the rider in a third language (for example, Asian names in Latin) or the name of the folk language by which he is known in the races.
I will add a parameter
-Display of the place (city) of birth and / or death. The module displays the current city name. And there should be the name of the city at the time of the person's birth / death. (We display the names of all teams at the time of the race, not at the moment.) This is relevant for many cities of the former USSR. (Zabelinskaya should have Leningrad instead of St. Petersburg).
-The ru-wiki has a module for such a mapping. He displays the name of the city and the entire geochain (district / region / region / country) where it was then located on the specified date.
The whole module already exist on WP:fr using such existing modules, here we have to develop again to become independent from the WP.
- {{#invoke:Psemdel1|riderinfobox|Q1903470}} About division into amateur and professional teams. Seven lines instead of two without separation.

GAN (talk) 13:36, 16 January 2021 (UTC)

It is an exception. For such a case, you can still insert the information manually. Psemdel (talk) 14:20, 16 January 2021 (UTC)
@99kerob: I added a "subtitle" field for the name of a rider in original language that appears on WP:ru. So the "subtitle" was added in the translation list which is in Moduł:Cycling race/l10n. I stop touching to the translation thing. Psemdel (talk) 11:47, 23 January 2021 (UTC)
@Psemdel: Thanks, now it works. Few other things before I finally start using that infobox in articles at
  • I found one other untranslated thing - if athlete was a "trainee" it is displayed in infobox like "team name" ("stagiaire") where "stagiaire" is untranslatable. 99kerob (talk) 08:15, 24 January 2021 (UTC)
  Done I missed that. Psemdel (talk) 15:25, 24 January 2021 (UTC)
  • Also in case of "P1477" or "P1559" written in Russian it is not displayed in infobox - for example in Vlasov case. 99kerob (talk) 08:18, 24 January 2021 (UTC)
Vlasov has presently a P1559 in "ru" cyrillic. It is not displayed for the languages that don't understand this alphabet. It means every one except "ru" and "mk" presently.
  • At we are adding medals into infoboxes by using pl:Szablon:Medalista infobox - is there any chance to make it working with your infobox? I tried to copy section with medals into "medale=" section but these two just doesn't cooperate at this point ;). Check pl:Wikipedysta:99kerob/brudnopis100 how it looks for Hirschi. Maybe it is possible for module to simply don't display not needed parts of code of "Medalista infobox" ("{| class="infobox" |- | colspan="2" style="text-align:center; background:#EAECF0; font-weight:bold;" | Dorobek medalowy |- | colspan="2" style="padding:0;" |" at the top and "|- |}" at the bottom)? If it is not possible or will be too difficult to make an exception for at infobox I will just use version 2 instead (displaying medals outside "module infobox"). 99kerob (talk) 08:41, 24 January 2021 (UTC)
It is a table in a table with different css. It is possible but, the template should be modified for this purpose.
It is in two teams at the same time. Still have no solution for that. Psemdel (talk) 15:31, 24 January 2021 (UTC)
To explain a bit more, I fill a table with for each month, the team, the name of team and the category of the team.When it changes I make a new row. But here you have two teams at the same time (which can happens only for trainee). It makes a bit of chaos. I will think if I should create a table trainee... As a reminder by women there is no trainee, I never think about that to be honest. Psemdel (talk) 15:38, 24 January 2021 (UTC)
I will try to solve that in the coming week.
  • @99kerob, Psemdel: Is it possible for a trainee to alternately play for two teams during his internship? As far as I know, a trainee in cycling is a kind of analogue of renting in football. On bike statistics sites for trainees, they write two lines: the date when he left the main team and the date when he joined the new team as an intern.
-See how Lorrenzo Manzin ( teams are recorded for 2014. Two until 31-07 and from 01-08 (Trainee) entries with the indication "trainee".
-Do this only for trainees. Moreover, the "team roster" template uses the same data to display when the rider played for the teams.
A very good point. Teamroster must "chose" between two teams. One more thing to implement.
-There are also trainees in women's cycling. Look 2.17.008 (USI regulations) Examples:
- Alice Towers and
- Kate Wootton
- Maeva Squiban and

GAN (talk) 19:36, 24 January 2021 (UTC)

It happens hardly ever. And for women, what is the difference between a trainee not paid, and a full time job not paid... Let's say it is less in focus. Psemdel (talk) 19:45, 24 January 2021 (UTC)
I thought a bit longer on this trainee topic, as I thought it would be necessary to solve it. But the more I am thinking, the more I see that the whole algorithm based on the fact, that there can be only one team for a rider at one moment. Then another part of the algorithm identifies when this team change (id/name/category). Only easy way would be too display it as the Mountain bike, so trainee would be a completely different category. But it makes no sense at all in my opinion. Moreover, as written a bit above, two teams at the same time will lead to problem with all other functions (they will pick one of both on random principle). Eventually, it may be noticed that even when a rider is full time professionnal, he can keep its club. So in fact, they always have 2 teams, but nobody care. Just keep the professionnal team as Gan proposed, I think it is really a very minor distortion of the reality. Psemdel (talk) 19:32, 25 January 2021 (UTC)

Gan's changeEdit

@GAN:, so when I look more closely to your code, I see 2 main changes:

  • Introduction of InfoboxChamp. Could you display somewhere, what happens when we use infobox instead of InfoboxChamp, as they are just a copy paste from each other?
  • Changes in listofwinners

Any other main changes? Psemdel (talk) 14:44, 9 January 2021 (UTC)

It shows what elements of Wikidata are used and there are examples:
- The main difference in the display of the venue of different titles, including for races / medals
- Season - only one "location" line for a continent and / or countries. Everything without flags.
The championship is now three separate lines: the country with the flag, the city, the stadium / location. And there may still be several countries where the championship was held on different dates.
Thank you for the documentation. But really, Infoboxseason and InfoboxChamp are pure copy/paste from infobox! Same for listofwinners_custom and listofwinners_main! That is very bad practice to have code in double (and it takes space). Also next time, please merge regularly with the master, here I have to look for what changed in between, that is really not efficient. And why is there no winners in InfoboxChamp?
The change from
[ 'Q28092831' ]=translate("listofwinners",17), -- rookie
[ 'Q28092831' ]=translate("listofwinners",2), -- rookie
is also a big change, as it changes completely the display. What happens if we want the different rankings in one table. Psemdel (talk) 14:02, 10 January 2021 (UTC)
-Code in double format - that's the only way I can. My level is worse than yours. :)
-What is "merge regularly with the master"?
-There are no winners "InfoboxChamp" so as not to overload the template. More than 10 medals are currently being played at the Road World Championship. This is more than 30 people. If everyone displays what will happen then?
My level is also not extraordinary to be honest, Dipsacus fullonum is way better for instance. So I suppose, I will have to make the adaptation to avoid that... For winners, ok but then you should have deleted that part of the code. Dead code is confusing for the reader. Concerning "merge with the master". It is vocabulary from version management. What I call the master is the real module, here, Module:Cycling race. My Module:Psemdel1 or your Module:GAN-Cycling-race are branches. They come from the master but are independent from the master. Our goal is to improve the master. So "sometimes", when we think that the changes we made in our branches are correct (this should be normally validated by tests), we replace the original master code through our changes. This step is called "merge". It works fine when the master stays as it is between 2 merges. But if you wait too long, the master changes also and then we have to spend time sorting out what is the best code... Wikidata and Wikipedia have a very good version management (history) but have no way to make branches in a clean way. So if I don't know that you develop in parallel, it is very probable that our versions won't be compatible. The only way to merge is manual copy/paste also, which can lead to mistakes. That's why it is better to make small steps, so everybody can see here the last version. Psemdel (talk) 14:46, 10 January 2021 (UTC)
So I imported the module from wikidata to WP:fr, it seems to work. Of course, I had to change all templates on WP:fr and also adapt the l10n module. So be careful! Psemdel (talk) 16:27, 16 January 2021 (UTC)
@Repf72:, the problem with listofstagesclassification by Giro 2020 (ranking that are only therefore for the general ranking) is solved. Hope there is no side effect. Psemdel (talk) 14:33, 17 January 2021 (UTC)
@Psemdel: Can I turn off leaderboard autocomplete for the last stage? For example, at the Tour de France, "supercombative" is not determined at the last stage. But this cell is populated with the value from the totals. {{#invoke:Psemdel1|listofstagesclassification|Q50411777}} and fr:Tour_de_France_2020#Évolution_des_classements --> 21e étape --> Marc Hirschi — GAN (talk) 14:49, 17 January 2021 (UTC)
Are you sure, there is no combative the last stage? One exception more... Psemdel (talk) 14:54, 17 January 2021 (UTC)
@Psemdel: Regulations tour de france 2019 --> Page 13 in French and page 33 in English. Right column, second paragraph from the bottom. And in the 1950s, there were two classifications of supercombatives. Regulation text from en-wiki: In addition, there was a combativity award given after each stage to the cyclist considered most combative. The decision was made by a jury composed of journalists who gave points. The cyclist with the most points from votes in all stages led the combativity classificationGAN (talk) 15:22, 17 January 2021 (UTC)
Correct, I will add the exception (thank you ASO). Psemdel (talk) 15:25, 17 January 2021 (UTC)
The first thing of course if there is no combative on the last stage is to leave the database blank so.
Actually, it is not that bad, I just inserted an exception for the combativity, which shall never be extrapolated (actually logical). Psemdel (talk) 19:44, 18 January 2021 (UTC)

Calendar dataEdit

For calendar and riderranking, I moved the

	["europe"] = { -- Q1194340
		['2021']= 'Q103964987', ['2020'] = 'Q74842812',
		['2007'] = 'Q1780660',['2006'] = 'Q1455600',['2005'] = 'Q1431816'

To /data. Be aware, that I replaced the "2010-11" through "2011", because it makes no sense at all in my opinion. Check if it impacts your templates on your local wikipedia. Psemdel (talk) 13:48, 23 January 2021 (UTC)

Rider rankingEdit

I imported that template at today and plan to use it in our articles but have one question: why for male cyclists places in UCI World Ranking isn't displayed there? You check that even at's list of examples where Marianne Vos has all data presented but Amund Grøndahl Jansen has only data from continental tours and nothing about UCI World Ranking (he has data about that ranking for 2018-2020 seasons at Wikidata but it isn't displayed at teamplate). 99kerob (talk) 17:45, 30 January 2021 (UTC) @Psemdel:

@99kerob: I have been importing the ranking the last 3 weeks (as written here somewhere the UCI export of ranking in Excel file was down until the beginning of the month), right now the UCI world ranking 2018 is being imported see here. I hope I am done by the end of the week. For the women, I did the work last year. Normally, I write about women cycling you know. Psemdel (talk) 18:07, 30 January 2021 (UTC)
I read again your message, and you are right, something is missing. Psemdel (talk) 18:09, 30 January 2021 (UTC)
I got confused between World Tour and World Ranking, now it should be ok. Psemdel (talk) 19:02, 30 January 2021 (UTC)


Hi again @Psemdel, GAN: ;). I use module more and more and noticed some problems:

  • name of the month in data at Polish language should be conjugated (writing it in basic form is a language mistake) so in both Rider and Race infoboxes it should be displayed: "stycznia" instead of "styczeń", "lutego" instead of "luty", "marca" instead of "marzec", "kwietnia" instead of "kwiecień", "maja" instead of "maj", "czerwca" instead of "czerwiec", "lipca" instead of "lipiec", "sierpnia" instead of "sierpień", "września" instead of "wrzesień", "października" instead of "październik", "listopada" instead of "listopad" and "grudnia" instead of "grudzień"
See answer from GAN. Russian has also some declinations for the month. If it is still not correct, I will adapt.
  • according to ProCyclingStats we have more than one (for some teams even three of them) sports-directors for 2021 Paris-Nice race but startlist part of module displays only first one for each team , next ones are not displayed at all
Yes, I had also the problem actually. I will fix that.
  Done, was easy.
  • I noticed also one other problem with a startlist - at yesterday's African RR Champs some cyclists have really weird starting numbers not "compatible" with other cyclist from their NT (for example South African guys had numbers 23-30 and last one had 92) which causes a problem with displaying it with a startlist part of module as it automatically separates that last one rider to "another" team as his number is "too different" from other ones on his team
Here, I have really no idea. The principle is that the riders are sorted through number and then the algorithm checks that that last team = next team. I mean normally all riders of a team have consecutive numbers..
I should rewritte the algorithm, but I will look at that.
  • rider ranking part of module is broken for Yonathan Monsalve as it gets an error like this: "Błąd Lua w module „Moduł:Cycling_race”, w linii 7643: attempt to index field '?' (a nil value).". It is the only one article that this occured so far (I am slowly adding both rider ranking and cyclist infobox to articles at but will take some time to do that as I am the only one user doing so there)
I get the same error. Let's have a look.
  Done Ok, was a mistake in 2011-2012.
  • and last one is not an error but possible feature - do you plan to create team infobox which will be working similar way to cyclist infobox? I would love to use such one as it will be really useful ;)

99kerob (talk) 09:05, 7 March 2021 (UTC)

Never thought about that but why not (we already have something like that on WP:fr). When I find some time... Psemdel (talk) 12:19, 7 March 2021 (UTC)
@99kerob: Names of months. Formulas for displaying dates (including months) are used for all languages. For the Polish Wiki, the names of the months in the module are spelled out in full words in two places. Search for these places through a manual search (or on lines 585 and 646). It needs to be done manually with — GAN (talk) 09:53, 7 March 2021 (UTC)
@GAN: It was already done long time ago as I can see (for example in line 640 to 644 at we have:

"elseif wiki == "pl" then local date_pl = {"stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia"} endtime = lang:formatDate( "j ", eTime ) .. date_pl[tonumber(lang:formatDate( "n", eTime ))] .. lang:formatDate( " Y", eTime )" but it is still displayed as "styczeń", "luty" etc. (check for example: pl:Strade Bianche 2021 - it is "6 marzec 2021" in infobox and should be "6 marca 2021". 99kerob (talk) 10:01, 7 March 2021 (UTC)

  • Composition of teams. I would suggest making a separate, slightly modified table for the national teams.:
- next to the name of the team / star, display its flag
Why not.
- Make UCI-cod a link to the country
No, in French we have a link to the national selection. As back-up maybe.
@Psemdel: I suggest the following (links to fr-wiki for clarity)
National team link
UCI-cod as text
National team link
UCI-cod as a reference to the country (not the national team)

GAN (talk) 13:22, 7 March 2021 (UTC)

- remove the flags and the abbreviation of the country in brackets from the riders in the list. They are all from the same country.
Good idea, have to think how it goes.
- disable grouping by numbers. Now if there are no numbers, then the grouping goes by teams. On ITT, numbers can be distributed according to the start time.
As written above, it is a whole different algorithm. And I don't have a property start time.
@99kerob: For ITT and such small start list, you can use startlisttable here. It is not ugly if the numbers are messed up.

GAN (talk) 09:53, 7 March 2021 (UTC)

  • @Psemdel, GAN: Two more things from me:
    • Can you add a small icon of Commons linking to proper category to all other infoboxes in a way it currently works at Rider infobox?
  Done Why not. Psemdel (talk) 16:39, 2 April 2021 (UTC)

Nikita StalnovEdit

  • There is a problem with displaying names of Nikita Stalnov in rider infobox at as his surnames are written differently in French and Polish (Poland use different transcription for all Cyryllic languages) - in such case at only Polish version (Umierbiekow/Stalnow) should be displayed as French one (Umerbekov/Stalnov) is simply wrong in Polish language. 99kerob (talk) 12:47, 2 April 2021 (UTC)
    • @99kerob: pl:Wikipedysta:99kerob/brudnopis100 do you mean "Skrócone imię i nazwisko"?
      • @GAN: Exactly. 99kerob (talk) 13:52, 2 April 2021 (UTC)
        • @99kerob: I did not transfer this template to ru-wiki. Most likely, you need to bind the language to a specific Wiki somewhere in the data output settings. So that other languages are not displayed. — GAN (talk) 15:41, 2 April 2021 (UTC)
I will have a look. It is not an easy topic. Psemdel (talk) 16:42, 2 April 2021 (UTC)
If it is too hard to do maybe easier way will be to just delete this parameter in an infobox? P1813 is used quite rarely for cyclists on Wikidata and not really much needed in a Rider infobox. 99kerob (talk) 17:58, 2 April 2021 (UTC)
For women, it is needed, as they often change name during their life. Psemdel (talk) 08:49, 3 April 2021 (UTC)
Should be better now. Psemdel (talk) 09:41, 3 April 2021 (UTC)

Team infoboxEdit

A template for a cycling team has been added to the module. Ability to add jersey using the "2" argument in any way. The number of seasons that the template displays is the number of elements specified in has part or parts (P527). Please support a new element for the specified "bike" template. — GAN (talk) 22:30, 4 April 2021 (UTC)

  • I imported it into and trying it here. My thoughts:
    • If team had only one status (like Mazowsze Serce Polski being an UCI Continental Team all the time) years next to it should be displayed too (now years are displayed only if team had at least 2 statuses like Astana)
What is the supplementary information here?
    • For general director also years are missing (at least in case of Vinokurov in Astana)
      • I agree. Only one person can be listed, but he did not hold the position for the entire period. — GAN (talk) 09:36, 5 April 2021 (UTC)
        The infobox should display all managers given in wikidata with the period, if it is not the case, it should be fixed. Psemdel (talk) 07:58, 13 May 2021 (UTC)
    • Info about country should be imported from main Wikidata item and all countries should be displayed there with years, not only one (for example Astana had 3 different countries as they registered place but only Kazakhstan is displayed in infobox)
      • I put "normal" rank instead of "not recommended" for Switzerland and Luxembourg. Now displays. — GAN (talk) 09:36, 5 April 2021 (UTC)
    • Past/current/next season part of infobox is displayed in a weird way - for example for Astana we have both articles about 2020 and 2021 season at so in infobox 2020 should be displayed as past one and 2021 as current one but there is only 2021 displayed as past one. 99kerob (talk) 07:40, 5 April 2021 (UTC)
      • The reason is the date indicated in start time (P580). If it is less than the current one, then the season is considered to have already passed. Likewise in the racing template. — GAN (talk) 09:36, 5 April 2021 (UTC)
Originally, the algorithm is there for the races. The idea is to display the one the people would like to see most probably. When I go to Ronde van Vlaanderen, we want most probably to see the last one (2021), as we are in May. For Tour de France, it may be 2020 or 2021 that's why both are displayed. In the case of a team, I suppose only the present one should be displayed, except at time like November/December where we want also to see the next one. The case is a bit different, the algorithm can be changed when we agree on the wanted behavior. Psemdel (talk) 08:04, 13 May 2021 (UTC)

Lua error in Module:Cycling_race at line 1271: translation missing in Module:Cycling race/l10n of your wikipediaEdit

I was wondering if someone can help me with this error message on Did I miss something? Thanks in advance EricSabell72 (talk) 13:25, 8 April 2021 (UTC)

  • @EricSabell72: If you're talking about the module error on the Wikidata page. This is most likely due to the transfer of almost all translations to the additional module. If the error is on the Wikipedia language page, then you need to look there for the local version of the module. — GAN (talk) 13:39, 8 April 2021 (UTC)
@EricSabell72:, I saw that the documentation on wikidata was not working, but as I never used it before (used the one from WP:fr), was not sure what the cause was. Thanks for pointing that out! I moved all translation to Module:Cycling_race/l10n_all and set the l10n one to English values. Psemdel (talk) 07:53, 13 May 2021 (UTC)
@Psemdel: Thank you for your support - much appreciated EricSabell72 (talk) 11:56, 13 May 2021 (UTC)

Cycling categoriesEdit

Collected all that can be based on procyclingstats, cyclingarchives and cqranking. Added to the module. — GAN (talk) 00:01, 28 April 2021 (UTC)

1.x Q 2.x Q Others Q description
1.1 Q22231110 2.1 Q22231112 Am Q60669124 amateur race
1.2 Q22231111 2.2 Q22231113 NE Q60181400 national calendar
1.3 Q30336909 2.3 Q101052391 CDC Q106636610 Challenge Desgrange-Colombo (Q1060092)
1.4 Q30339152 2.4 Q101052353 SPP Q106636611 Super Prestige Pernod (Q27792093)
1.5 Q98686837 2.5 Q29866603 CDM Q23015458 UCI Road World Cup (Q786414)
UCI Women's Road World Cup (Q1517550)
1.6 Q106636603 2.6 Q101049923 CN Q22231119 national championship
1.7.1 Q60669131 2.7.1 Q106636604 CC Q22231118 continental championship
1.7.2 Q106636613 2.7.2 Q106636606 CM Q106636612 world championship
1.8 Q106636614 2.8 Q106636607
1.9.1 Q106636615 2.9.1 Q106636608
1.9.2 Q106636616 2.9.2 Q106636609
1.Ncup Q22231114 2.Ncup Q22231115 <---- UCI Under 23 Nations' Cup (Q1536617)
<---- UCI Men Juniors Nations’ Cup (Q2125347)
<---- UCI Women Junior Nations’ Cup (Q23306961)
1.2U Q22231116 2.2U Q22231117 <---- UCI Continental Circuits (Q36836) U23
1.HC Q22231108 2.HC Q22231109 <---- UCI Continental Circuits (Q36836)
1.Pro Q74275170 2.Pro Q74275176 <---- UCI ProSeries (Q71580493)
1.PT Q101069484 2.PT Q101052547 <---- UCI ProTour (Q1329578)
1.HIS Q106637289 2.HIS Q106637288 <---- historical calendar (Q2640745) or UCI World Calendar (Q12270097)
1.UWT Q22231106 2.UWT Q22231107 <---- UCI World Tour (Q635366)
1.WWT Q23005601 2.WWT Q23005603 <---- UCI Women's World Tour (Q21075974)
We should archive twice this page ;) Psemdel (talk) 15:19, 15 May 2021 (UTC)


@Repf72, 99kerob, Hejsa: Added most combative rider (Q21686770) and winner of the most combative rider (Q101246973) to the leaderboard ("Cycling race/listofstagesclassification"). If the same rider wins this nomination two or more stages in a row, then he is not combined in the table. And differently displayed in "Cycling race/stageinfobox". — GAN (talk) 20:13, 26 June 2021 (UTC)

I think is not necessary to add other combativity element. Instead, would be useful to extend meaning of current combativity elements to include combativity per stage basis (due some judge declare it) or combativity per accumulative points. Repf72 (talk) 20:28, 26 June 2021 (UTC)
On the Tour from 1952 to 1970, after each stage, the winners were determined / awarded in two "fighting classifications (combativity)". Separately at the stage and separately by the sum of the stages. How to distinguish them differently? — GAN (talk) 09:46, 27 June 2021 (UTC)

Tokyo 2020 problemsEdit

I want to use module for Tokyo 2020 events (I already added a list of countries for Q65242249) but there are two problems: 1) Russia is competing as Russian Olympic Commitee and using ROC flag instead of their national one (as part of sanctions for doping), 2) At ITT events there are athletes (1 for each gender) competing as a part of Refugee team but we don't have any template for such team in cycling. Any ideas how to overcome these two problems? It applies for both gender events. @Psemdel, GAN: 99kerob (talk) 08:09, 19 July 2021 (UTC)

@99kerob: I would suggest using "the country at the Olympics" instead of the road national team for the Olympics. en:Template:Nations at the 2020 Summer Olympics 1). In articles about the Olympics, an athlete usually indicates a link to an article about the country at these games. 2). Perhaps this will make it easier to make the display of the desired flag, which may differ from the state one. The module will of course need to be adapted. — GAN (talk) 08:46, 19 July 2021 (UTC)

@GAN: There is ROC at the 2020 Summer Olympics (Q50014488) (which has Russian Olympic Committee (Q783625) as country for sport (P1532)), and in 2018 people have used Olympic Athletes from Russia (Q28155263) to tag Russian athletes' participation in some events. Does that help? -- Rz98 (talk) 09:20, 19 July 2021 (UTC)

I have time in next days, I will have a look (also wanted to prepare the Olympic games anyhow). Psemdel (talk) 20:20, 19 July 2021 (UTC)
For the category: as it does not affect only the cycling, I suppose national cycling team (Q54660600) is inappropriate. Olympic delegation (Q26213387) seems better. Some adaptations in the code to cover this new property. Russian Olympic Committee (Q783625) is not a country, so it will be removed by the next bot when used in country (P17), only country for sport (P1532) could be used. We should add the flag in the item Russian Olympic Committee (Q783625). Psemdel (talk) 07:33, 20 July 2021 (UTC)
Is it ok as I proposed? I am not alone on this topic obviously. Psemdel (talk) 15:10, 23 July 2021 (UTC)

Wanty Gobert problemEdit

According to UCI this year Intermarché–Wanty–Gobert Matériaux team is a successor of last year CCC Team as it competes on Continuum Sports WT license and last year Circus-Wanty Gobert team is no longer existing. Case is similiar as it was when BMC became CCC in 2019 (CCC was treated as a successor of BMC and their development team as a successor of former CCC team) - for some reasons databases like ProCyclingStats treats it different so our Wikidata data is also different than UCI one. Problem is that some Wikis take UCI side and other PCS side on that topic which makes a lot of problem with linking to proper articles via module (for example other user at took UCI side, which is correct from law point of view, so now we have a lot of articles from this season linking to pl:Circus-Wanty Gobert article which says that team is no longer existing as 2021 team is a BMC successor as pl:Intermarché–Wanty–Gobert Matériaux. Is there any solutin to solve this? I don't know - maybe it is possible to write an exception inside module code to redirect everything linking to Q135682 from date od 2021-01-01 to Q787401 in particular languages that take UCI side on that topic? Is it even technically possible? Because I don't know how to solve that differently - it is not possible to make every Wiki taking same side of that problem... 99kerob (talk) 16:11, 8 August 2021 (UTC)

Team continuity is always an unclear topic. On the other side, adding exception in the module code will lead it to 1 million rows... Was is concretely the consequence here? Psemdel (talk) 15:01, 16 August 2021 (UTC)

Changing nationalityEdit

@Psemdel, GAN: Another thing from me ;). Few days ago Cesare Benedetti changed his licence from Italian to Polish as he finally get Polish citizenship - I added that via P1532 but module don't recognize that change - I guess that module check only P27 which in that case isn't helpful (Benedetti now has citizenship of both Italy and Poland). It should rather check P1532 first and check P27 only if P1532 isn't present at current rider's page. 99kerob (talk) 19:02, 13 August 2021 (UTC)

Normally P1532 has priority. Where was it not recognized? Psemdel (talk) 15:09, 16 August 2021 (UTC)
@Psemdel: I gave examples in your draft with a description.GAN (talk) 16:21, 16 August 2021 (UTC)
Thanks, I will have a look, very soon. Psemdel (talk) 06:09, 17 August 2021 (UTC)
@Psemdel: For Benedetti it was for both Vuelta a Espana and Vuelta a Burgos startlists - I needed to change his P27 that way (which is not right as he has dual citizenship) otherwise he was still displayed as Italian. 99kerob (talk) 12:29, 17 August 2021 (UTC)
Ok, it was not implemented everywhere the P1532. Now it should be the case. Psemdel (talk) 20:30, 17 August 2021 (UTC)

Amateur club for professionnalEdit

Some users started to add some amateur clubs for professionnal riders. It is true that they can keep their original club, but up to now, it was not considered important for the encyclopedia. Nevertheless, it seems that the code will have to cover this aspect (so much fun ^^). Psemdel (talk) 06:08, 17 August 2021 (UTC)

2019 Oceania TourEdit

Any idea why results from 2019 Oceania Tour ranking (Q59310280) are not displayed via riderranking - even if data for that season is added on Wikidata? Check for example: pl:Connor Brown or pl:Jay Vine. 99kerob (talk) 19:30, 28 August 2021 (UTC)

@99kerob: FixedGAN (talk) 12:41, 29 August 2021 (UTC)

RUS / BLR ridersEdit

Since yesterday all Russian and Belarussian riders are competing in UCI races under UCI flag. Any idea how to solve that in the module? It should be displayed that way at startlist (UCI flag before name of that cyclist and UCI abbreviation with a link to article about UCI after it) but shouldn't be really mentioned in riderinfobox. For the case of Riabushenko and his participation in today's Trofeo Laigueglia I tried to do it via P1532 but it don't work as I wanted to. Any other idea how to solve that for the time of this ban on RUS/BLR? 99kerob (talk) 17:18, 2 March 2022 (UTC)

The UCI website (Watch Rider) will still display without changes as it was or the Strada Bianchi website And only the flags were removed on the database, but even in the old races 1 and 2 You can wait for the next races and see the graphics on TV and various sites. — GAN (talk) 18:19, 2 March 2022 (UTC)

Gender text for "Winner", "Second", "Third"Edit

Hi, is there any way to use the femenine form for "Winner", "Second", "Third" in headers (calendar_translate, victories_translate, stageinfobox_translate, infobox_translate, listofwinners_translate), at cycling race/l10n when the race is for women ? (and language differentiate by gender, of course).

If not, could I suggest incorporating it in a further version?. Thanks, Amadalvarez (talk) 16:41, 13 March 2022 (UTC)

  • @Amadalvarez: This suggestion can be extended to all other templates based on this module, depending on the language. Therefore, I think that it would be best to create a separate "female" version of the module. This will save time now and make all future changes to the module easier. For this you need:
1. Create Module:Cycling race W
2. Copy Module:Cycling race into it and replace local l10n = mw.loadData("Module:Cycling race/l10n") with local l10n = mw.loadData("Module:Cycling race W/l10n") in the 7th line (the difference is in the letter "W")
3. Create Module:Cycling race W/l10n
4. Copy Module:Cycling race W/l10n into it and change the necessary heading names in it.
5. Create the necessary templates for "female" versions in your Wiki

Modules Cycling race/lang and Cycling race/data in theory, existing ones should be used. — GAN (talk) 18:00, 13 March 2022 (UTC)

Smart solution. Let me ask to cawiki community whether they assumed to have this double module. I'll tell you what we do. Thanks, Amadalvarez (talk) 18:21, 13 March 2022 (UTC)
May I deal a new solution?:
  1. I agree to create a Module:Cycling race W/l10n with a femenine translations just for language that need it or want it.   Done in cawiki
  2. you change the mw.loadData("Module:... in line 7 to load "Module:Cycling race W/l10n" when competition class (P2094) women's cycling (Q1451845), else (it is: no P2094, or different to Q1451845 or not exists W/l10n) means to load "Module:Cycling race/l10n" as now, to allow a normal run of current versions.
This solution avoids mistakes from article editors as we have just one module for all options.
Do you see it feasible?. Thanks, Amadalvarez (talk) 18:53, 14 March 2022 (UTC)
@GAN @Psemdel Meanwhile you think about my previous proposal, I'm going to upload classe de competició (P2094) ciclisme femení (Q1451845) in these items. Would add P2094 be a problem or incompatibility with some other function ?. Thanks ! Amadalvarez (talk) 16:46, 17 March 2022 (UTC)
I read only now. I suppose we can add an optional parameter for some module to force them to "women". Most of the time, it is not easy to make it automatically as, thanks to the UCI, the class is the same for men and women. P2094 is already in use for other things... Personally I would not change the whole l10n (would be too much expense and add another complexity), just complete it with supplementary fields. Moreover, it is not because the race is feminin that all the words become feminin. With this logic, we would need a l10n nominatif, l10n genitif, and so on for Russian also ... Give me one week, I will think about it. Psemdel (talk) 07:46, 18 March 2022 (UTC)
Thanks. I'll be waiting. If you need help to upload P2094 or another info you decide to identify femenine, can account on me. Salut ! Amadalvarez (talk) 11:00, 18 March 2022 (UTC)
@Psemdel: And if you use ready-made data:
- For races, we indicate which calendar/tournament it is part of. And our calendar/tournament is divided into men's and women's. If you make a binding to them??? This will make it possible to replace the headings in all infoboxes, the list of winners by year and classification (top 10) at the end of the race (for ru-wiki it is Гонщик -> Гонщица, 1-й -> 1-я). The infobox of the stage and the classification by stages of the stage remain questionable, since we do not indicate which calendar / tournament in their elements.
-For teams, there are similarly male and female categories/classes. This will make it possible to replace the title on the team's roster for the season. Of course, you can check with the transition to the parent element (that is, from the stage element to the race element for a specific year), but how will this affect the module resources. — GAN (talk) 11:12, 18 March 2022 (UTC)
Wouldn't it be easier to just change it from "Winner", "Second", "Third" to "First place", "Second place" and "Third place"? 99kerob (talk) 08:40, 18 March 2022 (UTC)
@99kerob: For "women" in addition to these headings, you need to change others depending on the language. — GAN (talk) 11:12, 18 March 2022 (UTC)
@GAN:, Thanks.
@99kerob: In addition, when language is sensitive to the feminine condition, surrogates don't like it too much. Amadalvarez (talk) 11:19, 18 March 2022 (UTC)
I haven't forgotten, but as mentioned, it won't be easy. Psemdel (talk) 12:29, 26 March 2022 (UTC)

I did a small MVP ( I used competition class (P2094) with women's cycling (Q1451845) as recommended to determine the gender of the race. To pass the name, we could do as for infobox, where name and name_plural are defined. However, I tested with listofwinners, where it is coded a bit differently. I wanted to avoid to make the list of translation even longer. Especially, I find it always difficult to use, as you need to know by heart the index (index 1 is year...and so on). I preferred to use a dictionary.

[ 'Q20882667' ]=feminine(feminin_bool, translate("listofwinners",2))



A this last dictionary is defined in l10n, for language without feminin it is just skept without any more coding. Only issue is if you want that "Vainqueur" is transformed in something in one function and something else in one other function. Do you see any other issue with my proposal? Psemdel (talk) 14:25, 7 April 2022 (UTC)

Yes/no? Psemdel (talk) 19:35, 18 April 2022 (UTC)
I will assume yes. I implement it this week. Would be good to have some cases, where it is needed. Psemdel (talk) 07:33, 9 May 2022 (UTC)

Q20639848 / Q20652655Edit

Hi! Can anyone explain me why we have two different items for pretty much the same (non-UCI, so-called "amateur" teams): Q20639848 and Q20652655? And why these teams are displayed in different group at listofteams part of module? Previously I never had such problem but this year some Danish teams took part in Polish races and I noticed that @Hejsa: is using different item than I do for amateur teams which causes a really weird effect on teams list (check for example: Tour of Małopolska where Danish non-UCI teams are displayed in different group than other ones). I don't see any reason why we have two different items for same thing and why we group them differently in articles. Why we don't merge these two items into one and group all non-UCI teams as one group? @Psemdel, GAN: 99kerob (talk) 09:44, 4 June 2022 (UTC)

  • @99kerob: In a module template, it is quite possible to combine all three types of teams (there is also a regional team Q20653570) from two sections into one. For example "non-UCI teams" or "amateur" or "non-professional". You can specify any name in the module. But it is not necessary to combine both elements into one. For me:
- "amateur" (Q20652655) is a full-fledged, but not a professional team. At which for example the sponsor's name.
- "club" (Q20639848) is a team from a sports society or association.

The team after the loss of "professional" status - it becomes amateur or club??? — GAN (talk) 12:53, 4 June 2022 (UTC)

Clubs and amateur teams are not the same, for example @99kerob: changed Q109393204 into a club, but this is a amateur team, with a parent club, which is Q103821177. See for example The Danish National Road Race Championship 2021, here we have some clubs and amateur teams. Clubs has often the city or region name in it, and amateur teams are sponsored. @Vandcykel: What do you think?
In Denmark we have these amateur teams or "DCU teams", with parent clubs:
  • Herning CK Elite Biemme Danmark
Parent club: Herning Cykle Klub
  • Team Bache -
Parent club: CK Aarhus
  • Team CO:PLAY - Giant Store
Parent club: Amager Cykle Ring & ABC
  • Team Georg Berg
Parent club: Næstved Bicycle Club & Slagelse Cykle Ring
  • Team Give Elementer
Parent club: Give Cykelklub
  • Team IBT - BH Carl Ras
Parent club: Sydkysten Cycling
  • Team Nyt Syn powered by Fialla
Parent club: Cykling Odense
  • Team Sparekassen Danmark Aalborg
Parent club: Aalborg Cykle-Ring

--Hejsa (talk) 20:49, 4 June 2022 (UTC)

  • I understand that you can make such distinction (although descrptions of both items don't explain difference) but simply don't see a point of doing so. Firstly, in terms of UCI races, they are all the same category of teams (non-UCI) and should be displayed so via listofteams. Secondly all data in Wikidata should be verifible. How you can verify if team is connected to some sports club/association or no if literally none of big databases contain such data? How can I check for example if some random German team who came for one Polish UCI race was connected to any sports club or not? PCS and other databases mark all these teams as one group (club/non-UCI) and simply don't care if they are connected to any other organization or not because it doesn't matter in terms of UCI races. Why make our job at Wikidata harder if there is no really good point for doing so? Although for me the most important thing is to merge them into one category via listofteams part of module to display it properly (not like in Tour of Małopolska article where non-UCI teams are divided in some weird groups without a good reason) - if there will be one or two items doesn't matter to me. 99kerob (talk) 08:05, 5 June 2022 (UTC)
It is good that we are having this discussion because I never understood either. I personally put all non-UCI in "amateur", as like 99kerod I first don't quite understand, second find it more complex without more information for the reader. In the module, we could make a kind of redirect from club to amateur to avoid strange displays. Psemdel (talk) 10:03, 5 June 2022 (UTC)

Lua errorEdit

Hello, I used a template and the module "Cycling_race" on Wikipedia in breton wich somebody made years ago. For most of the page where I used the template there was no problem. Then I tried it on two page where I got the same code error : "Fazi Lua e Modulenn (=error Lua in Module):Cycling_race d'al linenn (in the line) 536 : attempt to index global 'lang' (a nil value).". Could you please help me to find a solution? The module page is br:Modulenn:Cycling race and the template is br:Patrom:Cycling race/infobox. The pages where I could not use it are br:Tro Breizh 2012 and br:Tro Breizh 2011 Kadwalan (talk) 16:02, 26 June 2022 (UTC)

  • @Kadwalan: First, update the module and its subpages: Module:Cycling race/l10n, Module:Cycling race/data, Module:Cycling race/lang — GAN (talk) 16:18, 26 June 2022 (UTC)
Return to "Cycling race" page.