Topic on User talk:Matěj Suchánek

Jump to navigation Jump to search
Xaris333 (talkcontribs)

Hello. The template is el:Πρότυπο:Infobox football league (the Greek version of en:Template:Infobox football league). It is written in English.I have 3 problems. Lets use as example Cypriot First Division (Q155965).

1) I need to have the current season. This can be done by has as part (P527). All seasons have the qualifier edition number (P393). I want module in the client to compare all edition numbers and tell which has the highest. (I can use rank=preferred but is not the best solution).

2) I need to have the first season. This can be done by has as part (P527). All seasons have the qualifier edition number (P393). I want module in the client to compare all edition numbers and tell which has the 1st one.

3) I want to show the team with the team with the most champions and the number of champions in brackets. Now I am doing this with rank=preferred but is not the best solution. It can be done by winner (P1346) and number of wins (P1355).

4) I want to shows the current champions with season. This can be done by winner (P1346). I want module in the client to compare all victories and tell which has the latest one. To show the team and the season. OK, I know this is toο difficult.

Matěj Suchánek (talkcontribs)

Hi.

  1. I believe this could be possible to code up but why not rank=preferred? Moreover, edition number (P393) seems to be wrong property, series ordinal (P1545) should propably be used instead.
  2. Would look like the previous one.
  3. This is quite ugly. In theory, this data should be stored only in the seasons items and then querried. This is not possible in Lua, though.
  4. Would be based on 3.
Xaris333 (talkcontribs)

For 1 and 2: If I use rank=preferred for the current season, how can I use it for first season too?

For 3: Οκ. If there is not other solution, I will keep rank=preferred.

Matěj Suchánek (talkcontribs)

For 2: I meant that it would be possible to code up. (But I'm not planning to do this, sorry.)

For 3: Preferred rank doesn't make sense here. But maybe point 4 could benefit from it.

Xaris333 (talkcontribs)

Οκ. Thanks for your time.

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

Done some corrections.

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

Do you have an example? Like an item, the top team and the number of wins?

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

This was quite tricky but should work.

Xaris333 (talkcontribs)

Many thanks!!

Matěj Suchánek (talkcontribs)

Oh, I forgot to point out (or remind as I have already written it above) that edition number (P393) shouldn't be used for this. It is obivious that order should be expressed using a number, not a string. So you cannot consider this module stable until migration to series ordinal (P1545) (and of course modifying the module).

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

Hm, edition number (P393) uses {{Constraint:Value only}} whereas series ordinal (P1545) uses {{Constraint:Qualifier}}. Moreover, each season already holds this data as a regular statement (ie. there is an unneccessary data duplication)... And there seem to be more errors, for instance why does 1935–36 Cypriot First Division (Q2706388) state it's a subclass of (P279) Cypriot First Division (Q155965)? Shouldn't this be part of (P361) to fulfil the requirement of having an inverse to has as part (P527)?

Xaris333 (talkcontribs)

Ok. Lets take one by one. I really want to add correct data.

"each season already holds this data as a regular statement (ie. there is an unneccessary data duplication)." So, it is better only the season to have series ordinal (P1545). But this qualifier (ok now is P393 but it will change), as it is use in league article, is using by

What can be done, if I remove the property from the league item?

Matěj Suchánek (talkcontribs)

We have to load each item and check its data... which is actually a time bomb that once can cause problems. So I'm striking the word unneccessary. (Sorry, I'm doing many things simultaneously which spreads my concentration.)

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

This is the "time bomb". If there is a series of 50 items, you have to load all of them while there's a limit of how much data you can load with Lua.

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

I would suggest an early stop like this:

    for _, st in ipairs(entity.claims.P576 or {}) do
        if st.rank ~= "deprecated" and st.mainsnak.snaktype == "value" then
            return
        end
    end
Xaris333 (talkcontribs)

Many thanks for all!!

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

Fixed. I always delete this stuff from your modules and as you can see, I have a good reason for it because for instance here you assumed that ranking (P1352) is string, but it's a quantity.

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

if v[3] == rank then should be if v[2] == rank then.

Also, why don't you do this in a single module?

Xaris333 (talkcontribs)

My templates need to show the first, second, third and fourth place team. I have no problem with the first team because I can use winner (P1346). For the other places that was the best solution I have found. I can't make a single module. I am not expert in modules.

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

