Page MenuHomePhabricator

Allowed Units Constraint: accept class (P2308) and relation (P2309) as qualifiers instead of item of property constraint (P2305)
Open, Needs TriagePublic

Description

According to https://github.com/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/blob/master/src/ConstraintCheck/Checker/AllowedUnitsChecker.php and T164372, the current allowed units constraint was implemented to accept item of property constraint (P-2305) as a qualifier, with some logic to allow derived units to also be accepted.

For constraints on properties such as budget (P-2769), cost (P-2130) and length (P-2043), there is likely dozens or hundreds of units that would be acceptable, most which are not derived from each other. This is particularly true for currencies where there is no constant conversion between different currencies (it depends on the time dimension too).

Allowing the use of class (P-2308) and relation (P-2309) as qualifiers to the allowed units constraint would cover the current use case (just specify class=specific unit, relation=instance of) as well as the added ability to allow a whole class of currencies or units.

Event Timeline

Dhx1 created this task.Apr 22 2018, 1:28 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 22 2018, 1:28 AM
Restricted Application added a project: Wikidata. · View Herald TranscriptApr 22 2018, 10:20 AM

As far as I’m aware, {{Constraint:Units}} has never supported “class” and “relation” parameters, so this would be a new feature not only for WikibaseQualityConstraints but also for KrBot.