Page MenuHomePhabricator

Add validation for units, calendar models and globes.
Open, MediumPublic

Description

Discussed in T167565: Wikidata allows invalid URIs to be entered as units
An example invalid unit being added on wikidata can be seen, https://www.wikidata.org/w/index.php?title=Q420481&diff=prev&oldid=494773425
So when units are entered there is currently not enough validation.

Calendar models and globes are currently controlled via a whitelist of values, currently all on wikidata.
For wikidata.org and default installs of wikibase this default whitelist should remain.

Units, calendar models and globes should allow the use of items from wikidata.
These would also take the form http://www.wikidata.org/entity/Q\d+

When a non wikidata wikibase is used both a valid wikidata item URI should be allowed, as well as an item on the local wikibase.
The validity of this URI could be checked using the base URI for concept URIs, https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/docs/options.wiki#L24

Acceptance criteria

  • A simple regex validator is applied for:
    • units
    • calendar models
    • globes
  • On Wikidata.org only wikidata.org items are allowed
  • On a non wikidata.org wikibase both wikidata and local items are allowed
  • Current whitelist for globes on wikidata.org continues to function
  • Current whitelist for calendar models on wikidata.org continues to function

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Lydia_Pintscher Should we just have default wikibases to have the validation turned off? (See TBA in description)

Addshore raised the priority of this task from Low to Medium.Nov 20 2019, 11:48 AM

@Lydia_Pintscher Should we just have default wikibases to have the validation turned off? (See TBA in description)

Intuitively I'd say we want checks there as well. What would be the implications? Why would you turn it off?

My only thought is they may not want to define things with units of globes based on Wikidata entities.
I could of course be wrong.
Or to be able to use units or globes not defined on Wikidata (more likely)

My only thought is they may not want to define things with units of globes based on Wikidata entities.
I could of course be wrong.
Or to be able to use units or globes not defined on Wikidata (more likely)

Yes. What I was thinking is that we don't make the check configurable but always allow Wikidata and the local instance.

My only thought is they may not want to define things with units of globes based on Wikidata entities.
I could of course be wrong.
Or to be able to use units or globes not defined on Wikidata (more likely)

Yes. What I was thinking is that we don't make the check configurable but always allow Wikidata and the local instance.

Sounds like a good solution!

Addshore renamed this task from Add configurable validation for units, calendar models and globes. to Add validation for units, calendar models and globes..Nov 27 2019, 9:55 AM
Addshore updated the task description. (Show Details)

@Lydia_Pintscher Updated the description.
Does the stuff about whitelists look good?
I guess we don't want a whitelist for these units?

@Arian_Bozorg this doesn’t feel like a tech task to us, do you want to prioritize it via product?

(I think the task description is a bit outdated – we can check in story writing – but there’s still some validation that should be done; in particular, we might want to restrict the calendar models to the two “well-known” ones rather than allowing any item.)

Yes of course, sorry I added the wrong tag