Invalid link. Do you want to include a distinct check, ie. only count different items?

Xaris333 (talkcontribs)

Yes. The items must be distinct.

Xaris333 (talkcontribs)

We are using w:el:Module:Τρέχονπρωτάθλημα to find the current season. For example, in Cypriot First Division (Q155965), the module find the current season by checking has as part (P527). The current season is the item with the largest edition number (P393). That's what we have done. But a friend suggest me something easiest.

May the current season is the one with not have followed by (P156) or has no value for followed by (P156) or its the last item of a series with followed by (P156) of all the items that have instance of (P31) with sports season (Q1539532) and Cypriot First Division (Q155965). Pls tell me if that is possible because that way if much easier to fetch that kind of data from wikidata.

Matěj Suchánek (talkcontribs)

I bet it's possible but this is the timed bomb I mentioned above. You have to load all items from the series to determine which is the most recent one.

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

Fixed.

Xaris333 (talkcontribs)

Thanks. Look UEFA Euro 2016 (Q189571), statistical leader (P3279), criterion used (P1013), goal (Q18530), number of points/goals/set scored (P1351), member of sports team (P54)

I want a module that will check statistical leader (P3279) and show the item than has the qualifier criterion used (P1013) with goal (Q18530). With the item I want to show in brackets the number of number of points/goals/set scored (P1351) with the word "goals". In UEFA Euro 2016 (Q189571) must show Antoine Griezmann (6 goals).

You can create the module here.

Matěj Suchánek (talkcontribs)

Sorry for not replying, this is currently low priority for me. I don't know when I'll get to this. If I don't do so this week, don't hesitate to come back and remind me. Thanks.

Matěj Suchánek (talkcontribs)

Sorry for the delay, it's ready now.

Xaris333 (talkcontribs)

Many thanks!!!

In a template I have this parameter.

| label3 = Dates
| data3 = {{{dates|}}}

for example, in the article I am fill in the parameter like that:

dates= 13 December 2016 - 14 December 2013

I want to use wikidata data. I know how to put only one property.
| label3 = Dates
| data3 = {{{dates|{{Wikidata|P580|}}}}} (start date)


But I also need to insert

{{Wikidata|P582|}} (end date)

Do you know how can I do that to show 13 December 2016 - 14 December 2013?

