User talk:Matěj Suchánek

Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL
Dcljr (talkcontribs)

At Wikidata:Project chat, we said:

Many pages, including things like Berlin Hauptbahnhof (Q1097) and .NET Framework (Q5289), are linked directly to Wikidata (Q2013), apparently through references on certain properties that say they are "imported from Wikidata". Is this legit? Should a Wikidata item be allowed to cite Wikidata as a source? - dcljr (talk) 06:52, 24 August 2017 (UTC)
These references should be replaced using inferred from (P3452). I have got an approval for my bot to clean up this kind of sourcing, I could also take a look at those. Matěj Suchánek (talk) 07:10, 24 August 2017 (UTC)
[…]

Since this exchange has now been archived, I just wanted to remind you about it and ask: is there any progress on this? You have decided what, if anything, should be done?

Matěj Suchánek (talkcontribs)

Thanks for your reminder. There hasn't been any progress yet because my bot was completely occupied with another (major) task... until yesterday (yes, it took months). So now I will try to focus on this one. I will notify you about my progress here later.

Dcljr (talkcontribs)

Note that the English description of corresponding Wikidata item (Q20651139) still recommends the incorrect usage. I'll let you change it, since you're much more familiar with these things.

Matěj Suchánek (talkcontribs)

I'm currently testing my bot.

Reply to "Pages that link to Wikidata (Q2013)"
Tozibb (talkcontribs)

Hi Matěj Suchánek,

thanks for your reply to me question concerning changeRank() on the project page. I would like to ask you if you could give me the code you used to change the rank? Either link to some repo, https://pastebin.com/ or posting it here/my talk page/project page would be helpful.

Thank you!

Matěj Suchánek (talkcontribs)
import pywikibot
repo = pywikibot.Site('wikidata', 'wikidata')
sandbox = pywikibot.ItemPage(repo, 'Q4115189')
claim = pywikibot.Claim(repo, 'P369')
claim.setTarget(pywikibot.ItemPage(repo, 'Q1'))
sandbox.addClaim(claim)
claim.changeRank('preferred')
Tozibb (talkcontribs)

It works now, thank you! I had to change the order of my calls though, which makes me wonder... My original attempt was to first add the 'point in time" source then set the claim to 'preferred' - which failed for some reason.

item.addClaim(alexa_ranking_claim, summary=u'Updating Alexa ranking')#1st
retrieved_source = _get_point_in_time_source()
alexa_ranking_claim.addSources([retrieved_source], summary=u'Adding retrieve date.')#2nd
alexa_ranking_claim.changeRank('preferred')#3rd

When changing the the execution order to set the rank to 'preferred' and then adding the sources the call works fine, i.e. no error and both the new ranking as well as the point in time source are taken in consideration

item.addClaim(alexa_ranking_claim, summary=u'Updating Alexa ranking')#1st
alexa_ranking_claim.changeRank('preferred')#3rd
retrieved_source = _get_point_in_time_source()
alexa_ranking_claim.addSources([retrieved_source], summary=u'Adding retrieve date.')2nd

Anyway - thanks again for your help! --Tozibb (talk) 18:56, 16 October 2017 (UTC)

Matěj Suchánek (talkcontribs)

This is interesting. I tried your code and found the problem.

When you construct the source inside _get_point_in_time_source(), you are probably not setting isReference=True via constructor (I did niether while testing). This is not problem when attaching it to a claim as a reference (ie. addSources). However, now the rank can only be changed by serializing the whole claim. When this happens, your reference gets serialized as well. The parent claim "thinks" it's a reference but the reference disagress. So the script fails.

Reply to "pywikibot / changeRank - example"
Base (talkcontribs)

Whoops, sorry. Wikidata:Ana Səhifə redirected me there, I didn't notice it is actually the very main Main page as it has the top line where the respective text would be hidden :/ --Base (talk) 20:53, 13 October 2017 (UTC)

Matěj Suchánek (talkcontribs)

To err is human, I think it didn't even have any impact...

Reply to "Main page content lang"
Evad37 (talkcontribs)

Hi, can you fix up Wikidata:Tools/User scripts with translation marking? Thanks

Matěj Suchánek (talkcontribs)

Will take a look. You can also use WD:Translators' noticeboard, which has a broader audience.

Reply to "Translation"

