Module talk:Cycling race/archive

Active discussions

Different table layout

Vainqueur d'étape Leader du classement général
1re étape   22 août: Fontaine-au-PireBenitachell (200.5 km)
  Esteban Chaves   Esteban Chaves
2e étape   23 août: Puerto BanúsMarbella (200.5 km)
  Esteban Chaves   Esteban Chaves


If you want to edit the module add "Module talk:Cycling race" into the input field at the bottom of the Module. In this way you can see how this page would look like after changing the code of the module, without to save the edit. This API-call shows you how to pull data out of wikidata. And add "?action=purge" behind the url of this page after changing the module to empty the server cache at once.


Thank you Molarus (talkcontribslogs). I take an example with 2015 Four Days of Dunkirk (Q18589873) because I already have the winners. I will start by adding datas to 2015 Four Days of Dunkirk, stage 1 (Q19891044), 2015 Four Days of Dunkirk, stage 2 (Q19891045), 2015 Four Days of Dunkirk, stage 3 (Q19891046), Q19891047 and Q19891048. The stage took place in the beginning of may 2015, but we use Wikidata in cycling since the 30th may.

series ordinal (P1545)start time (P580)start point (P1427) - destination point (P1444)subclass of (P279)length (P2043)winner (P1346) of (P642) : stage winner (Q20882747)winner (P1346) of (P642) : overall leader at the end of the stage (Q20882763)

I understand that it will be a new type of module, created to work on different Wikipedias. We have here special lines with code, these words will be translated in different language, the name of this function is data, that is why you invoque data. This module will can in the future accept other functions. The second part of this module uses

, it concern the table where the first part will give names. Jérémy-Günther-Heinz Jähnick (talk) 10:42, 29 November 2015 (UTC)
I have changed the table, but some code is still missing for the first row. I guess it is not sure, that the "stage winner" and the "winner of the team classification" are always the first and the last in the property "winner". Therefore I will add some code to look for the right position. If this code works the way it should, the other rows could be added with copy and paste. The flag will be a bit difficult, because I think we will need a table for the "country of citizenship" and the commons file. I guess there are about 300 countries. Should the red links go to a wp-article or to a wd-item? --Molarus 13:28, 29 November 2015 (UTC)
@Molarus: There is no order to enter the datas with winner (P1346). Someone can start to enter the leader of the general classification first and enter then the three firsts of the stage. Or he can enter first the different leaders of classification. That's why we always use qualifiers.
For the flag of citizenship, we have on the French Wikipedia Module:Country data/france and more generally Module:Country data/liste. If you start a module with France, Spain and Deutschland (because there is different cases), I will can finish the work during the week thanks to the informations we already have on FR Wiki. It will not be lost, a such module will surely have other uses in other domains. The time is not a problem for me.
I add that for the last stage, the leader of the general classification is the winner of this classification, and the qualifier is not overall leader at the end of the stage (Q20882763) but overall winner general classification (Q20882667), example on Q19891048.
For the details, Modèle:En-tête de tableau Liste des étapes gives cellpadding="4" cellspacing="0" style="border: 1px solid rgb(200,200,200); color: black; margin: 0 0 0.5em 0; background-color: rgb(255, 255, 255); padding: 5px; float: left; clear: left; ; text-align: left; vertical-align: top; font-size: 85%; line-height: 1.6em;" for the table. I try to put it here, but there is a little difference of language. I think that scope=col style="background:#FFDF80;" align="center" becomes scope='col', style='background:#FFDF80', align='center'.
Finally, for the stage, a dictionnary (similar than this : Module:Dictionnaire Wikidata/Métiers) can be interesting for stage, because we have sometimes a stage 2a and another stage 2b, that we write 2ea étape and 2eb étape. It is rare, but it exists, I have in my mind the Triptyque des Monts et Châteaux 2014. I work on cycling since two seasons, and it is the only case on 80 races I illustrate. I dictionnary will also be interesting to display a little image   for subclass of (P279) with plain stage (Q20646667).
For the red links, it depends, on FR Wiki, we have a very big number of cyclists, but for some race, we don't have articles but we always have a item. For smaller Wikipedias, It lacks a big number of cyclists. Jérémy-Günther-Heinz Jähnick (talk) 15:30, 29 November 2015 (UTC)
The loop for finding the two winners should work. Next thing is the five rows problem. I thought that I use in "Quatre jours de Dunkerque 2015" the "composé de" property to find the number of rows and the Qnumber of the different étape (instead of adding them by hand into the module). In this way, the code should work for different cycling races. That will be difficult, but I hope to do that on Monday.
If the names of the flags are structured on commons, a small function could do the task and no big table is needed.
About the red links: Maybe wikilinks and a link to wd are shown together for the two winners? I have seen, that you use the "+"-sign in fr:WP for links to wd. It would look like this: Bryan Coquard +. What do you think?
--Molarus 02:05, 30 November 2015 (UTC)
It is like you want. But the + can be changed for a small wikidata logo, see Wikipédia:Sondage/Lien vers Wikidata. In this case, we can add the symbol with 1re étape, because users of the French Wikipedia know Wikidata, and it is a reflex for them to find an info. Jérémy-Günther-Heinz Jähnick (talk) 10:14, 30 November 2015 (UTC)
That´s it with the wd-flag. And the new function flag () connects p27 (pays de nationalité) with the flag of the country. At the moment just for French. It seems, that there is no alternative to a big table here. Does it look OK with the flags and the wd-link?
The next step will be how to call the module from WP. At the moment it is: {{#invoke:Cycling race|data}} but it should be something like {{#invoke:Cycling race|data|race = Q18589873}}. The word "data" can be changed, if you want. The third input could be "race = Q...", "1=Q..." or just the Qnumber. I will look into the manual, if that makes any difference at all.
The last step will be to add some code in the case not all data the module wants is in wd. The race for 2016 could be used for that.
--Molarus 15:55, 1 December 2015 (UTC)
I reduce the height of the Wikidata logo at 12px (I think this solution will be adopted on the French Wikipedia). For flags, it take 20px with a border. I do a test with instance of (P31) and P29 (P29). I have a question : Spain has a new flag since 1981, before, it has had other flags during the century, do you know the code to use in these cases ? Because the template will be used for races ran during the sixties and the seventies for example.
I will take the time during the week to write all the lines for flags.
You write a function for flags, can you write the minimum for a type of stage, with the exemple plain stage (Q20646667) gives [[File:Plainstage.svg|20px]]. The function can be named typeofstage.
For the main function, I see a name like listofstages, or a similar name more correct in English (it is always difficult for a French, because French only speak French). In the future, we will surely have a function for classifications.
I succeed to reproduce the form of the table, but I don't succeed to center the different names : étapes, villes étapes... Jérémy-Günther-Heinz Jähnick (talk) 18:38, 1 December 2015 (UTC)
Please, don´t write all the lines for flags. The missing flag of sweden shows, that it is no problem that there is no flag. This is an example that the the code don´t mind if there is a flag or not. The same should happen, if there is no item of the place or the person winning one stage or if a property is missing.
Old flag/new flag. P580 (start time) could give the year of the competition, which shows which flag had to be used. I have inserted the flag for spain in the years 1977-1981. I hope you can expand the code when you use this module for competitions older than 1977. If not, the standard flag will be seen. You can preview how the module reacts to changes of the code if you add "Module talk:Cycling race" into the inputbox at the bottom of the Module in edit-modus. If you use this module in the wikipedia, type in the lemma of the wikipedia article the module is inserted into. This way, I test the reaction of the module a lot while writing code and in the wiki history my temporary coding errors will not be seen.
Centering the head of the table seems to be done with text-align not align. Why it is this, I don´t know.
Something for wikidata: If you type in a number, type: 123+-0. In this way you will get 123 and not 123+-0.1
And something to remember for me: The headlines like "Leader du classement général" shouldn´t be typed in, they should be taken from wikidata, because this way they will get translated. A fallback is needed, if there is no translation.
--Molarus 02:17, 2 December 2015 (UTC)
I added in two stage-articles the item "plain stage" as value to p31. The reason is that one stage is never a subclass (p279) of something. --Molarus 07:40, 3 December 2015 (UTC)
I correct the fr:Module:Infobox/Étape and its documentation. In fact, if I understand, because we write plain stage is a subclass of a stage, Wikidata know that the 1st stage of the 4JDD is also a stage. Jérémy-Günther-Heinz Jähnick (talk) 09:50, 3 December 2015 (UTC) I add the flags. They will be interesting when we will display classifications. I add informations for different types of stages.
@Molarus: : Anthony59999 from FR Wiki ask if it is possible to give the unit in km of the distance in the title (distance (km)) instead of writing it at each stage. Jérémy-Günther-Heinz Jähnick (talk) 12:55, 3 December 2015 (UTC)
The situation with p31 and p279 is, that a chain of p279 begins with at least one p31.
About the Lua errors: I have an idea about that. At the moment the return table is put together in one step. I will change that into at least three steps. The first level will show only the table head, the second level will be the table head and at least one row. Both level depend on the fact that there is or there is not a p527 (has part) in the item. Level three would be that a flow of new properties and items are put into, maybe over the time of weeks and months. After inserting the new info, it should be seen in the table, while missing infos don´t bother the table. For step three, I have no idea so far how to code that.
--Molarus 13:16, 3 December 2015 (UTC)
When we create an article, we now create the item plus the item of each stage, with at minimum three informations : instance of (P31), part of (P361) and series ordinal (P1545). When we have more informations, like the distance, we add informations. When a stage is finished, we add the winners. There is different times. Thanks to Wikidata, we now can prepare the work. Jérémy-Günther-Heinz Jähnick (talk) 15:11, 3 December 2015 (UTC)
Because this template will be use one article by one article when it will be launch, subclass of (P279) will be deleted and instance of (P31) will be precised. So you can delete P279 from the code of the module. Jérémy-Günther-Heinz Jähnick (talk) 09:21, 4 December 2015 (UTC)
Now I know how to prevent that missing data is shown as an error. The solution is this. At the moment only part of the old code is again added into the module. I will add the rest later in the evening or tomorrow. --Molarus 19:00, 4 December 2015 (UTC)
Thank you. I precise I will be few connected this week end because I work on the elections. Jérémy-Günther-Heinz Jähnick (talk) 20:22, 4 December 2015 (UTC)
For flags, it works with country of citizenship (P27), but it will be interesting if it works also with country (P17), when it is the case of a team time trial. Jérémy-Günther-Heinz Jähnick (talk) 16:46, 5 December 2015 (UTC)
That is the case with Vuelta a España 2015 in the first stage. It seems, that this stage was won by a team from the US. At least I saw an error happening because of this property. In the code there are two lines for flag1[], one for P17 and one for P27. It is strange, but the code is a software model of bicycle racing.
By the way, "unknown2" means, that there is no winner in WD. It has to be decided if instead of "unknown2" an empty space should be seen or something different. I thought there was a missing city somethere, which was written as "n.v.". Here, an empty space is a possibility too.
"unknown3" has to be done, but in this case the background is a missing part of the code, that will go away, similar to "unknown1". But I don´t understand why "unknown 3" is seen in the Vuelta a España 2015 in stages 1, 11, 13, 17. In the Quatre jours de Dunkerque 2015 this was happening, because the Leader du classement général has a different item. Well, the Vuelta has a strange use of items for the winners.
--Molarus 19:59, 5 December 2015 (UTC)
For La Vuelta, it was not me that entered informations, but Edoderoo. I since add other informations. The good example is the 18th stage. Jérémy-Günther-Heinz Jähnick (talk) 20:20, 5 December 2015 (UTC)
As I looked into the problem that there might be a stage called 2a and 2b, I found an error in the code. Obvious, I took for granted, that the first stage came first in the value list of P527 (has part). It should be, that the whole list is searched for the Xth stage. And I have to add, that the module should look to a Xa stage too, which would be followed by a Xb stage. --Molarus 08:40, 6 December 2015 (UTC) Better to sort the series ordinal (value of P1545) of string type. It seems in lua something like "1" < "2a" is possible --Molarus 09:09, 6 December 2015 (UTC)
The sorting works -)), see "Quatre jours de Dunkerque 2016" where I turned stage 5 to stage 2a. Please revert my edit in Q21571740. By the way, is "2ae étape" proper french? And next task is the self-translation of words like "etape" or "Villes étapes" in the top of the table. And what do you think about "2ae stage", a french-english mix? --Molarus 07:39, 7 December 2015 (UTC)
Hi Molarus, sorry for the late. In French, we write 2ea étape. Jérémy-Günther-Heinz Jähnick (talk) 10:27, 7 December 2015 (UTC)
The function headoftable() is there. It translates the head of the table. To show you that it works I changed "Etape" to "abc" in the data. The version for als.wikipedia is the same as for de.wikipedia and the fullback is fr.wikipedia. Change and expand the function name and the content as you like. --Molarus 06:50, 8 December 2015 (UTC)
About the function wikilinks(). There are two versions, a French version and a version for everyone else. The French version outputs a template version, which I hope is right. The other version shows in the table "2a" or "5" and as section header something like "Stage 2a" or "Etappe 5". Maybe a text-align:center for the numbers would be positive. More not-default versions are possible, but someone has to code them when needed. I would like to read a comment from you about that function.
The next steps: I´m not sure that the work is done, I will look if something is missing. If you see something missing please tell me.
--Molarus 18:56, 8 December 2015 (UTC)
I do a test with the Vuelta, and there is a little problem to rank the stage. It is a good idea to permit to access in the article.
Is it possible to add a little Wikidata logo (12px) at each stage ? It will interesting for users when they will update datas.
I don't see other problems. By experience, new problems will be detected when I will test the module articles after articles. Jérémy-Günther-Heinz Jähnick (talk) 10:42, 9 December 2015 (UTC)
The sorting problem of the Vuelte is solved and the WDlink at each stage is added. I found another problem, it was "2ae étape" not "2ea étape". That is now solved too. Maybe there will be more errors to see, when you move the module to a wikipedia, because I tested the module as being for example in frWP but off cause it was not. Please tell me when you move the module and off course you can ask me anytime if there is a problem with this module or you want some additional features. I will be offwiki most of the time during Christmas and New Year, but after that I will be onwiki again. --Molarus 13:22, 9 December 2015 (UTC)
I have a big amount of work this week with the election, but I will have time next week. Jérémy-Günther-Heinz Jähnick (talk) 15:49, 9 December 2015 (UTC)
I just wanted to tell you, that if there is a problem, you could ask me. But I don´t mind if you ask someone in fr.WP. For example user Zolo is in my view the experienced user regarding Wikidata in fr.WP, he/she helped my a lot some time ago. I will now go back to my javascript project and I have new ideas for another lua module. The second round of the elections are an important task, hope everything will go well. Bye, --Molarus 21:09, 9 December 2015 (UTC)