Matěj Suchánek (talkcontribs)
| data3 = {{#if: {{Wikidata|P580|}} | {{Wikidata|P580|}} {{#if: {{Wikidata|P582|}} | - {{Wikidata|P582|}} }} }}
Xaris333 (talkcontribs)

Many thanks!!

Xaris333 (talkcontribs)

Hello. I need lua code that will return the item of a qualifier.

qualifies for event (P3085) (the property) QXXXX (the item of the property) winner (P1346) (the qualifier) QWWWW (that is the item I want to show)

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

Sorry. P1346

Matěj Suchánek (talkcontribs)

Just point me to a module page, this will be a simple code re-use.

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

Done.

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

Copy and use makeResult() from the other modules I created.

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

Applied what I suggested.

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

Before proceeding, I would like to note that the linking strategy should be unified across all modules. So there should a decision whether you really want to link to Wikidata if there is no Greek article (in cswiki, we don't do this if there is a label). You could also have ArticlePlaceholder installed and link to placeholders. So choose one strategy and enforce it in all modules.

Xaris333 (talkcontribs)

w:el:Module:Wikidata and w:el:Πρότυπο:Wikidata (template)

Well in el wiki, if there is no article link to an item, the Greek label is be showed and link to wikidata page of that item. The color of this link is cyan. If there is no Greek label is be showed the English label. If there is no English labels is showed the Q number. All link to wikidata page of the item. Does that helps you?

Matěj Suchánek (talkcontribs)

I have made an example here. If this is what you want, replace other makeResult()'s in all modules or move it to a common module and load it via require.

Xaris333 (talkcontribs)

Yes. Its working. Many thanks!!

Xaris333 (talkcontribs)

Last one: I want to fetch the item of P1448 from wikidata. If I write that one

| data1 = {{Wikidata|P1448|showqualifiers=P580}}}

I get for example The Reds (1888).

But I want to show also the end date, if it exist. For example, The Reds (1888-1990).

Is that possible? The other qualifier is P581.

Matěj Suchánek (talkcontribs)

I guess using "showdate=true" could achive this.

Xaris333 (talkcontribs)

Yes. Thanks.

Using official name (P1448) you have to insert the language of the name.

{{Wikidata|P1448}} shows the nickname. Is there a way to show, in brackets, the given language?

Matěj Suchánek (talkcontribs)

Is it really neccessary? Anyway, the module seems to support setting "showlang=true", so try this one.

Xaris333 (talkcontribs)

Is not working but thanks anyway. It must be templates problem. Thanks for all!!!

Xaris333 (talkcontribs)

Hello. I am using at a wikidata item nickname (P1449). You have to add the language. Is there a way to Wikipedia article to show only the items of that property that are in Greek language?

I am using {{Wikidata|P1449|}}.

Matěj Suchánek (talkcontribs)

Try isinlanguage=el (sorry for the silence, I had a short vacation).

Xaris333 (talkcontribs)

Thanks!! (Answer when ever you want and you can. You help is priceless.)

Xaris333 (talkcontribs)

Hello. Somedates before I have asked you:

Using official name (P1448) you have to insert the language of the name. ... Is there a way to show, in brackets, the given language?

And you answer: ...the module seems to support setting "showlang=true", so try this one.

Is not working. Anyideas why?

Matěj Suchánek (talkcontribs)

I think I know why: In the module, there is if args.showlang == true then which doesn't work from wikitext, only from another module... So it should work if we changed it to if tostring( args.showlang ) == 'true' then.

Xaris333 (talkcontribs)

Ok. I have changed it. But is showing the language code and in front of the word. See the template information box in w:el:Άρσεναλ

I want to show it after the word and all the name in Greek. Like in wikidata property. Is there a way?

Matěj Suchánek (talkcontribs)

What is the benefit of having the language shown, anyway? There is a way, of course, but you would have to change the module a bit which makes it harder to update it later from the master version.

Xaris333 (talkcontribs)

Ok. Then lets keep it as it is. Thanks!

Xaris333 (talkcontribs)

Hello. In a template, in a data, I am using

| data6 = {{{town|{{Wikidata|P159|link=wikipedia|rank=best|showsource=true|}}}}}}}}|{{{town|{{Wikidata|P159|link=wikipedia|rank=best|showsource=true|}}}}}}}}{{{#if: {{{country|{{Wikidata|link=wikipedia|P17|showsource=true|}}}}}|, {{{country|{{Wikidata|link=wikipedia|P17|showsource=true|}}}}} }}}

but only shows the town, not the country. Do you know why?

I want the country and the , to be showed only if the town is completed.

Matěj Suchánek (talkcontribs)
| data6 = {{#if: {{{town|{{Wikidata|P159|link=wikipedia|rank=best|showsource=true|}}}}} | {{{town|{{Wikidata|P159|link=wikipedia|rank=best|showsource=true|}}}}}{{#if: {{{country|{{Wikidata|link=wikipedia|P17|showsource=true|}}}}}|, {{{country|{{Wikidata|link=wikipedia|P17|showsource=true|}}}}} }} | <!-- {{{country|{{Wikidata|link=wikipedia|P17|showsource=true|}}}}} --> }}

You can uncomment the final else clause if you want to fallback to the country.

Xaris333 (talkcontribs)

It's working. Thanks!

Matěj Suchánek (talkcontribs)

The code looks good but I think I know what doesn't work (although I didn't look at any articles).

There's a small difference between an empty parameter and a skipped parameter. If you have a template with code like a{{{param1|b}}}c and pasted into an article like:

{{Template
| param1 = 
}}

it returns ac (the "b" is overriden by the empty parameter). Just {{Template}} returns abc (the "b" is not overriden by the skipped parameter).

This is useful when you need an ability to override data from Wikidata with an empty value but it also hides a lot of them when the template migrates to Wikidata. So now you have to either change the template, or clean up articles (using a bot).

Xaris333 (talkcontribs)

Yes. I know that. I am checking all articles than using the template one by one. Its difficult but I have too. If I clean up the articles in not sure that the data I want is in wikidata items. Not all of them are completer. So I add the statements.

Xaris333 (talkcontribs)

Hello. I want a Module that if on an item there is the statement P154, it will show only the qualifier P2096 of this statement, if that exist, in greek language (el). If the qualifier with P154 is not exist or exist in other language, it will not show anything.

You can write it there w:el:Module:ΛεζάνταΛογότυπου if you want and you have the time to help.

Matěj Suchánek (talkcontribs)

Done

Xaris333 (talkcontribs)

Many thanks!

Xaris333 (talkcontribs)

Hello. In Greek Wikipedia we have w:el:Module:DateFunctions. This module is for showing the dates. For example, the present day is 22 Ιανουαρίου 2017. In Greek language we have w:Grammatical case. January is Ιανουάριος in Greek language. But we need Genitive for data: Ιανουαρίου. Its working fine when we have full date. The problem is when we have only month and year. It must show Ιανουάριος 2017. Now it is showing Ιανουαρίου 2017, like 22 Ιανουαρίου 2017 without 22. Can you correct this? Maybe if the module ask if there is the number of the date, with the negative answer to show the original name of the month, not the Genitive form.

Matěj Suchánek (talkcontribs)

I have problem niether with understanding the problem (as this is just the same in Czech) nor finding the data providers but I cannot find where this needs to be corrected.

Xaris333 (talkcontribs)

Ok. January in Greek is Ιανουαρίος. But sometimes is Ιανουαρίου. If we have a full date, like 22 January 2017, we are using the second: 22 Ιανουαρίου 2017. If we have only month and year, we are using the first one: Ιανουάριος 2017.

See p['μήνες'] = { {['όνομα'] = 'Ιανουάριος', ['γεν'] = 'Ιανουαρίου', ['συντμ'] = {'ΙΑΝ','ΙΑΝ.',}, ['ημ'] = 31},

on the module.

Now only the first case is working. The full date. If in wikidata we don't have the date (22) then is shows Ιανουαρίου 2017 and not the correct Ιανουάριος 2017.

Matěj Suchánek (talkcontribs)

I do understand the grammar but I can't find the place (template/module) where the mentioned module emits wrong data.

Xaris333 (talkcontribs)

The module is working fine. I am suggesting to add something else:

If we have only the month and the year and not the date, then the module have to show the word after ['όνομα'] and not after ['γεν'] for month. Have to show Ιανουάριος instead of Ιανουαρίου.

Matěj Suchánek (talkcontribs)

Does it help you that the module holds both functions: p.getmonthname and p.getmonthgen?

Xaris333 (talkcontribs)

Yes. I am not so good with modules. See w:el:Module:Wikidata.

If you understand what is using for dates, maybe we can find the problem. If not, is ok. Don't waste your time.

Xaris333 (talkcontribs)

Hello. I need some help with w:el:Module:Wikidata. When fence data from Wikidata, its also fence the source, if that exist. That's is something we want. But I want the result to be like the result of w:en:Template:Cite web (I am using here the english because you don't know Greek). I need to use the properties reference URL (P854) (already exist), retrieved (P813), title (P1476), original language of work (P364), publication date (P577), archive URL (P1065), archive date (P2960), publisher (P123). For example, the result of fencing P571 of Apollon Lympion (Q18148036) should be the reference 2 in w:el:Απόλλων Λυμπιών#Παραπομπές. Now the result is the reference 1. (If you can add some of the properties, then I may be able to do the others).

Matěj Suchánek (talkcontribs)

This is what we use in cswiki. You can see an example in w:cs:Uherský Brod, it's the reference 1 which refers to the population in the infobox. If you like it, I can help you port it to elwiki and localize it, so that your module can use this one instead. Your feedback will be appreciated as well.

Xaris333 (talkcontribs)

Yes! It's what I want.

Xaris333 (talkcontribs)
Matěj Suchánek (talkcontribs)
if args.showsource and statement.references then
	local cite = require 'Module:Cite'
	...
	str = str .. sourcestring
end

should become

if args.showsource and statement.references then
	local cite = require 'Module:Wikidata/cite'
	str = str .. cite.formatReferences(statement.references, {})
end
Xaris333 (talkcontribs)

Not working. I get the message: Lua error in Module:Wikidata at line 725: Tried to write global s.

Matěj Suchánek (talkcontribs)

Fixed, you kept the middle part.

Xaris333 (talkcontribs)

Thanks. Is there a way to change the way is be showing? See w:el:Απόλλων Λυμπιών#Παραπομπές. The first reference is from wikidata, the second from wikipedia. They are the same reference.

  • 1) Can the title be the link of url?
  • 2) The editor is not showed.
  • 3) The archiveurl and the archivedate is not showed.
Matěj Suchánek (talkcontribs)

Made some changes but it still isn't 100% perfect, is it?

Xaris333 (talkcontribs)

Its very very good. The only problem is the publisher. It links to wikidata item. Using the Wikipedia template the publisher has no link (only if you add one). May is better to remove the link of the publisher when there is not wikipedia sitelink.

Matěj Suchánek (talkcontribs)

Firstly, you should decide what will be the default linking strategy accross all templates using Wikidata. The main module has some configuration which I have just changed but you should say whether it's correct.

Xaris333 (talkcontribs)

Yes, you are right. I will undo your change because we want to have a link to wikidata if the item has no article. The problem in the reference case is that we link a website but the link don't link to the website but to wikidata. We can live with that, its ok. Many thanks!!

Matěj Suchánek (talkcontribs)

I do know how to work around that link, I just needed to know what is possible...

Xaris333 (talkcontribs)

What do you mean?

Matěj Suchánek (talkcontribs)

The only problem is the publisher. It links to wikidata item. I know what needs to change but I had to find out where (whether in Module:Wikidata or Module:Wikidata/cite). Now I know it's the latter, on the other hand: We can live with that, its ok.

Xaris333 (talkcontribs)

Yes. It is not a big problem. Thanks!

Xaris333 (talkcontribs)

Sorry, I need you again. There is a problem with you changes. Because you don't know greek. :) When we have a url and archive url, the title links to the archive url. The word "το πρωτότυπο" link to the original url. When there is no archive url, the title links to the original url. Can you correct this?

And one more problem: Lua error in Module:Roman at line 132: Tried to write global convertArabicToRomanHTML.

Matěj Suchánek (talkcontribs)

Fixed both (well, the second hasn't been fixed yet, I have only suppressed the error message).

Xaris333 (talkcontribs)

Looks fine to me. Thanks.

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

I don't think this would be what you want. Do you want to show source that a stadium is in a city? Or that a team has a stadium?

Xaris333 (talkcontribs)

That a stadium is in a city. The reference must be on stadium location property on wikidata.

Matěj Suchánek (talkcontribs)

Done, please check.

Xaris333 (talkcontribs)

Its not working. No reference. And the location of the stadium is wrong now.

Matěj Suchánek (talkcontribs)

Sorry, there was a leftover after testing.

Xaris333 (talkcontribs)

It is still wrong. Is a problem we have before but was solved. If it has 2 or more stadium with the property, it always shows the location of the first one, not the preferred one. And also no reference.

Matěj Suchánek (talkcontribs)

The problem is that I don't have a reliable test case, niether do I know where the module is used (does the search engine not like Greek alphabet?). I will work on this tomorrow, now please find a version that didn't break anything and revert me.

Xaris333 (talkcontribs)

Its OK. I undo your change. Maybe is not important to have the reference for the location of the stadium. The reference for the stadium is enough.

Xaris333 (talkcontribs)

Hello. Reading w:el:Module:Wikidata/cite I think that the problem with not linking the publisher to the Wikipedia item (if exist) but to Wikidata item page, is in Module:Wikidata/cite. So, the template Module:Wikidata will not be affected. Please try to solve it if you can. (For example, in w:el:Αγία Σοφία Λάρισας in the first reference the Ελληνική Στατιστική Αρχή should link to the article, not to wikidata item.)

And P248 (work) is not working. For example, in w:el:Αγία Σοφία Λάρισας it must show the w:el:Ελληνική απογραφή 2011.

Matěj Suchánek (talkcontribs)

In fact, the problem is inside Module:Wikidata. If you set defaultlink = 'wikipedia' and defaultlang = 'el', then you will prefer links to your Wikipedia. Wikidata links will only be created if you don't have an article. I didn't understand this, so I changed it but you undid me for some reason (it doesn't matter, it can difficult for you to understand me).

I can propably make P248 start working again somehow but explain me first why you store publisher, url etc. inside the reference when you can load it via P248?

Xaris333 (talkcontribs)

I have restore the Module to your edition. But now, if an item don't have a wikipedia article in Greek wikipedia, then is just a text. Is not link to wikidata item. That's why I have undo you the first time. Pls see the template at w:el:Νέα Σαλαμίνα Αμμοχώστου (ποδόσφαιρο), the name Παρασκευάς Ανδρέου.

I didn't understand the question about P248. Do you have an example?

Matěj Suchánek (talkcontribs)

Please excuse me and undo it again (you may keep defaultlang = 'el' as you want to display as much Greek as possible, don't you?). Now I know what I have to do (always add link = 'wikipedia' to modules and lang=wikipedia to templates).

What I meant was that when you take a look at Q21503875#P1082, there are some data in the reference. But some of the data are also saved in Q5601909 (via P248). So this should be made clear. And also: how do you want to show P248? What link and what title? After or before what?

Xaris333 (talkcontribs)

I undo the change. But we still have the problem with the references. Its only shows wikidata pages, not articles if they exist.

For P248, see w:el:Πρότυπο:Cite web#Παραδείγματα, the first example (parameter work). Just fix the module to show P248 at the references. Don't care about the data.

Matěj Suchánek (talkcontribs)

Wikified and re-included work.

Xaris333 (talkcontribs)

Thanks.

In french Wikipedia I notice that they have a small pencil picture after anything fetch from wikidata. In you click on it, its moves you to wikidata page of the item, to the property that has the data and you can edit it if you want. See w:fr:Zinédine Zidane (before 44 ans). Do you think how this can be add to gr wikipedia?

Matěj Suchánek (talkcontribs)

Through some modification inside Module:Wikidata, propably inside formatStatementsE.

Xaris333 (talkcontribs)

OK. Thanks again for your help!

Xaris333 (talkcontribs)

Hello. In a template we have

| data4 = {{{founded|{{Wikidata|P571|showsource=true|}}}}}

which fetch the foundation date from wikidata. Is it possible to automatic the template to use the data of the wikidata as parameters of the template w:en:Template:Start date and age (the Greek version)?

Matěj Suchánek (talkcontribs)

Personally I don't like when modules provide parameters to templates or even call them. Ideally, the module would use another one which calculates the time.

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

I guess you would like to have it displayed at the very end of the reference. Could you explain where the language names come from and whether Wikidata labels would be sufficient?

Xaris333 (talkcontribs)

They should be on brackets after the title.

The languages names came from properties P2439, P364, P407 as you have added them to the module.

Matěj Suchánek (talkcontribs)

I see the properties but I asked about the names themselves. In Czech, we would prefer "(in English)" over "(English)", that's why I'm asking (again).

Xaris333 (talkcontribs)

I am sorry. If you don't want me to bother you with so many things, just tell it and I will stop :)

I think is better to be "(Αγγλική Γλώσσα)"

"Αγγλική Γλώσσα" is the Greek label of English (Q1860). We have to many grammatical rules in Greek Language. It's better to only have the name of the language.

Matěj Suchánek (talkcontribs)

No, that's just ok. If a wiki wants to fetch information from Wikidata, it's my pleasure to help. I'm not a superhuman who knows everything, though, there comes your turn to tell me all details you can in order to make it quick.

Ok, if present, langauges should now always be shown in the reference.

You can also try to update your Module:Wikidata with the newest version from the local one (when overwriting, don't forget that we have overriden the way references are shown).

Xaris333 (talkcontribs)

Ok. Thanks. I have updated it.

One more thing: I have asked to Project Chat also. Is there a way to duplicate a reference from one item to another one? Not within the same item, but with 2 different items.

Matěj Suchánek (talkcontribs)

I don't know of any, sorry. But you could try using QuickStatements (version 2) or Pywikibot.

Xaris333 (talkcontribs)

Hello. I have created w:el:Module:Αριθμόςταχυδρομικώνκωδικών using w:el:Module:Αριθμόςσταδίων. Is not working. It is show 0. See w:el:Δήμος Λεμεσού at "Ταχυδρομικός κώδικας".

Also, 1) Is there a way, if the number is less than 5, to show the values, not the amount of them? 2) Is there a way, if the number is more than 5 so the module it will show the amount of them, to show the number and after that to show always the words "ταχυδρομικοί κωδικοί"? 3) If we can have the second, if there a way to have a list under the number with the list of all the values? (A hidden list).

Matěj Suchánek (talkcontribs)

Fixed the problem with numbers (please confirm, just in case). 1-3) are definitely possible but shouldn't be done by a module called "number of postal codes".

Xaris333 (talkcontribs)

Thanks. I would find a better solution for the others.

Xaris333 (talkcontribs)

Hello. Can you change w:el:Module:Απογραφήπληθυσμού that can only show the qualifier P459 if the statement P1082 is completed (and ofcourse has that qualifier). The qualifier only have an item and I want to show the Greek label of that item.

Its ok. I found a solution!

Xaris333 (talkcontribs)

Hello. Just asking if you have the knowledge to help me use the french template fr:Modèle:Infobox Localité in Greek Wiki. I know is very difficult.

Matěj Suchánek (talkcontribs)

From what I can see, the template uses w:fr:Module:Infobox, which requires w:fr:Module:Infobox/Localité, and both modules require a lot of specific modules. I wonder whether this is what you want to undergo. And I haven't mentioned the language yet. Maybe you want to use some more user-friendly syntax like some {{Infobox}} template invoking module Wikidata.

Xaris333 (talkcontribs)

Yes, you are right. Thanks!

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

I haven't been investigating it much but I think it's because of {{#if:{{{σημαία|}}}|[[File:{{{σημαία|{{Wikidata|P41|rank=best}}}}}|. In order to reach Wikidata, the parameter needs to be empty. But if it's empty, #if: skips the image. It's the same problem with the second property.

Xaris333 (talkcontribs)

I have done this change but still not working.

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

Its working now but the images are one above the other. They were better before when they were a group of 4 images. Any others solutions?

Matěj Suchánek (talkcontribs)

You can make a table inside a data# = parameter like:

{{#if: img1 img2 img3 img4 |
<table style="width:100%">
 <tr>
  {{#if: img1 | <td> img1 </td> }}
  {{#if: img2 | <td> img2 </td> }}
  {{#if: img3 | <td> img3 </td> }}
  {{#if: img4 | <td> img4 </td> }}
 </tr>
</table>
}}
Xaris333 (talkcontribs)

Not working with wikidata. And with parameters is really a mess.

Matěj Suchánek (talkcontribs)

You forgot <td>.

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

You must include {{Wikidata|...}} in all relevant #if:s.

Xaris333 (talkcontribs)

Like this ?

Matěj Suchánek (talkcontribs)

Taken a second look. You should do this in the parent #if:. What you've done here is wrong, given that you are already handling Wikidata if the parameter is empty.

Xaris333 (talkcontribs)

Thanks. Is one above the other, but what to do... Never mind.

Another problem I have is with the km² and the m. Is working fine with the parameters. But with the wikidata is problematic because already has the meter unit in the format "Τετραγωνικό χιλιόμετρο" (Greek words for km²). So I have "14.504 Τετραγωνικό χιλιόμετρο km²"? What can be done? I prefer to have 14.504 km².

Matěj Suchánek (talkcontribs)

At first, you need to append the unit from inside the template only to the local value. You shouldn't do this with the Wikidata value as it can have an arbitrary unit. Then, you have to modify the module to show the symbol if it exists. A really complex task would be conversion from arbitrary units to km².

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

Thanks! Can the symbol have link in wikipedia? Xaris333 (talk) 19:38, 16 April 2017 (UTC)

Matěj Suchánek (talkcontribs)

Of course, done.

Xaris333 (talkcontribs)

Thanks. I have again problem with the images. w:el:Πρότυπο:Διοικητική Διαίρεση (Κύπρος). We want the images to be: 1) an image of the place (image), 2) location map, 3) an image with the place located in the administrative territorial entity (image 2). The emblem, flag, shield and seal (Σημαία, Σφραγίδα, Ασπίδα και Έμβλημα) can be after that. And all of those parameters to works also with wikidata properties. Now they are working. The problem is that I can't change their order without have other problems. Can you solve this? (If it is too difficult, its ok, you have already help me a lot.) Xaris333 (talk) 12:41, 17 April 2017 (UTC)

Matěj Suchánek (talkcontribs)

I don't understand. Is really the problem that you can change their order?

Xaris333 (talkcontribs)

Sorry about my English. I can't change their order without have other problems. My abilities have limits :)

Matěj Suchánek (talkcontribs)

And what is the desired order? If I understand you correctly, you'd like to reorder the smaller images.

Xaris333 (talkcontribs)

The order are:

1) image of the place: now the parameter is εικόνα1. (Wikidata: image (P18))

2) location map: under the <!-- ***Χάρτης*** --> (using coordinate location (P625))

3) image-map of the the place located in the administrative territorial entity: now the parameter is εικόνα χάρτη τοποθεσίας. (Wikidata: locator map image (P242))

4) the 4 symbols (smaller images). Don't care about their order. (Wikidata: flag image (P41),seal image (P158), coat of arms image (P94)) The fourth one does not have wikidata property.

Matěj Suchánek (talkcontribs)

If you wanted me to help you move the loc. map between the main image and the imagemap, then I think I found the problem. The template "Πλαίσιο πληροφοριών" has fixed order: images are first and then go data with labels. So if you have the loc. map as a data (data6), it cannot be above any of the two images. I'm not sure how it may be fixed. Perhaps you need to move loc. map to image2 and image2 to image3 (if it's supported).

Xaris333 (talkcontribs)

Ok. Thanks. Don't bother. Maybe a Greek user who knows how templates works find a solution. I need your help with fetching data for wikidata more.

Xaris333 (talkcontribs)

One other thing I want help with is that: I want a module to:

1) show official name (P1448) only if the language is not Greek.

2) and if is not Greek then must show the official name with the language code like London (en) or en (London). Ok, if you can't do that, the first one is enough.

Matěj Suchánek (talkcontribs)
  1. This will propably need own module.
  2. The module has showlang=true, which I mentioned far above but you say it doesn't work..
Xaris333 (talkcontribs)

1. a. {{Wikidata|P1448|rank=best|showsource=true|isinlanguage=el}}

With this can only show the data if the language is Greek. We don't have option for the opposite? 

2. w:el:Module:Επίσημηονομασίασεξένηγλώσσα I have tried for a previous module you made to create it. I have tried to create a module that shows only the el statement and then to change it to the opposite. I could't make it :)

2. It doesn't work. But may be this can be added to the module.

Xaris333 (talkcontribs)

Thanks.

el:Module:ΕλληνικήΕτικέτα. Can you correct this? I want the module to check the item (at the wikidata) of the article and just to give the label. If there is no label in Greek, to give the link for el.wikipedia (always there will be a link of el.wikipedia for the template I am going to use it). Just this.

Xaris333 (talkcontribs)

Thanks. But if there is no Greek label, is showing the English label. If there is no label at any language, is showing error.

Matěj Suchánek (talkcontribs)

Oh yes, I forgot. If you use it like {{#invoke:ΕλληνικήΕτικέτα|getLabel|Q123}}, it should work without problems.

Xaris333 (talkcontribs)

But I don't want to write Q123. The module is using by a template. It must always show the Qitem of the articles that the template is using in.

Matěj Suchánek (talkcontribs)

Fixed, I assumed the id provided by the parameters should be used because it had been in the module before.

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

Oh yes again, it didn't make sense what I'd done. We don't have to fetch the sitelink (that confused me) but just can use the page title.

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

Should be better now. Don't hesitate to report any problems with this.

Xaris333 (talkcontribs)

w:el:Module:Επίσημηονομασίασεξένηγλώσσα You have helped me with this module. It works, but only if there is a name in one official language. Is not working if there are two or more official language. See . I have add three official language. The first one is Greek so correctly is not show it. The other two are not Greek. But only the next one (the first after Greek one) is showing. Also, I have checked it and if there are many official languages and one of them is preferred, is not showing the preferred one but always the first one. (I know that users are using wrong the property official language putting a lot of languages in an item that are not official).

Matěj Suchánek (talkcontribs)

Is it working now?

Xaris333 (talkcontribs)

Yes. Thank you very much.

We have discuss the issue before, but why we can't change the module to show the language code as well? "Akapnou (en) και Akapnia (it)". May be using something like return statement.mainsnak.datavalue.value.language to the above module?

Xaris333 (talkcontribs)

Thanks. Last request. If there is not a value in official language property, we get an error.

Matěj Suchánek (talkcontribs)

Fixed.

Xaris333 (talkcontribs)

Many thanks!