Topic on User talk:Matěj Suchánek

Jump to navigation Jump to search
Xaris333 (talkcontribs)

Hello. All national teams are belong to national federations. For example Czech Republic national football team (Q483868) belongs to Football Association of the Czech Republic (Q337065). Football Association of the Czech Republic (Q337065) is a member of UEFA and FIFA. For national teams we want the information that the national federation is a member of UEFA (one of six continental confederations of world football's governing body).

I have created el:Module:Συνομοσπονδία. Czech Republic national football team (Q483868) have owned by (P127) with Football Association of the Czech Republic (Q337065). And Football Association of the Czech Republic (Q337065) have member of (P463) with Union of European Football Associations (Q35572). So the module is taking the value of P463 of the local federation. It is working. But, mostly all federations are also members of FIFA (sometimes are members of other subcontinental confederations too). Any idea how to have only the value of one of the six continental confederations?


And something else: I need a module that will show the lowest value that a property has. Czech Republic national football team (Q483868) --> FIFA World Ranking (P2656). The property has many values. I need to show only the smallest one. An near the number brackets with the date (point in time (P585)).

Matěj Suchánek (talkcontribs)

I am sure we already made a similar module for the second problem. Just to find it and reuse...

For the first problem, you need to collect the items of those six confederations. Then you may let the module check whether it's the one you need.

Xaris333 (talkcontribs)

Thanks for your answer.

1) The six confederations items are Union of European Football Associations (Q35572), Asian Football Confederation (Q83276), Confederation of African Football (Q168360), CONCACAF (Q160549), CONMEBOL (Q58733) and Oceania Football Confederation (Q180344). The module must show only one of these items or nothing. If an items have more than one confederation (like Australia national team) the module must show the preferred one.

2) New problem. I have remembered that FIFA World Ranking property is going to delete (maybe). Please see Czech Republic national football team (Q483868) --> ranking (P1352). One way it to have the latest value as preffered. But, because we have point in time (P585) is better to make the module to show the most recent date. If a value have no P585 for a value, it would not be considered.

I can't do neither 1 nor 2.

Sorry for being so annoying. If you don't want or don't have time for these issues, just tell me and I will stop. It would be better if there was a place to add requests for modules.

Matěj Suchánek (talkcontribs)

Did something for the first problem.

I don't understand the second point: either we will follow the rank, or forget about it and will filter by date. Why is P585 "better"?

Since you've already asked for help, I cannot simply let you down. You should never be afraid that you can annoy someone. But yeah, I don't have much time these days.

Xaris333 (talkcontribs)

For the first one, its working! Thanks!

For the second one, I want a el:module:FIFARanking to show the most recent value (according to point in time (P585)) of ranking (P1352) with the date in brackets. For example, Argentina national football team (Q79800) --> ranking (P1352). It must show "4 (16 October 2017)". (I don't want to use preferred option). Consider that determination method (P459) must always be FIFA World Rankings (Q180825). Don't do it if you don't have time. Maybe I will find someone else.

Xaris333 (talkcontribs)

Hello again. A user edit Module:FIFARanking so it can show current FIFA Ranking, Man and Min. Last few days I was adding (and still do) all FIFA Ranking for 1992 to 2017 with sources. Its a lot of work. I think all Wikipedias can use this data. For example see Spain national football team (Q42267) (ranking (P1352)). I am planning to suggest the module to all Wikipedias that are using the template Template:Infobox national football team, like Czech Wikipedia.

But there are some problems with the module. You are my last hope :)

1) Big problem. If a team no longer exist (Serbia and Montenegro national football team (Q1131732) or Netherlands Antilles national football team (Q1037645)), the module shows as current ranking the last one they had. But this is wrong. The module must show nothing. If a team no longer exist I thought to use dissolved, abolished or demolished (P576) as a condition. If the item has P576 then there is no current ranking (after 4 years of the dissolved). But a better solution is to have a condition that the module shows the most recent ranking only if there are not 4 years before the current date. For example, If the last ranking is 4/12/2013 will show the current ranking. If it is 30/11/2013 it will not show it. (Teams inactive for more than four years do not appear on the ranking table). Example:

2) Big problem: Max, Min: the module shows only one date. For example, Spain was at the first place many times. So after the max they must show many dates. But it only shows the first one that appears in the item. The module must show all the dates. Do you have any other more practical idea?

3) Small problem: Wikipedia templates show the dates in brackets in smaller letters/numbers.

4) In Greek Wikipedia you have made many modules. But no one of them show the sources. Only if we take the informations directly for Module:Wikidata (using Module:Wikidata/cite). I have added source to every ranking value. Why not to have the sources to the articles.

Thanks. I know you don't have time. But I have to do a last effort after all that work...

Matěj Suchánek (talkcontribs)
  1. You can use an #if: directly in the infobox.
  2. How useful is to have all the dates shown? Infoboxes should show just the most important information that is actually valuable.
  3. Should your template do it, or do other templates do it wrongly? Either remove the tags or put them where you want them.
  4. You can do anything with the modules which I created. Preferably replace them with the generic Module:Wikidata and delete them.