Thank you. Thanks to Zolo, I have five infoboxes in cycling. Finally, I think I will test the module today, at the end of the day. I will create fr:Module:Cycling race. This module must be called by a template fr:Modèle:Cycling race but I don't know how to write in the line to call the module. Jérémy-Günther-Heinz Jähnick (talk) 07:18, 10 December 2015 (UTC)

<includeonly>{{#invoke:Cycling race|listofstages|{{{1}}}}}</includeonly><noinclude>Uses Lua-module Module:Cycling race</noinclude> Try this. --Molarus 07:41, 10 December 2015 (UTC)
I do a try. All is good, except the display of the number of the stage, and the month (we have 06.05 instead of 6 mai). You can the the test here. Jérémy-Günther-Heinz Jähnick (talk) 17:20, 10 December 2015 (UTC)
It seems, that templates in the return string don´t behave as templates, so I changed the code. Just changing {{ against sup. In fr:WP see fr:Utilisateur:Molarus. About the month: I think "02.09" is better and shorter, just 5 characters, than "2. septembre" and for all languages it would be a lot to store in the module. --Molarus 18:35, 10 December 2015 (UTC)
I prefer the month like septembre. If you write the lines in English and French, I can translate in other languages without problems. The place is not a problem, and on FR Wiki, users use the long date. Jérémy-Günther-Heinz Jähnick (talk) 11:34, 11 December 2015 (UTC)
I´ve found a list of abbreviations at [1]. And I have been finetuning the look of the table. Day and month are now in two columns, grouped together with colspan. In this way the digits of the day is formated. And I found out that the info from Wikidata is formated vertical-align:top. Applying that to the whole row, positions the whole row on one line. Another change is now to be seen in the etape-column, the distance between the re and the etape in row one is now one character less and the problem with row 9 and 10 is solved with text-align:right. Therefore this column looks better too. --Molarus 20:26, 11 December 2015 (UTC)
All is good. Jérémy-Günther-Heinz Jähnick (talk) 10:27, 12 December 2015 (UTC)
I do first tries, and find two problems, thanks to Quatre jours de Dunkerque 2013 :
  • when a city have homonymes, like Oignies or Lens here, the link don't lead at the good page, like Oignies (Pas-de-Calais) or Lens (Pas-de-Calais) ;
  • when a stage is the first day of a month, we write in French 1er instead of 1.
I also test the programm on Quatre jours de Dunkerque 2015 and Quatre jours de Dunkerque 1955. Jérémy-Günther-Heinz Jähnick (talk) 13:23, 12 December 2015 (UTC)
Other tries, I have a similar problem with the cyclists and the teams. The program take the label of Wikidata, and do a link to it, but it is sometimes a homonym like fr:Nélson Oliveira at the fr:Tour d'Espagne 2015 (code : {{Cycling race/listofstages|Q18752244}}). For teams, it is more complicated, with the example of Verandas Willems 2015 (Q19516702) : we should when it is a team (and it is rare, only when it is a team time trial) take the official name (P1448) of the team (if exist), and link to its wikipedia article if exist, like Saison 2015 de l'équipe cycliste Verandas Willems (see fr:Paris-Arras Tour 2015).
Is it possible when an article exist about the stage to make a link to this article instead of the section of the article ?

I do a try on NL wiki, it works. Jérémy-Günther-Heinz Jähnick (talk) 15:37, 12 December 2015 (UTC)

The Problem with the homonymes should be solved. In WD, now, the labels-data is to be seen, while in WP the sitelinks-data without the text in the bracket is to be seen. "Nélson Oliveira (cyclisme)" works too. The "1er mai" is to be seen on this page. About the team: Maybe we could use the official name as alias of the wikipedia article? I will look into this maybe on Monday. PS: The latest Lua-code is not at frwiki, but already a version that solved the homonymes problem. --Molarus 20:02, 12 December 2015 (UTC)
[conflit de modification] The official name is alredy use for the team (Verandas Willems (Q15883634), that has seasons 2013, 2014, 2015...).
And finally, when series ordinal (P1545) has 0 for value, the stage is in French a prologue (for translations, I can search). I will not be here tomorrow due to the election.
There is a little problem with Quatre jours de Dunkerque 1955, for stage 3. Jérémy-Günther-Heinz Jähnick (talk) 20:07, 12 December 2015 (UTC)
Since there is no WP-Article about Jean-Pierre Preuss, it is a redlink. And there is no leader du classement général in this row, because no such person is set in the item. Therefore, I think, stage 3 is right.
I tried a #Different table layout. By the way, we could have two different table layouts, but than we have to tell the module which layout we want to see in the article.
--Molarus 21:14, 12 December 2015 (UTC)
I will use only one type of table, to have articles more homogens, and only the same colours. Jérémy-Günther-Heinz Jähnick (talk) 09:15, 14 December 2015 (UTC)

About the team problem: In Q19920829 (1re étape du Paris-Arras Tour 2015) p31 says: "individual time trial". But isn´t that a team time trial (Q2348250)? Because then I could use this statement to decide when to take the "official name" of the team. --Molarus 12:06, 14 December 2015 (UTC)

Ah yes, I do a mistake (a big mistake because I was at the race). it is a team time trial. Jérémy-Günther-Heinz Jähnick (talk) 14:24, 14 December 2015 (UTC)
I think the code will do what it should, at least "Verandas Willems 2015" in "Paris-Arras Tour 2015" (top of this page) is changed to the "official name". Next task will be the prologue. I´m not sure, if the first stage is called a prologue, than the second stage is just called first stage. In "Quatre jours de Dunkerque 1957" I will change the "series ordinal" to start with a "0" and see what is happening. Maybe it is just that "0e étape" has to be changed to "prologue". --Molarus 20:06, 14 December 2015 (UTC)
Indeed. Sorry, couldn´t do more, I was occupied with something else here at WD and now it is to late. --Molarus 01:28, 16 December 2015 (UTC)
It is not a problem, you have all your time. At my side, I will test the module on other Wikipedias during this end of month, and list here if there are problems. It is a big work you have done. And the project to share an unique module on different Wikipedias is brand new. Jérémy-Günther-Heinz Jähnick (talk) 10:21, 16 December 2015 (UTC)
"Prologue" is done, but some translations are missing. See table one on this page. Please copy the code to fr.wp and tell me if something is wrong or missing. --Molarus 21:19, 16 December 2015 (UTC)
It works. On an other point, I have a problem with team at fr:Paris-Arras Tour 2015, and same problems at 2015 Vuelta a España (Q18752244) ({{Cycling race/listofstages|Q18752244}}), in French and in Dutch. Jérémy-Günther-Heinz Jähnick (talk) 11:18, 17 December 2015 (UTC) A little problem with the word proloog in nl:Ronde van de Ain 2014. No problems on FR Wiki. Jérémy-Günther-Heinz Jähnick (talk) 13:16, 17 December 2015 (UTC)
Both problems should be solved. --Molarus 14:55, 17 December 2015 (UTC)
Yes, these two problems are solved. Is it possible finally to add a new column type of stage with the little logo and in letters the type according to the item, ex :   plain stage (Q20646667). It is a request from users. I can find translations and write them on Wikidata. I add that I do new tries today. Jérémy-Günther-Heinz Jähnick (talk) 22:35, 18 December 2015 (UTC)
Another column? The table is already that wide that I proposed the two rows version. A new column would make thinks worse in this regard. Have you seen in my table layout that if the mouse hovers over the plain stage picture an infotext is seen? I think, the infotext could change depending on the wiki language. I don´t see why a wikidata link would be useful, because there is no information in this item. By the way, Monday is the last day I´m onwiki this year. --Molarus 23:49, 18 December 2015 (UTC)
I ask this because I don't see the infotext, and I don't know why. Jérémy-Günther-Heinz Jähnick (talk) 08:27, 19 December 2015 (UTC)
  Don´t you see the text "This is a plain stage" ? That is written in wikicode next to the information that the picture a 20 pixels big. I see this text with my firefox and my IE browser. In the Tour de France stages are classified as "Hors Catégorie climbs" or "Fourth category climbs". Does that mean a "plane stage" has no such "category climb"? In this case it would be better so say so instead of saying it is a "plain stage". The question is: What should we write as infotext (if we choose so)? --Molarus 09:00, 19 December 2015 (UTC)
Yes, I see This is a plain stage on your example. A such way to do will be interesting, with étape de plaine in FR, plain stage in EN, Vlakke rit in NL. Jérémy-Günther-Heinz Jähnick (talk) 16:29, 19 December 2015 (UTC)

Lua error in Module:Cycling_race at line 118: attempt to index local 'black_list' (a nil value). I have a little problem with 3e a}} étape and 3e b}} étape