Edit filter for merging items into higher-number items?

4
Jon Harald Søby (talkcontribs)

Hello, Mr. Edit Filter. 😉

For some reason, when users merge items by using the "Add link" functionality in Wikipedia, some times the item with the lower Q number gets merged into the one with a higher Q number. Case in point. It is not the user's fault, they did nothing wrong, but the policy is to generally merge to the lower-ID item unless much more usage of the higher-number item warrants the opposite. So my question for you is: would it be possible to make an edit filter to check for this and tag the relevant edits?

Matěj Suchánek (talkcontribs)

No (explanation). I don't even recognize what you state a policy.

Hello, Mr. Edit Filter.

Please, be serious and spare this.

Jon Harald Søby (talkcontribs)

I realize it's not a proper policy (yet, anyways), but Help:Merge#Select recipient item says "When in doubt, it's best to choose the item with the lowest Q####, as it will be the older item" (before that stating that the most-used item is preferred, but if the two items are on equal terms the lowest one should be chosen).

And sorry for trying to be friendly, I only said that because you are the number 1 expert at Wikidata edit filters. Won't do it again.

Anyways, thanks for the explanation. If it becomes possible in the future, I think it would be worth considering, but I understand it's not technically possible at the moment.

Matěj Suchánek (talkcontribs)

If it becomes possible in the future... – to provide the best clarification, this was possible long time ago (hence no longer).

It is nice that you wanted to be friendly but honestly, it didn't sound well on my side. So let's just forget and continue in building the best project ever started ;)

Reply to "Edit filter for merging items into higher-number items?"

thoughts about adaptation to moveclaim script

2
Billinghurst (talkcontribs)

@hsarrazin and I were talking in IRC about some of the maintenance work that we do for the Wikisource works. We often need to split apart items as they are different language editions (so separate). To move the interwikilink means that we have to create the target item first, then come back and do the other work of moving components. We were wondering whether there could be scope to move an interwiki to a new item as an option, and then we could move/copy other needed components, eg. "edition or translation of" to the item more easily.

Matěj Suchánek (talkcontribs)

Something like CREATE and LAST keywords, I suppose. I think I have already had this in my mind. I will try to implement this soon to both gadgets.

Reply to "thoughts about adaptation to moveclaim script"
Freakymovie (talkcontribs)

Thank you for the message on my page. I use now language of work or name (P407).

Matěj Suchánek (talkcontribs)

Fine, thank you.

Reply to "message on my page"
Draceane (talkcontribs)

Ahoj, zvládl bys robotické doplnění popisu přirozených čísel? Netuším rozsah, kam až jdou – tipoval bych do 10 000 – tzn. vložit popis = „přirozené číslo“.

Matěj Suchánek (talkcontribs)

Já bych to zvládl... ale rozhraní neustále odpovídá error error. Ještě se na to podívám.

Matěj Suchánek (talkcontribs)

Tak už to funguje, někdy v noci to bude hotové.

Reply to "Robotické doplnění popisů"
Hsarrazin (talkcontribs)

Hi,

Those dates you reverted were wrong or vandalized infoboxes on enwiki, that could then be corrected... which is good !

I hope there are not too many... but it's also a way of contributing to global quality, by correcting erroneous articles on wp projects ;)

Matěj Suchánek (talkcontribs)

Contributing to global quality is really awesome. If only this could be done only from a single place...

Hsarrazin (talkcontribs)

yep :)

Reply to "Thanks for recent reverts :)"
MisterSynergy (talkcontribs)

Regarding :

Do you think we can delete Module:ConstraintCheck as well? @Jura1 is offline since I gave them the possibility to object my suggestion to delete it in context of this discussion. However, I am not that familiar with Modules and how their use can best be tracked, and also the module does not have any documentation.

Matěj Suchánek (talkcontribs)

WhatLinksHere and This site-wide search suggest that the module is unused. I'm not saying we should delete it speedily but it doesn't have any purpose at the moment.

MisterSynergy (talkcontribs)

That was my impression as well. Let’s see whether Jura1 could help. I don’t like having unused, undocumented code around…

Jura1 (talkcontribs)

I think if you don't delete the underlying template, you should keep this.

Otherwise you could move it into my user space (User:Jura1/)

Reply to "Module:ConstraintCheck"