Finally, suggesting this module to any Wikipedia is nothing I can recommend (that's why I'm not investing my time into it). The modules I help maintain in cswiki would simply make this query to get the result: {{#invoke:Wikidata|formatStatements|property=P1352|rank=valid|withqualifier=P459|withqualifiervalue=Q180825|showqualifier=P585|sort=P585|invert=true|limit=1|showsource=true}} (sample for the last value, min./max. are just a little different).

Xaris333 (talkcontribs)

Thanks.

1a. I am trying your solution but I get "Lua error in Module:Wikidata at line 23: 'property' parameter missing." . 1b. I am thinking to change the "current ranking" with "last ranking". With this way the problem is solving... If a team not exist anymore, the template will give the information of their last ranking.

2. It is not useful to have all the dates shown. But what can I do? If a team was in 5th place 20 years ago, its useful to shown the date, isn't it? We can have only 5 of course but this may confuse the readers...

3. Ok.

4. I don't know how to do that. I will ask someone in Greek Wikipedia because I don't want to create problems to other articles.

Matěj Suchánek (talkcontribs)

Obviously, that piece of code won't work on elwiki since your modules are completely different. I just wanted to demonstrate that the real solution is to decide on a system of modules that will fit the needs of your wiki.

Xaris333 (talkcontribs)

Script error: The function "formatStatementsE" does not exist.

How can this be solve. I have tried to copy some of your modules. The problem, i guess in on el:Module:Wikidata. (I have restored my edit so everything work ok in the articles).

Matěj Suchánek (talkcontribs)

You need to migrate all the templates that use Wikidata which won't be simple if you don't want to make your wiki messy.

The old formatStatementsE becomes formatStatements, whereas the old formatStatements becomes formatStatementsFromLua (this function is only useful for modules).

Xaris333 (talkcontribs)

Well, there are not many templates using Wikidata. We are still at the beginning. I have asked the community about using your codes and we want to trying it. If you can help me of course.

For start, what modules I have to copy first?

Matěj Suchánek (talkcontribs)

As you will see, niether those modules are ready to be distributed to other wikis. For example, I mostly use require 'Modul:...' instead of "Module", which would work everywhere. I'll be working on making them more independent of the wiki but it may take weeks.

We are currently testing how distributing to a sister project works but I think it would be too dangerous to set it up for a big wiki like yours.

In the meantime, you can do tests with these modules: w:cs:Modul:Wikidata/Filterers, w:cs:Modul:Wikidata/Formatters with subpages (at least globecoordinate, monlingualtext, quantity, string, time, wikibase-entityid), w:cs:Modul:Wikidata/datum (temporary one), w:cs:Modul:Wikidata/lib, w:cs:Modul:Wikidata/i18n (you'll need to translate all this). Then you'll likely need w:cs:Modul:Time and w:en:Module:Arguments. For sorting values, you may import w:cs:Modul:Wikidata/Sorters and any subpage you are interested in.

Xaris333 (talkcontribs)

I have created some of them yesterday. Yes, I have noticed Modul and I have replaced it with Module. Ok. I will translate them all.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)
  • All /testcases subpages are irrelevant to you, as well as /build. You can keep ScribuntoUnit and UnitTests, though, they may be useful for your wiki.
  • I recommend you the updated version of Module:Time.
  • You need to keep the old i18n, so that your templates work. Just before the migration, you will merge both i18n modules and switch the module.
  • You can save Wikidata/datum under Wikidata/Formatters/time.
Xaris333 (talkcontribs)

All done except last one. I have already created Wikidata/Formatters/time, like cs wiki. I have change Wikidata/Formatters/time with the content of Wikidata/datum.

What next?

Matěj Suchánek (talkcontribs)

Next? Honestly, you need to wait until I claim the modules good enough. If you dare, you can slowly test them in a sandbox and see whether they behave correctly.

However, you'll need to check for updates yourself. Note that I can't take responsibility for possible errors the updates can cause.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

You will be in a trouble quickly if you make such thoughtless changes... until all templates are ready, you cannot just override your old module with the new one. I fixed the template but many modules will now show errors.

I suggest reverting to the old module and reverting my change in that template, too. I will prepare a migration plan for you.

Xaris333 (talkcontribs)

Ok! Before the reverting, I will check a lot of article to find errors and I will make a list!

Matěj Suchánek (talkcontribs)

What makes the situation easier for us is that your infoboxes use a wrapper template for the module.

  1. Create a copy of the old module (like "WikidataOld").
  2. Change all templates and modules to use that copy.
  3. As soon as the module is unused, you can delete it and import the new one.
  4. Change whatever you want to use the new module. If something doesn't work, you can let it use the old module and let me know meanwhile.
Xaris333 (talkcontribs)

Well, I have created w:el:Module:WikidataOld. I have changed w:el:Πρότυπο:Wikidata (template) to use it, and I have find all templates that use invoke:Wikidata and change it to invoke:WikidataOld, and I have replace in all modules require 'Module:Wikidata' with require 'Module:WikidataOld'. Do you think is there somewhere else I have to make changes?

For point 4: The new w:el:Module:Wikidata needs to change w:el:Πρότυπο:Wikidata (template) to use Module:Wikidata and not Module:Wikidata to use it... Do I have to make a Πρότυπο:WikidataOld?

Matěj Suchánek (talkcontribs)

Yes, it will probably be better to create a copy for that template as well. Then just modify all infoboxes to call it. If you prefer to keep the same arguments as for the old one, just tell me and I will modify the module. But not today, sorry.

Xaris333 (talkcontribs)

When ever you can. I am just do what you say just to be ready. I have created w:el:Πρότυπο:Wikidata3. I will use it as the new template. So, I have to check all problems the templates may have by using the new modules. Most problems are commons for all templates.

First, I have tried w:el:Πρότυπο:Κουτί πληροφοριών ποδοσφαιρικού συλλόγου (this template was working fine before, you have helped me a lot with it). Example article: w:el:Νέα Σαλαμίνα Αμμοχώστου (ποδόσφαιρο). The problems are:

  1. Not showing the sources (I have change the Module:Wikidata to the w:el:Module:Wikidata/cite). Maybe showsource=true is not working. (I also need to show the source when the template using w:el:Module:Τοπσταδίουομαδας)
  2. P1449: I want it to show only the greek label. So isinlanguage=el is not working.
  3. The date is 7. Μαρτίου 1948 and is a link. It must be 7 Μαρτίου 1948 (with out . ) and not linked.
  4. rank=best is not working.
  5. P856 (url), P2013, P2002, P2397, P2035 (facebook, twitter, instagram, youtube, linkedin) and P373 (commons) are not working correctly. They may have the same problem.
  6. When an item is not having an article to el.wikipedia, the template must link to wikidata item.
  7. w:el:Module:Τοπσταδίουομαδας is not working.
Matěj Suchánek (talkcontribs)
  1. You need to migrate that module to use the new one.
  2. My modules have the argument withlang=el.
  3. You need to localize it in /i18n.
  4. It is (unless you show me what the problem is).
  5. What's the problem? Note that formatStatements wraps the output with a <span class="wd">, so that you can have Wikidata information highlighted using a gadget.
  6. Will take a look what I can do.
  7. It is (unless you show me what the problem is).
Xaris333 (talkcontribs)

I had to undone all my change because one week pass since our lass conversation and I couldn't leave the articles it a bad situation. I have undone them again. So, please read again my previous message and check.

Matěj Suchánek (talkcontribs)

You have to undo nothing if you just change all modules to use the old one. Then, you can change the templates one by one to see whether the new module does what you want. If not, you can let it be and tell me what's wrong.

Xaris333 (talkcontribs)

That was I did. Please check now all my points from 1 to 7.

Xaris333 (talkcontribs)

Users in el.wiki are undo my changes in templates because the problems cause on the articles. And they are right. So, now you can't see the problems. Choose a day whenever you can and inform me to do the changes to see the problems...

Matěj Suchánek (talkcontribs)

Perhaps your approach is wrong, then. What I suggested was:

  1. make a copy of everything and make all templates use the ("legacy") copy
  2. when nothing original is in use, replace it with the new tools (since it isn't in use, no errors can occur)
  3. now you can test anything without saving it, no one will see any mistake

The approach that you will break something and then let me check it is wrong either. I don't have to see the problem, it's enough for me to know how to reproduce it.

Xaris333 (talkcontribs)

Ok. I have created copies. Now only the article w:el:Νέα Σαλαμίνα Αμμοχώστου (ποδόσφαιρο) is affected.

So the problems may are in w:el:Module:Wikidata, w:el:Module:Τοπσταδίουομαδαςtest and w:el:Module:Wikidata/citetest. The template about wikidata is w:el:Πρότυπο:Wikidata3 and the test template is w:el:Πρότυπο:Κουτί πληροφοριών ποδοσφαιρικού συλλόγουtest

The problems are:

  1. Not showing the sources (I have change the Module:Wikidata to the w:el:Module:Wikidata/citetest). Maybe showsource=true is not working. (I also need to show the source when the template using w:el:Module:Τοπσταδίουομαδαςtest)
  2. P1449: I want it to show only the greek label. So isinlanguage=el is not working. Neither withlang=el.
  3. The date is 7. Μαρτίου 1948 and is a link. It must be 7 Μαρτίου 1948 (with out . ) and not linked.
  4. rank=best is not working.
  5. P856 (url), P2013, P2002, P2397, P2035 (facebook, twitter, instagram, youtube, linkedin) and P373 (commons) are not working correctly. They may have the same problem.
  6. When an item is not having an article to el.wikipedia, the template must link to wikidata item.
  7. w:el:Module:Τοπσταδίουομαδαςtest is not working.
Matěj Suchánek (talkcontribs)
  1. w:el:Module:Τοπσταδίουομαδαςtest can be deleted, the Wikidata module has replaced it.
  2. For sources, you need to make an old cite module and update all modules to use that one.
  3. You will likely need to suppress all require 'Module:No globals' in my modules.
  4. I tried to fix most problems.
Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)
  1. Copy the second one to an "old" name and replace all usages, then update the new version.
  2. Demonstrated.
Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

The cite module should work now.

Xaris333 (talkcontribs)

Great. Everything seems to work OK with this template. I will try more templates. I don't think there will serious problems. I will tell you if I find some.

Xaris333 (talkcontribs)

One question: Can we use w:el:Module:I18n/complex date with w:el:Module:Wikidata/i18n? It has all the dates form translated for el.wiki. I have tries to translate Module:Wikidata/i18n but I can't understand some words of your language :) I think that this is the only problem for all the other templates, the dates. (Remember, we still have w:el:Module:I18n).

And problem I have forgot. If an item has no article in el.wiki, it must link to the wikidata item, not to be just text.

Matěj Suchánek (talkcontribs)

I recommend you to stick to this structure, it's actually very simple: Messages with "$1" use this as the number, others use the usual syntax. If you don't want to have the dates linked, just remove all the messages with key ending with '-linked'.

I fixed the linking in your module but be careful not to overwrite this until I develop a dynamic approach to this.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

Fixed the sources (problem was in w:el:Module:URL) and coordinates.

Important notice: you cannot use the template like [[File:{{Wikidata3|...}}, this won't work. You should probably create a new template (eg. WikidataImage) with content like {{#invoke:Wikidata|getRawValue|property={{{1}}}|rank=best|limit=1}}. The coordinates had the same problem.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

No problem if you get used to it. You can do that, too. Just make sure you will do it with any' image.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)
  1. In my reply, I suggested that you don't need it if you have no problem with using the other syntax in templates. Nevertheless, the usage will look like {{Wikidataimage|P154}}.
  2. You can fetch the caption with syntax like {{#invoke:Wikidata|getQualifier|qualifier=P2096|property=P18|withtarget=<!-- here you need the actual image value to make it accurate, for instance {{{image|{{Wikidataimage|P18}}}}}-->|qualifiers withlang=el}}. Then, the modules will finally become obsolete.
Xaris333 (talkcontribs)

I have done something wrong :) It is not working.

Matěj Suchánek (talkcontribs)

Why did you remove the images? That piece of code only retrieves the caption.

Xaris333 (talkcontribs)

I fix it. It is working I think. Please check it.

Last question for today: I was trying to translate w:el:Module:Wikidata/i18n. I have done all the dates except

['start'] = 'od %s',

['end'] = 'do %s',

['age'] = '$1 {{PLURAL:$2|έτος|έτη|let}}',

['in-the-age'] = 've věku $1 {{PLURAL:$2|έτη|let}}',

What do the words means? How each of them working. Just tell we what would be the English words for od, do, let, ve věku.

Matěj Suchánek (talkcontribs)

I think you forgot to keep the user-provided caption, eg. {{{λεζάντα εικόνας|...}}}.

  • start = "since 2017" (for a qualifier start time (P580) in parenthesis)
  • end = "until 2017" (for a qualifier end time (P582) in parenthesis)
  • age = this is the age of a living person ("xx year(s)"), you need to handle plural for "a year" in Greek
  • in the age = this is the age of a person who died ("in the age of xx year(s)"), you need to handle plural for "a year" in Greek
Xaris333 (talkcontribs)

Thanks for all. I will try the new module:Wikidata to all the templates during the week and I will tell you about problems. I think there will not be many. Thanks again.

Xaris333 (talkcontribs)

Hello. I used the code you suggest about current FIFA Ranking . It's working but the date show only the year not the full date. Why? It's better to have all the date since FIFA publish the ranking every month.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

In w:el:Πρότυπο:Πληροφορίες_ποδοσφαιριστή, there are multiple "white-space: nowrap;". This is probably not what you want. However, I don't know what design your infoboxes should have.

In w:el:Πρότυπο:Πόλη, you have {{Location map|{{{pushpin_map|{{Wikidata|P17}}}}}|...}} which is wrong. The value which is provided by the template is only supposed to be displayed to the reader, not to be used as an argument to a template. You will fix this with the same syntax I taught you to use with files.

The full date is not shown because infobox columns are usually not wide enough. I will be working on making displaying qualifiers more flexible. I imagine you will then fix this with qualifiers precision=11.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

Sorry, the appropriate tools are missing (although displaying the language is on the todo list). Just use the old one.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

Fixed.

Xaris333 (talkcontribs)

Thanks. Look I know I was a big problem to you, by spending so much time and effort to help me. I think almost everything working fine in el.wiki after the change of module.

I am more interesting in football templates. I almost done every template. I have only some problems, I think are easy, considering the other problems you have solved. They we help me finish the templates. Actually there are only 3 issues. Can I write them to you? They will be the last ones.

Matěj Suchánek (talkcontribs)

Actually, the time here is almost nothing. I have no topic to work on, so I mostly help others and make up new tools (which I have been doing with you).

Go ahead. I always say: If there's a problem, you must name it, only then you can fix it. I doubt, though these will be the last ones since our work here will never end.

Xaris333 (talkcontribs)

1) FIFA Ranking. w:el:Πρότυπο:Κουτί πληροφοριών εθνικής ποδοσφαιρικής ομάδας.

I used to use w:el:Module:FIFARanking and after the modules change I am using {{#invoke:Wikidata|formatStatements|property=P1352|rank=valid|withqualifier=P459|withqualifiervalue=Q180825|showqualifier=P585|sort=P585|invert=true|limit=1|showsource=true}}}

That shows the latest ranking according P585, correct?

For min and max I am using the Module:FIFARanking. But is showing the min or max that come first in the item. I want to have the most recent min or max. Is there a way to change use a code like the above or can you change the Module:FIFARanking to show the latest min and max?

Matěj Suchánek (talkcontribs)

For ordering by the ranking, you would use sort=quantity,P585 (with invert=true if max, otherwise min). This will show the newest best score but the oldest worst score. I have an idea how to improve this (invert will also support separating by commas, so you that could use invert=false,true) but am not sure if I can change it quickly, given that the modules are already in use on both cswiki and elwiki...

Xaris333 (talkcontribs)

{{#invoke:Wikidata|formatStatements|property=P1352|rank=valid|withqualifier=P459|withqualifiervalue=Q180825|showqualifier=P585|sort=quantity,P585|invert=true|limit=1|showsource=true|qualifiers precision=11}}

This gave the most recent max (the worst place in the rankin). It's working as you said. If you will find the way for min one, tell me please.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)
Xaris333 (talkcontribs)

What do you mean? If there is not a value with P1351 what it will happen? I check it and seems to work fine.

If the modules are perfect, I want to continue use them but you must edit them according to new module:wikidata.

Matěj Suchánek (talkcontribs)

I mean that in case there is a value without P1351, it can get displayed as well. It can happen which doesn't mean it will happen (as long as the data are maintained). If this is the case, you may take advantage of it and fix the data.

Xaris333 (talkcontribs)

Οκ. I think is not a problem. The top scorer is the top scorer, despite if the number of goals is showing.

Xaris333 (talkcontribs)

3) Last one: Recently we have find a way to have data with football kit Wikidata:Project chat#Football kit. See Real Madrid FC (Q8682)-->wears (P3828)-->Real Madrid C.F. home kit (Q28199035).

So, I want to use that data to templates. For example, for parameter body1 the module must search Real Madrid FC (Q8682), find the value of wears (P3828) that have as qualifier criterion used (P1013)-->home kit (Q45321977), and to that item (Real Madrid C.F. home kit (Q28199035)) would find has part (P527)-->body (Q170494) and use the qualifier image (P18). This is an image. For the color must do the same but to use qualifier sRGB color hex triplet (P465).

Ok, now I am writing it, I realize that is complicated :)

Xaris333 (talkcontribs)

Can this done without new modules?

Matěj Suchánek (talkcontribs)

I believe it is possible but it will need some work. I'll try to make a plan.

Xaris333 (talkcontribs)

Ok. When ever you can. Thanks again!

Xaris333 (talkcontribs)

Hello. With the previous module:wikidata we were using qualifconjtype= and conjtype= ή . Should I replace them with something else to work with the new module?

Matěj Suchánek (talkcontribs)

Commas can be overridden with separator=, "and" with conjunction=. Note that if you want each value on a separate line, you need to use both parameters. Qualifiers have the default separators for now.

Xaris333 (talkcontribs)

"Note that if you want each value on a separate line, you need to use both parameters." How?

Matěj Suchánek (talkcontribs)

separator=<br />|conjunction=<br />

Xaris333 (talkcontribs)

Οκ. Ι will try it.

When a value have start and end date we want to show for example 2011-2014. We used to use

{{Wikidata|p39|showqualifiers=p580,p582|conjtype= <br />|qualifconjtype= - }}

How should I change it now?

Matěj Suchánek (talkcontribs)

Use showqualifier=time.

Xaris333 (talkcontribs)

Only this?

{{Wikidata|p39|showqualifier=time}}

Matěj Suchánek (talkcontribs)

Yes. (You may also want separator etc.)

Xaris333 (talkcontribs)

This apply only with P580 and P582?

For example we are using

{{wikidata|P39|showqualifier=p580,p582,p768,p642|separator=<br />|conjunction=<br />|qualifconjtype= - }}

Should I change it with

{{wikidata|P39|showqualifier=time|separator=<br />|conjunction=<br />|}}

Matěj Suchánek (talkcontribs)

You can still chain multiple qualifiers:

{{wikidata|P39|showqualifier=time,p768,p642|separator=<br />|conjunction=<br />}}

Xaris333 (talkcontribs)

Good. A template is using:

{{{περίοδος ακμής|{{wikidata|P1317|conjtype= - }} }}} {{{περίοδος ακμής από|{{wikidata|P2031|conjtype= - }} }}} {{{ μέχρι |{{wikidata|P2032|conjtype= - }} }}}

As I have understood users use only περίοδος ακμής parameter, or περίοδος ακμής από with μέχρι. (It means "from to"). In wikidata users add either P1317 only either P2031 with P2032. I want to continue have P2031 - P2032 (with the - ).

Should I change it to

{{{περίοδος ακμής|{{wikidata|P1317|conjunction= - }} }}} {{{περίοδος ακμής από|{{wikidata|P2031|conjunction= - }} }}} {{{ μέχρι |{{wikidata|P2032|conjunction= - }} }}}

(It's not a template I am using so I don't know a lot about it. But is the most common template that using wikidata in el wiki so I am trying to solve the problems).

Matěj Suchánek (talkcontribs)

I doubt it would be right. You do not expect the property to have multiple values, therefore there is nothing to connect. Instead, put the connector between the parameters and possibly use some #if:.

Xaris333 (talkcontribs)

Thanks for all.

If you find a solution about max fifa ranking and about football kit, tell me pls.

Have happy holidays!

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

addcat=true should work. You will need to set ['used-property'] = '' in Module:Wikidata/i18n first.

Xaris333 (talkcontribs)

Like this ?

Matěj Suchánek (talkcontribs)

%s is missing there, it gets substituted by the property id.

Xaris333 (talkcontribs)

The category is wrong.

Κατηγορία:Σελίδα που χρησιμοποιεί δεδομένα των Wikidata/Vlastnost P634

Vlastnost is the problem.

Matěj Suchánek (talkcontribs)

Oops, thanks for the report. Since we haven't started using this feature yet, I couldn't notice this stupid bug.

You will work around this by adding |catbase={{{1}}} to the parameters inside w:el:Template:Wikidata.

Xaris333 (talkcontribs)

Seems ok.

Thanks!!

Have happy holidays!

Xaris333 (talkcontribs)

{{#invoke:Wikidata|formatStatements|property=P1352|rank=valid|withqualifier=P459|withqualifiervalue=Q180825|showqualifier=P585|sort=P585|invert=true|limit=1|showsource=true|qualifiers precision=11|addcat=true}}}}}}}}}}}

With this code is still gives

Κατηγορία:Σελίδα που χρησιμοποιεί δεδομένα των Wikidata/Vlastnost P1352

Matěj Suchánek (talkcontribs)

Use {{Wikidata|...}} wrapper or apply this fix (and eventually remove the workaround I suggested).

Xaris333 (talkcontribs)

{{Wikidata|P742|rank=best|showsource=true|withlang=el|addcat=true}}

I get error if there is not el value.

Lua error in Module:Wikidata/Filterers at line 34: Funkce „IsInLanguage“ vyžaduje datový typ „string“, poskytnut byl „monolingualtext“.

Matěj Suchánek (talkcontribs)

Property:P742 is string datatype, withlang works only with monolingualtext.

Xaris333 (talkcontribs)

I haven't noticed. I thought it was the same with nickname (P1449).

I remove withlang=el.

Another question. I have add addcat=true for all properties. But some of them are not working.

  • | image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|{{{εικόνα|{{Wikidataimage|P18|addcat=true}}}}}}}}|size={{{image_size|{{{πλάτος_εικόνας|200px}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
  • | caption = {{{λεζάντα εικόνας|{{#invoke:Wikidata|getQualifier|qualifier=P2096|property=P18|withtarget={{{image|{{Wikidataimage|P18|addcat=true}}}}}|qualifiers withlang=el}}}}}
  • {{#invoke:Wikidata|getRawValue|property=P2013|addcat=true}}

How to fix this?

And something else: {{#if:{{{pronunciation|{{{προφορά|{{Wikidata|P443|rank=best|addcat=true}} }}} }}}|[[File:{{{pronunciation|{{{προφορά|{{Wikidata|P443|rank=best|addcat=true}}}}}}}}]]}}

It is a sound file. Is not working. I get [[File:En-us-Barack-Hussein-Obama.ogg]].

Matěj Suchánek (talkcontribs)

getRawValue doesn't support addcat (the function is supposed to only return one value, nothing more) and {{Wikidataimage}} does niether. (Of course, you could modify it to have it returned but this will either break all images or just won't work.) You need to find a way around and insert the category in the wikitext. (Meanwhile, it will try not to forget preparing better support for files.)

I will remind you of this my post, don't worry to tell me if you don't undestand what I mean (perhaps you just forgot).

By the way, your handling of image caption is a bit buggy. There may be a situation that there's no caption available in the article but there is still an image. In that case, the template can load a totally irrelevant caption from the item and display it with the image. This is also problem the other way around. Eventually, you will need to change the code to something like {{#if: {{{image|{{{εικόνα|}}}}}} | {{{λεζάντα εικόνας|}}} | {{#invoke:Wikidata|getQualifier|qualifier=P2096|property=P18|withtarget={{Wikidataimage|P18}}|qualifiers withlang=el}} }}. (My experience says that this will confuse the users but it's still better than showing wrong data.)

Xaris333 (talkcontribs)

Good. All clear now. I fix sound file, I forgot the previous post :)

{{#if:{{{native_name|{{{ιθαγενές όνομα|{{Wikidata|P1559|rank=best|showsource=true|addcat=true}} }}} }}}|<span class="nickname" {{#if:{{{native_name_lang|{{{ιθαγενές όνομα γλώσσα|}}} }}}|lang="{{{native_name_lang|{{{ιθαγενές όνομα γλώσσα|}}} }}}"}}>{{{native_name|{{{ιθαγενές όνομα|{{Wikidata|P1559|rank=best|showsource=true|addcat=true}} }}} }}}</span>}}

Is there a way to show the language (P1559)? I want the reader to understand which language is.

Matěj Suchánek (talkcontribs)

Nope, but I had already put it on the todo list. I can do this quickly now if you want.

Xaris333 (talkcontribs)

No. After you do it in a general way, tell me to use it.

Another problem: Where can I change the way the coordinates are showing? From 43°39′4″ s. š., 79°23′ v. d. to 43.651234°N 79.383333°W (and the page to be this and not this). Actually, can the module w:el:Module:Coordinates or the w:el:Πρότυπο:Coord to be used?

Matěj Suchánek (talkcontribs)

Languages done in w:cs:Modul:Wikidata/Formatters/monolingualtext (use showlang=true).

I see the problem with coordinates. If you have a template or module to display it, just insert the coordinates as arguments using getRawValue with parameter field=longitude (or latitude).

Xaris333 (talkcontribs)

Language: Is working. But is writing (English). It would better if the language was in Greek (and maybe a link?).

Coordinates: how?

{{#if:{{{burial_place|{{{τόπος ταφής|{{Wikidata|P119|rank=best|showsource=true|addcat=true}}}}}}}}|{{Br separated entries|1={{{burial_place|{{{τόπος ταφής|{{Wikidata|P119|rank=best|showsource=true|showqualifier=P625|addcat=true}}}}}}}}|2={{{burial_place coordinates|{{{τόπος ταφής συντεταγμένες|}}}}}} }} }}

Don't mind about burial_place coordinates parameter. Is by hand. The problem is with showqualifier=P625 when the coordinates came from wikiadata.

Matěj Suchánek (talkcontribs)

I have fixed the languages, thanks for reporting.

By coincidence, I had the same problem with coordinates few months ago. I have solved it with that module, which you actually don't want. I'll see what I can do.

Xaris333 (talkcontribs)

Thanks.

You have told me before but I wasn't able to do it. I want a - between the two parameters.

{{{περίοδος ακμής από|{{wikidata|P2031|showsource=true|rank=best|addcat=true}} }}} {{{ μέχρι |{{wikidata|P2032|showsource=true|rank=best|addcat=true}}

Matěj Suchánek (talkcontribs)
{{{περίοδος ακμής από|{{wikidata|P2031|showsource=true|rank=best|addcat=true}}}}} {{#if: {{{μέχρι |{{wikidata|P2032|showsource=true|rank=best|addcat=true}}}}} | - {{{μέχρι |{{wikidata|P2032|showsource=true|rank=best|addcat=true}}}}} }}
Xaris333 (talkcontribs)

{{Wikidata|P1082|withqualifier=P585|withqualifiervalue=2011|showsource=true|addcat=true}}

Not working. I know that the problem is 2011. How to write it?


And by experimenting I have noticed that there is no withsourcevalue option... {{Wikidata|P1082|withsource=P248|withsourcevalue=Q29639092|showsource=true|addcat=true}}

Matěj Suchánek (talkcontribs)

For the first one, try a more precise date if you can or date=2011.

I updated the todo list. I'll see when I get to implement it.

Xaris333 (talkcontribs)

date=2011 is working thanks.

This code is working.

{{#ifexpr: {{#if:{{{1881|}}}|{{{1881}}}|0}} | {{Decimals| (100 * {{{1891}}}/{{{1881}}} - 100) | 1}}% | <center>—</center> }}


With wikidata is not working (is working as a code in wikipedia, not fetching data from wikidata). Do you know why?

{{#ifexpr: {{#if:{{{1881|{{Wikidata|P1082|date=1881}}}}}|{{{1881|{{Wikidata|P1082|date=1881}}}}}|0}} | {{Decimals| (100 * {{{1891|{{Wikidata|P1082|date=1891}}}}}/{{{1881|{{Wikidata|P1082|date=1881}}}}} - 100) | 1}}%

Matěj Suchánek (talkcontribs)

Sounds like . Whenever you need an unformatted number, use getRawValue.

Xaris333 (talkcontribs)

Thanks. I will try it.

Xaris333 (talkcontribs)

{{Wikidata|P1082|date=1881|showqualifier=P1540}}

With this way we can have the value of a property and the value of the qualifier in brackets. Is there a way to have only the value of the qualifier? Not the value of the property, not the brackets.

Matěj Suchánek (talkcontribs)

get(Raw)Qualifier is the dedicated function for this: {{#invoke:Wikidata|getQualifier|qualifier=P1540|property=P1082|date=1881}}.

Xaris333 (talkcontribs)

I am trying to create a population template using population data from wikidata. I used Template:US Census population. It is working. w:el:Πρότυπο:Πληθυσμός απογραφών Κύπρου

I am using another template w:el:Πρότυπο:Graph:Population history. It takes the data from wikidata to create a graph about population. Is working fine by this way: {{Graph:Population history|interpolate=linear|1=Q185632}}

I want this two templates to be one template. But without change the second one. So, I will just add the second template to the first one. Two problems.

1) I don't want to need to insert |1=Q185632. Is there a code that will automatically use the id of the page in wikidata of the article? Like |1={{WikidataID}}

Matěj Suchánek (talkcontribs)

My module does provide this function but I think it's better to have this directly in the graph, with no parameter.

Xaris333 (talkcontribs)

And if someone wanted to use the graph to an article but to use the population data of other area?

Matěj Suchánek (talkcontribs)

They will still be able to, the parameter will have higher priority (but will be generally unnecessary).

Xaris333 (talkcontribs)

Ok. How can we do that? :)

Matěj Suchánek (talkcontribs)
Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

With "insert", you mean to build the graph using the data from the arguments or Wikidata? I haven't explored yet how graphs work, sorry.

Xaris333 (talkcontribs)

No. The graph template is working fine.

Now, I am using a table and I am writing the data by hand and one column of the table is the graph (by using the template).

Now, we have a template that take the data from Wikidata. So, I don't need to write them by hand. I just need to insert the population template to the article and show the population (this is what the template do now) and to also to show the graph (this is what the template is not doing now, the other template do it). So, I need to have a template inside another template.

Sorry for my English.

Matěj Suchánek (talkcontribs)

I just wanted to be sure, nevermind. Now I do understand that you want to add the sixth column to the table that will show the graph.

There is a problem: you need to know how many rows the table will have since it is variable. The only way to get this information is to make an #if: for each date whether the number of people is available... which is impractical since it will then be more difficult to update with additional dates. I didn't even mention that not only the row count is variable, the first row is either. In fact, this is what a module should handle.

One way around is not to have data and graph in the same table but to have a table of the table and the graph but this will be ugly (and I'm not good at designing either).

Xaris333 (talkcontribs)

Ok. That is a good explanation. I understand.

And something else: sources. Because for population I am using stated in (P248) --> Cyprus census 1946 (Q29639084) for example, it can't take all the data for the source, unless I put them with a property. But, I can't use for example archive date (P2960) as a property for Cyprus census 1946 (Q29639084). I use it as a qualifier of full work available at (P953).

I have add the source in Wikidata as it supposed to be. stated in (P248) is not a good source.

Xaris333 (talkcontribs)

I want your opinion: now the population data has 2 sources that come from wikidata. See w:el:Πελένδρι#Πληθυσμός. The second one is in the form we wanted. The second one is by stated in (P248). Is not a good form. I don't want it to show. I thought to remove it from items. But, on the other hand I think is better to have the connection with the census item. Any ideas?

Matěj Suchánek (talkcontribs)

Aren't the reference with just stated in (P248) and the other one actually the same one? I believe you want to merge those references into one, then there will be both the connection and (hopefully) the data you want. I'm sorry, the references from Wikidata are still a little immature but you know, one day being able to create references from Wikidata will be mandatory.

Xaris333 (talkcontribs)

Yes they are. But with P248 it just take some things like url and language from census item. Is there a property that I can use as a qualifier (not as a source) to show that the pupulation of a place with the census item?

Matěj Suchánek (talkcontribs)

The data from the reference have higher priority, stated in (P248) wouldn't override them. I could prevent loading data from the main item in certain situations... but this could later cause problems with other datasets. Wikidata doesn't have a stable policy dealing with references (ie. what data a reference should hold and what data from the main item are relevant) and I'm afraid whether it isn't too late.

Maybe the property statement is subject of (P805) could be used for this.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

Maybe. Though if you remove it, some references (like that of the population in w:el:Λευκωσία and others) will show almost nothing.

Yes, that's the reason. Seems that the problems with references are going to be unsustainable...

Xaris333 (talkcontribs)

So, when using P248 the module takes informations from the item of P248?

Matěj Suchánek (talkcontribs)

Yes and no. It checks what information is missing in the reference and eventually imports that. For instance, the reference can be as simple as stated in (P248) and retrieved (P813), the rest can be in the item, so that all the information is not duplicated across items. But it can also be stored in the reference itself. Each approach is possible per Help:Sources, it depends on the situation: For source items in Wikidata use the property stated in (P248); for sources that exist online outside of Wikidata, use reference URL (P854).

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

I can see now what needs to be fixed but it's the same problem as with the chart (graph) integration: templates are too bad tool to make tables dynamic.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

The references have the same hash ("identifier") on Wikidata. Same references should have the same hash and vice versa. I print <ref name="HASH">, thanks to that references with the same content get the same number. Those references do have the same hash but are not same. I don't know why, perhaps some problem on Wikidata. I will investigate it.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

Wow, interesting. The problem is {{formatnum: {{{1881|{{Wikidata|P1082|date=1881|showsource=true|addcat=true}}}}} }}. It should be {{#if: {{{1881|}}} | {{formatnum: {{{1881}}} }} | {{Wikidata|P1082|date=1881|showsource=true|addcat=true}} }} (you will need to replace it in all rows and columns). If you teach me how the formatting should look like in Greek, I can make it work for Wikidata values as well.

Xaris333 (talkcontribs)

What do you mean with the last sentence?

Matěj Suchánek (talkcontribs)

{{formatnum: }} depends on the language and I'm too lazy to look up how numbers are formatted in Greek. The modules still use the Czech formatting.

Xaris333 (talkcontribs)

What informations you need?

And something else: I have added page number in w:el:Module:Wikidata/cite. It is working but is a link. We don't want to be a link. And we want to have the word "σελ." in front. Example: σελ. 11 (is p. 11 in english). Xaris333 (talk) 15:12, 7 January 2018 (UTC)

Matěj Suchánek (talkcontribs)

Ok, I fixed that.

Info: How you separate thousands (dots?) and the decimal point (comma?).

Xaris333 (talkcontribs)

Thousands with dots. Comma for the decimal point.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)

date= actually takes the first (= closest) value after the date. Perhaps withqualifier=P585|withqualifiervalue=YYYY(-MM(-DD)) will work better.

Xaris333 (talkcontribs)

No. Now 1973 value is not showing to any article.

I added |withqualifier=P585|withqualifiervalue=1973 instead of |date=1973

Matěj Suchánek (talkcontribs)

It should be better now. Another bug that was fixed thanks to you!

Xaris333 (talkcontribs)

Bugs are fixing thanks to you :) Thanks!