The new code for the infotext is in function typeofstage at line ~490. I have added a translation table in this function, that inputs text depending on the wikipedia into the wikicode of the picture. At the moment this code inputs empty text if there is no translated text available. It is necessary to give at least an empty text, because otherwise the stage picture would not be shown because of an lua error. If there is no line for a language, the french text will be shown.
The error in the table is solved. --Molarus 19:55, 19 December 2015 (UTC)
Thank you Molarus. Is it possible to make a difference between individual time trial and team time trial ? I will not be here today and tomorrow, so I wish you a merry christmas and an happy new year. Jérémy-Günther-Heinz Jähnick (talk) 12:16, 20 December 2015 (UTC)
Function typeofstage got a second parameter, the Qnumber of the item behind p31, if it is a 'time trial stage'. This parameter is used for changing the infotext. I took the old term for the prologue, because I didn´t know better. Thanks for the wishes and I wish you the same. Molarus 14:08, 20 December 2015 (UTC)


For next week's update, I mentioned this there. If you feel it's too early, you might want to remove it.
--- Jura 11:01, 12 January 2016 (UTC)

Fallback language

I am interested if there is a possibility to use fallback language. We do not have labels in Latvian, so it shows nothing. It would be nice, if we could fallback to English(?) and it could be shown with special mark (* or in italics), so that we can spot it. --Papuass (talk) 17:10, 18 January 2016 (UTC)

This is possible. For which table do you want this? By the way, I guess french wikipedia has the most active cycling community, that is why we use French as fallback language most of the time. --Molarus 18:34, 18 January 2016 (UTC)
Just for rider names. Latvian is a strange language: although it uses latin script, we transliterate names of persons and places, using differet rules for each language (this means we can not just update Wikidata labels by bot). --Papuass (talk) 20:40, 18 January 2016 (UTC)
Ok, but which table? Or both? There are two tables: listofwinners and listofstages. And you want English labels? I was not sure, because you add a question mark behind the language. By the way, we don´t use bots either. Adding labels and data the right way, is a lot of work. In the future, maybe, there will be tools or bots. --Molarus 21:47, 18 January 2016 (UTC)
I meant listofwinners and English language for now. I hope that I will also be able to help you with programming a bit later, Lua is a new language for me. --Papuass (talk) 23:09, 18 January 2016 (UTC)
You have to copy the code from here to lv.wp. Your code is at line 39/40. I have tested the new code at lv:wp, so it should work. As you can see I have added a "en" behind the names. Thanks for your offer, we need every help we could get. By the way, the function listofwinners needs data in a certain way. The winners have qualifier P642 plus item. And a time property, I think P585 (point in time for a single day race) or P580 (start time for a stage race). You could add data this way for races you want to show at lv.wp too. --Molarus 01:04, 19 January 2016 (UTC)
Yes, you the latvian are very bizarre ! There is no difference if you take FR or EN, I use a program that give label to other languages. The update will be interesting to do on listofstage too, because if there is no label, the program give an error message. For Papuass, I will give you the kit to translate : you will can work in latvian and it will be more easy for you. The code is always the same on 13 Wikipedias at this date, so if you enter on Wikidata a table, you will can give it for other Wikipedias (on some Wikipedias, there is discussions, but the program will be accepted). Jérémy-Günther-Heinz Jähnick (talk) 11:02, 19 January 2016 (UTC)

