| Lucas_Werkmeister_WMDE created this task. Lucas_Werkmeister_WMDE added projects: Wikidata, Wikibase-Quality, Wikibase-Quality-Constraints. Herald added a subscriber: Aklapper. |
TASK DESCRIPTION
On Wikidata, people are getting Range violations on every “date of death” statement, with the message that the constraint is missing required parameters. (The message isn’t localized, but that’s unrelated and already fixed.)
I think I know what’s happening: the RangeChecker expects the parameters minimum_quantity and maximum_quantity when checking a data value of type quantity, but parameters minimum_date and maximum_date when checking a data value of type time. However, in the template the parameter is always min/max:
<!-- on P2047: duration --> {{Constraint:Range|min=0|max=1000000000|mandatory=true}} <!-- on P570: date of death --> {{Constraint:Range|min=-5000|max=now}}
And the ConstraintsFromTemplates importer always maps those keys to minimum_quantity/maximum_quantity:
def add_max(self, values): self.parameters['maximum_quantity'] = values.strip() def add_min(self, values): self.parameters['minimum_quantity'] = values.strip() # ... call_method = { # ... 'max' : add_max, 'min' : add_min, # ... }I’m not sure what to do here.
- Keep the separation in the RangeChecker, and update the importer to detect the right parameters to use (based on the property data type)? Might be difficult (doesn’t seem to fit well with the call_method model – we need to somehow propagate the property data type to a function that currently doesn’t take any additional parameters).
- Update RangeChecker to always look for minimum_quantity/maximum_quantity, regardless of data value type? But then we’d be storing dates in _quantity fields, which is ugly.
- Update RangeChecker to always look for the same names, but generalize them to minimum and maximum to indicate that they’re not necessarily quantities? But that might require some migration on the existing constraints database (as well as a change to the importer, albeit a very simple one).
- Other ideas?
TASK DETAIL
EMAIL PREFERENCES
To: Lucas_Werkmeister_WMDE
Cc: Jonas, Lucas_Werkmeister_WMDE, Aklapper, QZanden, Izno, abian, Wikidata-bugs, aude, Mbch331
Cc: Jonas, Lucas_Werkmeister_WMDE, Aklapper, QZanden, Izno, abian, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
