derenrich / borked-bot

wikidata bot doing lots of disparate things
GNU General Public License v3.0
9 stars 2 forks source link

Add reason for preferred rank (P7452): most recent value (Q71533355) #6

Open louisroyer opened 2 years ago

louisroyer commented 2 years ago

Hi, it would be nice if update_most_recent_rank(item, prop_id, qual_id) could handle P7452 by:

  1. On statements with preferred rank and using this qualifier with something different than Q71533355, do not set the statement back to normal rank
  2. When statements are set to normal rank, removing this qualifier
  3. When statements are set to preferred rank, set this qualifier with value Q71533355 https://github.com/derenrich/borked-bot/blob/d91f21da20be1c504a1b0d5db2cd848850696552/borked_bot/util/util.py#L305-L331
derenrich commented 2 years ago

On statements with preferred rank and using this qualifier with something different than Q71533355, do not set the statement back to normal rank

should I set something else to preferred if this is the case (so that two statements are preferred)? or just totally bail out?

louisroyer commented 2 years ago

Here is a list of possible values for P7452. In the general case, I think it is not a problem to have 2 preferred statements as long as the value of P7452 is different, but I doubt that an value different from Q71533355 will ever be used on yt/tw follows. The best to do is probably to bail out to avoid unexpected behavior and create a maintenance list. Here is a query you can use for the list. As I am writting, there are 6 occurrences of reason for preferred rank with Q71538760. IMO, all of them are invalid uses because P459 is not set.