I have a request from users that is to have the possibility to don't see the Wikidata logos for the cyclists (they want a table near to the classical table...). But on other Wikipedias, generally small, users will be interested. Is it possible to have a system of opt in/opt out to have the possibility very easy to have or not the little logos ? Jérémy-Günther-Heinz Jähnick (talk) 22:55, 19 January 2016 (UTC)

We write something like "invoke:Cycling race|listofwinners|Q21512857". Maybe an optional parameter could do that? It would look like "invoke:Cycling race|listofwinners|Q21512857|off" or so. But I don´t know if we should do that. --Molarus 23:23, 19 January 2016 (UTC)
Can this be a user script where you enable the logos as an advanced user, but casual readers just see the plain tables? --Papuass (talk) 09:29, 20 January 2016 (UTC)
I don't know. I am interesting by your ideas. Jérémy-Günther-Heinz Jähnick (talk) 11:26, 20 January 2016 (UTC)


I write functions for head of table for stage and general classifications like Eneco Tour 2015. it isn't again possible to display these information, because we don't have properties for time (it doesn't exist) but I have the time to start translations. Jérémy-Günther-Heinz Jähnick (talk) 10:13, 14 December 2015 (UTC)

We have properties for time, see Special:ListProperties/time. Time is written this way: "+2013-01-01T00:00:00Z". I think, it is not possible to input something like 4 h 6 min 18 s by hand, but it should be possible by a small javascript tool I could build. The data could look like "+0000-00-00T04:06:18Z". The property I would use is P585 (point in time) or P582 (end time). The problem would be that people wouldn´t know that we already use hours, minutes and seconds and maybe delete the statement from an item.
I´m not sure if I understand right, you are speaking of another type of table (Classement de l'étape and Classement général)? I have been thinking of a Module Cycling race version 2, because I would do some things different now. Maybe this new table could be used for such an improved module? I wouldn´t start with writing the module, first I have to find a new software architecture. The problem with the architecture of the module version 1 is, that the functions could be reused, but p.listofstages not. I would split that function into many small functions which would work on something like t = {Étape = ["1", "1er"}, Coureur = {"Elia Viviani(city)", ...}, Pays = ...} and I would like to have instead of 20+ pcall-functions just 1 pcall-function. Something I would like to change too, is that I would like to use in the module the information written into the tables in the wikipedia article. Those informations are very valuable and we should find a way to keep them in the article and don´t delete them after adding a lua module into the article. The point is to have redundancy.
--Molarus 21:19, 16 December 2015 (UTC)
I am speaking of a new function in the module, to display tables of classifications. It is not for now but it will exist in the future. First, teams (member of sports team (P54)) are not entered in the items of the cyclists, second, properties for time not already exist, but Lydia says me that will exists. I have a similar projet to list team participating at a race. Having the same module is interesting because we have table for countries. And on Wikipedias it is not a problem because I call Cycling race/listofstages, I can call Cycling race/listofteams or Cycling race/generalclassification.
A day, it will exist. I have all the time because for example to have to enter on Wikidata datas from thousand of race stages, write documentation, explain at users... Jérémy-Günther-Heinz Jähnick (talk) 11:06, 17 December 2015 (UTC)
First, I have understood that you are not interested in the proposal, but I have already written Module:Version 2. Especially with infoboxes the new software architecture seems to work well. On the discussion page one can see that there is only a minor change and the wikicode for infoboxes could be used as second database for the lua module. I see lots of advantages in this. The code compares for example info from wikicode and wikidata and a difference is shown as color yellow. I will follow this way for my own projects. --Molarus 01:47, 20 December 2015 (UTC)

I´m back now. Do you think we should start with this table or the one below (If you have time, of course)? And I have added on top of this page a redlink to a possible archive page. I propose to move finished discussions there. --Molarus 03:19, 5 January 2016 (UTC)

I prefer we start the table below first, I presented listofstages at foreign users, I will can present listofwinners before speaking of classifications. I have the time, I work on the terrain after 8 pm. Jérémy-Günther-Heinz Jähnick (talk) 18:18, 5 January 2016 (UTC)

Do you think we can start with this table now? Or I can write a small js-tool to input the time data that is needed for this table? At least we could see if this is at all possible. --Molarus 11:58, 18 January 2016 (UTC)

Yes, we can prepare the work. For the time, we will wait the possibility to use a time in hours, minutes and seconds and the properties I asked on property proposal. It is not a problem, I think it will be easy to program in the module when we had the time. The most complicated will be to find a team for a cyclist, giving the name of the team, and making a link to the season team, or by default to the team. Giving this at a precise moment will be surely a function, because we will can use it on different types of classifications. So to make your tries, I develop 2016 Tour Down Under, Stage 1 (Q21934629) that occured today (I do the card yesterday). On fr:Module:Cycling race, I give two names : generalclassification and stageclassification. In the future, we will surely have other functions, and properties, to do other classifications like points, sprints and teams. I think finally that one head of table dictionary for all these classifications will be easier.
Discussing with other users, I think that a future work will be a common infobox. We already have functions on fr:Module:Infobox/Descriptif course cycliste, and I have the possibility to start to translate fields, or to ask to contacts. Jérémy-Günther-Heinz Jähnick (talk) 12:55, 19 January 2016 (UTC)
I have looked into Eneco Tour 2015 and I don´t like the classification tables. It seems to me that they need a lot of data to insert into Wikidata, but the info is already available at those websites (cqranqing, ..). What I like, is the text in the stages of en:2015 Eneco Tour. I have looked around and maybe we should do a table for cyclist, where they have been and won. See for example en:Gijs Van Hoecke. This would be P1344 (participant of). --Molarus 13:36, 23 January 2016 (UTC)
For a classification, we just need to use general classification of race participants (P2321), write the name of the cyclist, its ranking (P1352) and, when the property I ask will be created, the time of the winner and the gap for the others. it is very fast. Teams will be entered on the item of the cyclists (we will need this information when the French fr:Module:Infobox/Cycliste will use 100 % of datas from Wikidata), and on teams, we have the different names along the time (this point is already done). It is not a problem to enter with the hand these datas, for example, when I follow a race and return to home, I generally have 3 to 4 hour of train. If is is too complicated in this moment, we can wait a little and use our time to produce an common infobox. On FR Wikipedia, the infobox have a very good level, and some users of other Wikipedias are already interesting to have this infobox. Jérémy-Günther-Heinz Jähnick (talk) 13:53, 23 January 2016 (UTC)
Is that right, that your infobox is "Module:Infobox/Descriptif course cycliste"? I think, this module uses lots of modules (how many?) which only exists in fr:WP. I don´t know if it is possible to move that infobox to other Wikipedias. That is different to this Module, where there is just one Module. And it seems, that fr.WP uses Module:Infobox for many different types of infoboxes. I think, the whole thing has to move to other wikipedias, but without Zolo no one understands this zoo of modules. I hope with the documentation this module will be easier to understand and maintain. --Molarus 16:52, 23 January 2016 (UTC)
Yes, the infobox is fr:Module:Infobox/Descriptif course cycliste. A part of the code is at fr:Module:Infobox/Fonctions/Compétition sportive. But if we look, we already have a function that permit to find the good flags by taking start time (P580) or point in time (P585). It is possible to take also the country contained in the race élément very easily. To display a winner / second / Third or that have another qualifier, you are already able to do that because you use these possibilities with the flags in listofstages and listofwinners. Idem, you are already able to define a team that win a race with listofstages, and better than this module you are able to take its official name (so without 2016). You are able to display a distance in km, so I suppose you can do the same with an average speed in km/h. "Coureurs au départ", "Coureurs à l\'arrivée" and "Pays traversé(s)" will no longer be in use (because we have new parameters). For another part, functions are already written. So a big part of the work is already done or ready, and for precise points, I can ask to Zolo or to another user that has a very good level in Lua (it is thanks to them that we have on FR Wiki five Wikidata infobox, it is great, but the future is to share a commons infobox that is able to take all its datas from Wikidata). I add that for flags we already have a base (and when I will encounter specific cases, I think to Italy, I will adapt it). Jérémy-Günther-Heinz Jähnick (talk) 17:37, 23 January 2016 (UTC)
So you think of an infobox that looks similar to the one in fr:WP. You know that I don´t like to throw away the data that is in the wikicode in some wp:articles, because keeping that info makes it possible to change back to wikicode. Using wikidata shouldn´t be a trap. I have seen that some Wikis don´t have an infobox at all, they could use that new module. I would say, that I should start with a demo module, to see if such a module is possible and maybe we could insert that demo into module Cycling race later. A problem is, that the templates in the wikis are not the same, so I have to rebuild the templates in the module, I think. And I think each wiki wants the infobox to look the way they are used to. Therefore the input and the output would look different, while the code between would be shared. Not easy, but a step forward.
About the classification tables: The point is not that these tables are easy or difficult to code, we should not rebuild cqranking in wikidata.
--Molarus 20:02, 23 January 2016 (UTC)
I have another solution : I am currently discussing with users, and in FR, DE, CA, MK, RO and ES (I don't discuss precisely of this with others) they are interested by a such infobox. For IT, an user is interested but want to write the code, and for LV we can ask to Papuass. So the solution is to make an unique form of infobox (like the Ford T that you can chose in black or in black), write a documentation, and give it one by one to Wikipedias and ask to users to do a test on races that happened in this moment (like we have done for listofstages). If I explain that the program is common to other Wikipedias, that we have a good and readable documentation, that we want to have a better design, that all functionnalities are good and without problems, and that they have rapidly updates, the infobox will be adopted by these Wikipedias. During this time, we will add in the program translations, and when we will be in March, when there is a big number of races, I will discuss with other users and show the benefit to use this infobox to write more articles and to save time. I already explain to these users that using a common program implies that datas will come exclusively from Wikidata and the design will be new, and that it is impossible to have a different design by Wikipedia. When we will see gains on Wikipedias, more users will become interesting. We are just in a phase of transition, next year, the program will become a secondary element in the making of an article : user will be able to enter datas, we will divide the work, and we will pass more time to write articles and bring a betterment. The true goal is to deliver users from an annoying work and let us the possibility to pass more time to write. I prevent it will work. It will be more easy because I can show that on FR Wiki we only fill this infobox with Wikidata since more than six monthes, that we write a very big number of articles, and that the process have no problems and is perfectly sourced. We shoult test a such infobox first in FR, MK and RO Wiki. Translations will be obtained by collaborating directly with users, and we will can benefit of the experience of their first tests.
CQ ranking will not be rebuilt, we only take generally only the 10 of 20 firsts of the race. It takes me only eight minutes to enter datas for 20 cyclists (and I verify again if they have a correct item). It is the easiest solution. Jérémy-Günther-Heinz Jähnick (talk) 10:12, 24 January 2016 (UTC)
I like going slower, because we lack the experience with modules like cycling_race. For which we have to write the documentation, improve the code, enter a lot of data into WD, and, and, and. --Molarus 12:08, 24 January 2016 (UTC)

I have changed the code in Module talk:Version 2 (at the bottom) with data about Eddy Merckx. If you look into the wikicode you will see that if in Wikicode a date is inserted, this date will be shown. If there is no date, than the date from Wikidata is shown. So far the code doesn´t show if WD and WP differ, but as a test I have added into the code that the article is inserted into the category "Different Data". It is possible that this only happens if WD and WP differ. I´m not sure if this is the way a infobox should behave. Could you comment on that? Maybe we should ask for comment in "Wikidata:Project chat" too? --Molarus 20:38, 25 January 2016 (UTC)

I don't understand precisely what you want to say. Can you rephrase ? Jérémy-Günther-Heinz Jähnick (talk) 09:32, 26 January 2016 (UTC)
On an other point, norvegians have adopted the program ! Jérémy-Günther-Heinz Jähnick (talk) 14:09, 26 January 2016 (UTC)
First, I have deleted the unnecessary examples at Module talk:Version 2. What you see now - if you go into the edit modus - Module talk:Version 2 looks like one row of an infobox (in edit modus). "birthday" is just an example of the rows infoboxes usually have. If there is no "birthday" information, WD-content is shown. If someone adds "birthday" information into the wikicode, this information will be shown. This way, Wikipedia editors overwrite Wikidata content.
One step further would be that this Lua module inserts a Wikipedia article into a Wikipedia maintenance category, if there is a difference between the "birthday" data Wikipedia editors write and the "birthday" data available at Wikidata. To show that this is possible, the lua module(!) adds the talk page into Category "Different Data". There are more possibilities to show that the "birthday" data in Wikipedia and Wikidata are different. For example the link to Wikidata (WD-icon) could get a border in the colors green, yellow or red, depending on the difference. green - no difference, yellow - references are different, red - birthday is different.
What is next: I don´t know if we should have the code for showing a difference between Wikipedia and Wikidata, but it would be the maximum possible. The code for the first part, the lua function WP_table_4, is not difficult to code. I could go on and use something more relevant than just "birthday" and the output of the lua module could look more like an infobox. By the way, the lua module should behave this way independent if the user in frWiki writes "anniversaire", "Geburtstag" (rather "Geb.") in deWiki or "birthday" in enWiki. --Molarus 14:26, 26 January 2016 (UTC)
Thank you, now I understand perfectly (I am tired in this period of the year). Jérémy-Günther-Heinz Jähnick (talk) 15:42, 26 January 2016 (UTC)

Generating the table for the palmares of a race

Since few days, I think at a function listofwinners that permits to give the table for the palmares of a race. As example I will take the Tour d'Almaty because I create its articles about editions one week ago. Datas are entered on Wikidata : Tour of Almaty (Q15043657).

So each race has an item. Each item contain point in time (P585) if it is a single day race or start time (P580) if it is a stage race. A stage race can become a single day race, and a single day race a stage race. At least we have the year of the race (when it is an old race). We can choose to display in the first column the year. If there is an article, we made a link, if there is not an article, there is no link. We display a little logo Wikidata to permit the user go on Wikidata like they can do for stages.

For each race, we have three persons on the podium : winner (P1346) list them, and give their place thanks to the qualifier of (P642) with overall winner general classification (Q20882667), second overall (Q20882668) and third overall (Q20882669).

I note some possible problems :

  • a cyclist woman can be married and change its name, but we can date this information.
  • a cyclist, like Chris Froome (Q319591), can change its nationality, but here again we can date this information.
  • the flag can change (like Spain), but the programm already permits to add this type of case.
  • it is rare but possible that cyclists arrives ex-aequo, so there will be two value instead of one.
  • for some old race, we don't already have the name for the second and for the third, si the cell will rest white.
  • a cyclist can be doped and lost its victory, so its name must be strike. I have the idea to use reason for deprecation (P2241) and to create an item cyclist that has lost its place due to doping

This programm will be the occasion to create items for races and to transform articles one by one. It will be long, but it is an interesting project, and more important by its impact that the list of stages. I start to give the programm Cycling race to other Wikipedias. I have a good experience with the macedonian Wikipedia, it was interesting to permit a small community that use another alphabet to benefit rapidly of this programm. I give to the main user a kit to translate, and he translate it in macedonian. The more we will have translation the more we will can have people that update races. Happy new year. Jérémy-Günther-Heinz Jähnick (talk) 11:26, 1 January 2016 (UTC)

About the wikilink of the year: If there is a wikipedia article, the year should be linking to this article. If there is no Wikipedia article, I see two possibilities. We could use the name of the item (if available) to guess the name of the WParticle or we just write the year (no redlink). The second possibility is easier to do. --Molarus 15:24, 7 January 2016 (UTC)
No redlink is better : sometimes, a small race of town become a bigger races, for example the Nokere Koerse. And (on FR Wiki) we don't create these articles. Jérémy-Günther-Heinz Jähnick (talk) 10:04, 8 January 2016 (UTC)
To see a bigger example, and its integration on Wikipedia, I have created fr:Modèle:Cycling race/listofwinners. Jérémy-Günther-Heinz Jähnick (talk) 11:24, 9 January 2016 (UTC)
The new code is not ready, but at the moment servers are to busy to go on. --Molarus 16:15, 9 January 2016 (UTC)
It seems there was something wrong in the new code. Now it works, but the new code is still not ready. At the moment the code needs the vainqueur as the first entry in the item, but that is not always the case. And I guess some pcall-functions are missing. I will have a lot of testing to do too. But the first, second and third winners have more or less the same code, so I will not need a lot of time to build them. --Molarus 18:00, 9 January 2016 (UTC)
Now, only the flags are missing in the code. Guess that is no big deal. --Molarus 13:05, 10 January 2016 (UTC)
I test the update of the module on fr:Modèle:Cycling race/listofwinners, and there is a problem when the article don't exist in French. Jérémy-Günther-Heinz Jähnick (talk) 09:24, 11 January 2016 (UTC)
Yeah, I remember why I did this. The normal output is the name of the wikipedia article (without for example (sportsperson)), but if there is no wikipedia article there are two possibilities. The easy solution is to output an empty string plus the link to wikidata. The difficult solution is to output the wikidata label plus the link to wikidata. And we could take the label as a redlink or just as text. What would you prefer? --Molarus 09:41, 11 January 2016 (UTC)
Is is like you want, it is not very important to have a redlink or just a text. Jérémy-Günther-Heinz Jähnick (talk) 12:48, 11 January 2016 (UTC)
I test with a white logo File:RoundWHITE2D48.png, to avoid having too much logos (some users risk to speak to me of christmas tree). Jérémy-Günther-Heinz Jähnick (talk) 15:56, 11 January 2016 (UTC)
I don´t think a white logo is seen on a white background, the alternative could be the "plus" sign.
Marcel Beckaert has no flag because he has no birthday. I could say, if there is no birthday, take today as date. What do you think?
And I´m afraid I found an error in the first table. For the function flag we wanted a time variable, because flags change over time. I have discovered, that the time I was using, was the starttime of the race. P585 (point in time). But the right time is the birthday (P569).
--Molarus 16:31, 11 January 2016 (UTC)
Finally, we will keep the Wikidata logo. With or without logo, I can presage that one or two users will be problematics.
I correct for Marcel Beckaert and find informations about him that I add on Wikidata.
I think that we always should take the date of the race to determine the nationality of the cyclist, because some of them change during their carreer like Chris Froome. Some countries also disappear like USSR, Yugoslavia and Tchecoslovakia. Jérémy-Günther-Heinz Jähnick (talk) 18:08, 11 January 2016 (UTC)
Now, I think the date of the race is the right data, too. For example, a person is 500 years old. It wouldn´t make sense to show a 500 years old flag. Therefore I will change the property of the second table. About Marcel Beckaert: The point is not that this information is missing, but how should the code react? Should we show no flag or the current flag? Btw, for testing a table with lots of missing and wrong data is positive, because this way I see if the table can manage those problems.
I will look into our old comments in the archive to see if I´ve forgotten one of the errors described there. --Molarus 19:44, 11 January 2016 (UTC)
Ops, I can answer question two myself: Since we will take the time of the race it doesn´t matter if the birthday is known or not. --Molarus 20:06, 11 January 2016 (UTC)
Days after days, I will find cases. I have in idea the Tour de France with cyclists that loose their places with doping. For a change of nationality, I have the Umag Trophy with Maksym Averin. Jérémy-Günther-Heinz Jähnick (talk) 22:26, 11 January 2016 (UTC) After the test, I find an error : at the 2015 race, Maksym Averin was no longer ukrainian but from Azerbaidjan.
On the disk of P27 there is the information that this property could have qualifiers p580 and p582, which are used in the item for Maksym Averin. Therefore it makes sense to change the code of the module to look for those qualifiers. About doping: If someone loose their place, wouldn´t we just change the name of the winner in the item of the race? Are you planing to add a second name as winner, but with a qualifier (P2241)? Property P2241 says on the discussion page, that it should be used for statements with depreciated rank. (It seems that this property is used this way indeed) See: Help:Ranking#Deprecated_rank. It is possible that we don´t have to change the code if there are two winners and one has a depreciated rank, because the module don´t see the ex-winner. I have to test that, but it seems possible. --Molarus 05:52, 12 January 2016 (UTC)
Yes, for change of nationality, it is very rare today, but it arrives massively at the beginning of the 90s.
For doping, I ask the question to Anthony59999 (one of the biggest user about cycling on FR Wiki) because I am not competent in this domain. There is different cases, so I ask him he gives me examples. I think like you we will use reason for deprecation (P2241) with specific values like I already have on cycling in my kit to translate (mileage of an erroneous cycling race (Q21848415), erroneous edition number due to a miscalculation of the organizers of the race (Q21996602), incorrect value (Q21973878)). Jérémy-Günther-Heinz Jähnick (talk) 10:05, 12 January 2016 (UTC)
I make an example on Tour d'Annaba 2015 (Q21418919). I ask and Anthony59999 and Floflo62 give me a response : it depend on the sources, like our case, the first loose its place, and the three other cyclists win an place, and no fourth place is attributed. In this case, the doping has been discovered rapidly. We have other case like the Tour de France 2005 where the decision has been taken more years later, and there is no change in the classification. Here, it can be interesting that instead have an empty box, having a word like désattribué (unassigned). Jérémy-Günther-Heinz Jähnick (talk) 12:35, 12 January 2016 (UTC)

The code for the two nationalities is difficult. It is not done so far. At the moment there are two persons with two nationalities: Maksym Averin and Jean Stablinski. The first has qualifiers, the second not. If there are no qualifiers, I take the first nationality. And maybe I have to assume, that there will be no persons with more than two nationalities. --Molarus 18:38, 12 January 2016 (UTC)

For Jean Stablinski, I will a day ask the question. People who have parents from Poland and living in France have possibly also the Polish nationality, It is the case of one of my grand mother, I discover even if she was born in France that she was considered polish (she have a polish father and a german mother). It is sometimes a little complicated, and we encounter this problem on FR Wiki with the arrival of Wikidata. Jérémy-Günther-Heinz Jähnick (talk) 09:47, 13 January 2016 (UTC)

If the combination of start- and endtime is strange, there will be no flag. This way this part of the code will not get to big. I can add someday more code, if needed. I think the next problem is a winner which loose the place. (winner with Property P2241). In the Tour international d'Annaba 2015 the winner with a depreciated rank is not shown. Do you think we have to do something for this problem? --Molarus 08:08, 15 January 2016 (UTC)

In this case, I don't see, we generally write a note that give more details. In revenge, the name of the cyclist if the classification don't change is sometimes between <strike>. Jérémy-Günther-Heinz Jähnick (talk) 12:40, 15 January 2016 (UTC)

Some interesting (future?) projects

I will add some of my thought about interesting projects.

  • I think the main problem for sports data is to get the data from websites into wikidata. I have looked into the sourcecode of the CQ Ranking of "Tour of Almaty". There are all the data we would need to fill a table: palmares, dates, length of races, nationality, drivers rank, etc. I don´t think there is a solution to just click on a button and all the work is done, but a tool could help. This problem is similar to reading data from wikipedia infoboxes, therefore this should be possible. And maybe you know that I´m writing javascript tools for reading data from wikipedia. At the moment for some data about lakes (see this). For example, to read this table should be possible. The problem with that is in my view the copyright.
  • Another use of wikidata is in my view to use the data for other things than just print them in tables. Maybe taking a photo of a cyclist when standing next to a race or looking the race on television and wikidata shows the data we have. At least I remember the time when I saw the tour de france on tv, that I didn´t know who those drivers are that I see. I remember that some statistics was shown on the screen, I think ranks? Well, I don´t know how to do that, but that would be really valuable, I think.

--Molarus 03:08, 5 January 2016 (UTC)

I already speak of a similar idea to an organiser for their team presentation, it was at the Circuit Het Nieuwsblad espoirs 2015 (see photos), the weather was very very hot and I pass my time in a bureau, it was the occasion to discuss. We have more and more datas on Wikidata, and we make progress every monthes. If a data can be used for articles in various langages, we can imagine to use them during a team presentation, when the speaker say the name of a cyclist, we have datas displayed on a big screen, like teams, age, country... and photos, because I produce a very big amount of photos.
On an other hand, during the 2015 season, I often discuss with cyclists of progress of technology and cycling. In five or ten years, it will be possible thanks to these types of glasses I wear on race to display datas about cyclists, just by saying their name. Few years later, we can imagine facial recognition.
Thanks to Wikidata, datas will become more intelligent and they will exit from computers. and more generaly, people is interested by things we can make with Wikipedia, it can be onride video or for example the creation of all editions of a cycling race, with cartography and photos (in link with organisers).
For taking datas from CQ Ranking and the copyright, I don't know, because they receive their datas from cycling races, they don't produce their datas. It is more complicated that we can think, and rules are different according the countries. Jérémy-Günther-Heinz Jähnick (talk) 16:40, 5 January 2016 (UTC)
I don´t think wikidata will ever have the data that is interesting during a race, but the software behind wikidata is available to everyone, so it would be possible to install a special wikidata during a race, similar to all the wikipedias outside wikimedia. Than, there has to be software that produces wikidata data in real time and software that publishes these data in the glasses (cool device!!) and on the smartphones for the viewers and other software that looks into these data (SPARQL-queries?) in real time for cycling strategies. The question is: Can we learn something from this future scenario for today? At least we should become faster with buildung our tables and moving data from outside wikidata into wikidata. It should be done within a minute or so and not last 3 weeks. Maybe this will be the third improvement of the code of the module. --Molarus 01:50, 6 January 2016 (UTC)
When I am on a race, most people want to know informations about cyclists. Just saying the name at a smartphone and obtaining a response is interesting. Even me, when I take a cyclist in photo, I would like to have a similar thing. For organisers, it is a special page with datas from Wikipedia. I already see that in an other domain, but I don't remember. Having results when they are publicated on CQ ranking or ProCyclingStats, it would be very interesting (and a very big progress when we know that we pass the major time on an article to fill these datas). We can imagine with this progress that user will pass their time to develop good articles like EN Wiki. Jérémy-Günther-Heinz Jähnick (talk) 09:16, 6 January 2016 (UTC)

Two days ago I saw at Wikidata:Project chat this (User:Magnus Manske/dragref.js) new javascript tool. How to use that is seen in this video. This morning I had the idea that the cycling website could be showen on the right side of the screen, the user drags a fact from there and drops that fact in a wikidata item. And the references is added on its own. --Molarus 12:03, 21 January 2016 (UTC)

For CQ Ranking, we will have the property. It is better to have a property, to add it before the race. If I add a source, I take it directly on the website (a newspaper for example) but I no longer write on Wikipedia. Thanks to Wikidata we can prepare the work. When I write a classification on Wikidata, I just give the three first, I prefer spending my time here and produce datas that will can be used in the future by other Wikipedias. Jérémy-Günther-Heinz Jähnick (talk) 18:04, 21 January 2016 (UTC)

Little bug on listofstages

Hi Molarus. An user from EN Wiki says to me (on my English talk page) that on en:2016 Tour de Yorkshire there is a problem with 1 May that is written like in French 1er May. I verify and it is the same in other languages. Can you correct ? Jérémy-Günther-Heinz Jähnick (talk) 17:16, 6 January 2016 (UTC)

The problem was on line 337. I have added code, that only on frWP and on wikidata day "1" is translated to day "1er". I have tested the code on enwp and frwp and the code did on both wikis what it should do. --Molarus 23:36, 6 January 2016 (UTC)
Thank you Molarus.
On an other subject, I discover this morning a japanese user translate this module for its Wikipedia ! Jérémy-Günther-Heinz Jähnick (talk) 10:48, 7 January 2016 (UTC)
Wow! You have been right, that people are looking for something like that. --Molarus 12:45, 7 January 2016 (UTC)
Yes, it is very interesting to see that users can do. Some others add better translations to the module in their langage. They know they have to win to work with Wikidata. On FR Wiki, it is like Schatten der Leidenschaft, there are pro and anti-Wikidata, and always the same arguments to refuse to use Wikidata by somes instead of looking module by module. It is just a noisy minority I precise. Jérémy-Günther-Heinz Jähnick (talk) 13:37, 8 January 2016 (UTC)

Hi Molarus. I adapt listofwinners on other langages (even if it is difficult on NL Wiki due to a little number of users...) and I continue discussing with users, and invite them to ameliore module. On macedonian, we have better translations for titles of tables. I update the documentation on mk:Шаблон:Cycling race/listofstages, and there is a problem when we don't have in macedonian the name of a cyclist, this problem is solve with mk:Шаблон:Cycling race/listofwinners. Can you have a look ? I don't know what is it but I am sure that the code for giving the winners palmares is adapted to this type of case. Jérémy-Günther-Heinz Jähnick (talk) 13:18, 16 January 2016 (UTC)

The code works this way: "—" is shown, if there is no label (and no article) written in the item and I´m afraid that is the case with macedonian. My thinking was, that for example in the Japanese wikipedia, I can´t show french labels of the winners. I don´t know how that is done in the macedonian WP in other cases. Maybe they want to see English or French labels? Russian is no option, because they have no labels too, I´m afraid. --Molarus 14:32, 16 January 2016 (UTC)
It is not a problem, that I want to says is if a macedonian user have "—" in its article, it is better than "Грешка во Lua во Модул:Cycling_race, ред 373: attempt to concatenate a nil value". With the solution you develop for listofwinners, it is very easy for him to find a data to translate, with listofstages, the user must verify item stage by item stage where a cyclist name is not translated. With "—", users that use another alphabet will rapidly know that is translations is needed, and if it will have a big sum of work at the beginning for an interested user, this amont of work will decrease with the time. It is similar for me : I have hundred to race data to enter, but once it will done, the system will be perfect. It is a big progress when we compare at the previous situation, I will give the program to PT Wiki, that is currently in development, and I think I will present the program at Wikidata:Contact the development team (few monthes ago, I present French Wikidata infobox to Lydia and her team, they like to know the use we can do of Wikidata). It will be interesting in six monthes to see what is the use of this program on Wikipedia, for small Wikipedias, it is a chance. Jérémy-Günther-Heinz Jähnick (talk) 15:28, 16 January 2016 (UTC)
Someone from lv:wp asked for a similar change. I have added a " en" behind the name. Maybe that is a option for macedonian WP too? --Molarus 01:04, 19 January 2016 (UTC)
Very interesting, I do a test on lv:Veidne:Cycling race/listofwinners. I think you can do it for MK Wiki and JA Wiki. Jérémy-Günther-Heinz Jähnick (talk) 10:51, 19 January 2016 (UTC)
Ok, I will do this. --Molarus 11:00, 19 January 2016 (UTC)
I have seen there are errors in the makedonien wp in function listofstages. Sorry, I have to correct that first. If there are more such errors, please tell me. And there are lot of "n.v.". Maybe we could show english labels here too. This way, I´m afraid, the table is not usable. --Molarus 16:42, 19 January 2016 (UTC)
The function listofstages doesn´t give an error at makedonien wp anymore and I have tested the function at fr.WP too. Could you tell me if you see any new error due to this code change and if you accept that change? I will add code for listofwinners MK Wiki and JA Wiki now. If the new code is OK, we could do the same for the Villes étapes. What do you think? --Molarus 18:14, 19 January 2016 (UTC)
I want to say that once again. There should be no error at all. Never!! In case there is an error, I have done something wrong. You have seen, it took me just about an hour to correct that. --Molarus 18:31, 19 January 2016 (UTC)
Sorry for the late, on mk:Шаблон:Cycling race/listofstages I have Грешка во Lua во Модул:Cycling_race, ред 373: attempt to concatenate a nil value. Jérémy-Günther-Heinz Jähnick (talk) 19:56, 19 January 2016 (UTC)
I have updated both Modules in mk:wiki and jp:wiki. JP:WP has changed some code in their module, which I have put in again. I have found an error in ca:Usuari:Herodotptlomeu/proves/proves3, in function listofwinners. I have seen, that the first module is not used much. Maybe with this update and maybe with an update of the "n.v." (Villes étapes) this could change. Is a change of the "n.v." to english label OK for you?
Sorry, that I was angry, but I should have corrected those errors weeks ago. Good code doesn´t show errors. --Molarus 22:56, 19 January 2016 (UTC)
Ok, it is Q21512857 with no statement at all. --Molarus 23:06, 19 January 2016 (UTC)
Yes, we don't add informations for Q21512857.
It can be a good idea to have the name in English for a town if we don't have translations. (It is sometimes difficult for me to follow because I am tired and it is written in English). Jérémy-Günther-Heinz Jähnick (talk) 11:35, 20 January 2016 (UTC)
I have changed "n.v." against the English label. I have tested the code with mk:WP and fr:WP. Before copying the new code to mk:Wiki and other wikis, I remember that we have not used the new code for the flags (change nationality) in the first table. Do you think I should add that in the first table too? Do you remember if there was something else that has to be done for the two tables? I don´t want to add the former winner and strike the name. I think, that should be written in the text, not in the table. --Molarus 18:44, 20 January 2016 (UTC)
Yes, a good explanation is better than a name in strike.
Yes again for the change of nationality on the first table. It is very rare that a such situation arrive now, but if there is some problems, I will have some users on the spine (it is humour but it is true, it is always the war on FR Wiki about Wikidata, and the same history restart every day). Jérémy-Günther-Heinz Jähnick (talk) 20:13, 20 January 2016 (UTC)
Ok, I will add the code for table one this evening. By the way, the war at DE WP is about external references. The community decided that without them no data from Wikidata is allowed in DE WP. --Molarus 11:50, 21 January 2016 (UTC)
That is why it is important to Anthony59999 and me to always do a link to ProCyclingStats when we enter datas that will be used by the program. I first do that to avoid users that says me on FR Wiki that it doesn't have sources for data. Some contributors (always the same) tried it a few days ago to forbid me to use the program on behalf of a consensus... finally I use it, because every time there's something new two of them are trying to oppose because they have no vision for the long term, one is opposed to Wikidata (but is happy when I spend a few hours doing his course maps), and the last attempts by all means to sink my cycling illustration project, without understanding that I still had a head start on him. Besides these few cases, there are very good especially contributors who quickly able to perceive the potential of Wikidata. I'm especially very happy that contributors from other Wikipedia trusted us for this program and for exchanges that there was. Next month, I will speak to this program at cyclists. Jérémy-Günther-Heinz Jähnick (talk) 17:49, 21 January 2016 (UTC)
So far we have not done anything about references within a table, but it is possible to show wikidata references in Wikipedia. A problem might be if there is no reference section in the wikipedia article. I would say that sometime we should look into this. Maybe as a demo before we start with the third table. --Molarus 20:04, 21 January 2016 (UTC)

The code for the two nation problem is now in the first table too. But I had problems to test what happens if there are two nations, because Wikidata is getting fast in detecting my test inputs. I have tested the code with all fr:articles and all mk:articles and I think it works right. At least the code doesn´t break anything where it is used now. As I saw yesterday, at least one wiki (jp.Wiki) added code into its own version of the module. If you have problems copying this module into the wikis without deleting the added code, I can help. --Molarus 00:23, 22 January 2016 (UTC)

Yes; I see for the date for the Japan. Is it possible to include their specificity at this super module ? Jérémy-Günther-Heinz Jähnick (talk) 09:25, 22 January 2016 (UTC)
First, I have updated the module in jp:WP. Second, I have changed their code version, that only "day" and "month" had to change the position and that sign "日" had to be added. Not more. Third, maybe that is a bigger problem. It seems, that in Japan dates are written: month, day. While I have written in the code: day, month. And it seems, that they want to have that sign behind the day. The point is, maybe there are more wikipedias, who want to have the date different (or something else). If not, it would be no problem to change that just for jp.WP. --Molarus 14:19, 22 January 2016 (UTC)
At the bottom of Module_talk:Version_2 you can see that it is possible to use references from Wikidata in our table. If we would do that, maybe the code should be an option. So far, I haven´t written the code that this demo works as an option. Do you think, this is something we should have in table 3? --Molarus 15:56, 22 January 2016 (UTC)
Yes, it will be a good novelty. For classifications, I will prefer the Wikidata logo next to the title of the table. Jérémy-Günther-Heinz Jähnick (talk) 18:35, 22 January 2016 (UTC)
The code for jp:WP is written and I have updated the module in ja:WP. Part of the problem was that in ja:WP there is no space between month and day. I wrote at the discussion page of the user in ja:WP that I´m sorry. I think we have to learn a lot to build good tables for ja:WP, maybe the user will help us. --Molarus 13:19, 24 January 2016 (UTC)
I think he will help we for the future. Japan is a big country, but they have a number very low of users about cycling, they are one of the first concerned by the module. Next week, I will try to join a russian user, it is interesting to work with specific alphabets, and I like russian cyclists (they smile like Vladimir Putin - they rarely smile - but they are sympatic). Jérémy-Günther-Heinz Jähnick (talk) 18:49, 24 January 2016 (UTC)


A documentation of this module could help. Maybe on the articles Cycling race/listofstages and Cycling race/listofwinners? I thought about something like "Generating the table for the palmares of a race"? --Molarus 11:04, 20 January 2016 (UTC)

I already do a try on de:Vorlage:Cycling race/listofstages two weeks ago. The problem is for certain languages. Jérémy-Günther-Heinz Jähnick (talk) 17:16, 20 January 2016 (UTC)
Keeping that in English is better, I think. They can translate that themselves. --Molarus 18:25, 20 January 2016 (UTC)
Another solution is to develop a documentation with examples on Wikidata first, example for one of our French infoboxes : fr:Modèle:Infobox Descriptif course cycliste : less explanations, more example. I could take as example a race, and give a maximum of details. I can also add screenshots.
Why not? I would say, examples are an additional documentation. Maybe we should have that doc at wikidata and give only a link to the wikis? This way we could offer the wikis the possibility to ask questions at the discussion page and we could ask them to expand the documentation at WD. If they like, they could translate that doc for their one wiki. Another documentation I think we should have is a doc about the code itself. I remember that in the function flag it is possible to add old flags. I´m afraid not many people will look into the code and discover that feature. I thought about something like a wikipedia article about the code. With different sections, a history section, pictures, references, etc. --Molarus 14:27, 21 January 2016 (UTC)
I will start to write a documentation this week end. I have two or three ideas in head. It is a good thing to write it here because datas and qualifiers can have easily translations. I will add at the bottom the kit to translate, it will permit to users to translate in their language, and to have a place to benefit of new items. I will ride bike in two hours during around two hours, I will think at all details to make it easy to understand. Have you an idea for the title of the page ? Jérémy-Günther-Heinz Jähnick (talk) 17:59, 21 January 2016 (UTC)
Maybe Module:Cycling race/doc and Module:Cycling race/doc (code)? Can you explain "Kit to translate". Do you have a software which uses that? --Molarus 19:06, 22 January 2016 (UTC)
The kit to translate is not used directly by Cycling race, but if users want to enter datas to use Cycling race in their Wikipedia, they must have a minimum of translated items in their languages. So I regularly give this kit to users, that is why we have translations and they can work in their language. Jérémy-Günther-Heinz Jähnick (talk) 10:36, 23 January 2016 (UTC)
I understand. Do you agree with the name of the documentation article? Then I would start with "/doc (code)". --Molarus 20:06, 23 January 2016 (UTC)
Yes, but I try to copy my text on Module:Cycling race/doc (code) but it is a Lua page. Jérémy-Günther-Heinz Jähnick (talk) 14:33, 24 January 2016 (UTC)
I wanted that page for my text.-)) But we could create Wikidata:Cycling race and many subpages, where I can insert my text. And I have found Wikidata:WikiProject Cycling. --Molarus 15:22, 24 January 2016 (UTC) I have seen, that someone moved Wikidata:Cycling to Wikidata:WikiProject Cycling, therefore another subpage of this module (similar to Module talk:Cycling race/archive) might be a solution too. Maybe Module talk:Cycling race/code (for me, you can take Module:Cycling race/doc) --Molarus 15:41, 24 January 2016 (UTC)
I write the documentation in French. I hope start the translation in English during the beginning of the week, then I will contact users to ask them if they can translate. I use LangSwitch, that's why translation will not be limited in number. Tables are already adapted to other languages, like legends. I will think this night at specific case, and I will describe them as soon as possible, before other users start translations.
Finally I write the english translation today. Can you correct if English is not good ? Jérémy-Günther-Heinz Jähnick (talk) 11:28, 25 January 2016 (UTC)
I can look, but my english is not much better, I´m afraid. --Molarus 11:40, 25 January 2016 (UTC)
... and again, I am just writing, when sometimes I speak English to a cyclist, he ask me to speak English. Jérémy-Günther-Heinz Jähnick (talk) 12:12, 25 January 2016 (UTC)

todo: User talk:Bergenga

I have changed the date: Now it is day plus a point. Only in french the first day of a month is written as "1er" (without a dot). For the numbers I have found a function that should change the number as it is done in the local language. I have tested that in fr:Wiki and the number 8888888.8 is written as 888 888,8 I guess that is right? The example with no:Tour of Norway 2015 is more difficult, but it is possible. At the moment we assume that there is an item of that stage, but no wikipedia article. I will do that tomorrow. --Molarus 15:37, 2 February 2016 (UTC)

The date seems to work here on Wikidata, but the number format does not, even if I change back and forth between English and Norwegian Bokmål as user interface language, but that is maybe because Wikidata is primarily English? How does one update the code to Is it some function that can be triggered, or is it a copy-paste operation? Then I can check if it works there.
(I changed your link from NN to NO. There's nothing on NN of interest.) Bergenga (talk) 19:38, 2 February 2016 (UTC)
We do the updates by hand, it is a copy-paste operation. I don´t know why the number format at Wikidata has not changed. I guess there is a solution for that too, but I have no experience with the language library (I´m no lua expert). But at Wikipedia the code should work. --Molarus 22:44, 2 February 2016 (UTC)
Aha, so I'll just copy-paste the entire source code of the module from here to There's nothing I have to change or leave out of the code when copying? (Yeah, I'm just a bit afraid to mess things up, even if I know that it can easily be rolled back. :-p ) Bergenga (talk) 09:08, 3 February 2016 (UTC)
Yes, we share an unique program hosted here on Wikidata and interested Wikipedias have a simple copy, that is always the same code that the super module (Module:Cycling race, also called the program). Jérémy-Günther-Heinz Jähnick (talk) 11:24, 3 February 2016 (UTC)
Molarus, I update the copy on FR Wiki, and a point appear between the day and the month on FR Wiki, see fr:Herald Sun Tour 2016. Jérémy-Günther-Heinz Jähnick (talk) 13:04, 3 February 2016 (UTC)
I tried it on no.wp now and it works great, both the date and the decimal number format are as they should be. Thanks for all work done so far, both of you! Bergenga (talk) 13:09, 3 February 2016 (UTC)
In the fr:example the first distance is now "2,1". OK, that works too. I had looked into wikipedia articles to learn how different languages are writing numbers. It seems, that there is the mathematical writing with a point, while outside academics they write sometimes with a point and sometimes with a comma. And I remember that in India they have a different way to write numbers (en:Indian numbering system). It seems in India they use really big numbers quite often. I think the other problem - a wikipedia article for a stage is a common problem and no noWiki problem. Let´s see. --Molarus 16:34, 3 February 2016 (UTC)

I have moved the new code to no:Wiki and the result is seen at no:Bruker:Molarus. I have tested the code in fr:WP too and it seems nothing goes wrong. If that is confirmed, maybe this new feature could be added into the documentation of the function? I wonder if "1." stage instead of "1" stage would be better? --Molarus 18:32, 3 February 2016 (UTC)

It seems to work great over at no:wp. Thanks again for all work done! To have "1." instead of "1" would not be right in Norwegian. It would be something like "first of what?". It should be just "1" or with unit like "1. etappe". I was actually going to ask you to fix so that the numbers (when there is no article connected) link to sections named "1. etappe" and "2. etappe", not "Etappe 1" and "Etappe 2" like it is now. I don't know if we have any clear rule, but it seems that most old articles are written with sections named that way, and I do also think it looks best. I can't find any with "Etappe 1" and so on. I don't know what would be the best as text for the links with "1" like it is now or "1. etappe" like the name of the sections, but I guess it is best to leave it as it is, and change later if anybody requests it. Bergenga (talk) 21:59, 3 February 2016 (UTC)
We already have to solve this point for another Wikipedia.
On an other hand, I update the module today on FR Wiki, and we have yet the point in the date, see fr:Tour de Norvège 2015. Jérémy-Günther-Heinz Jähnick (talk) 10:37, 4 February 2016 (UTC)
Return to "Cycling race/archive" page.