Page MenuHomePhabricator

Fix updateUnits.php repo maintenance script
Closed, ResolvedPublic5 Estimated Story Points


The script currently generates a configuration which convert units like millimetre and centimetre to themselves (with a factor of 1) rather than to multiples of metre with the appropriate factor. Presumably something changed in the Wikidata data model, and we need to adjust the SPARQL queries in the script.

This can be tested locally, without production access – run php repo/maintenance/updateUnits.php --sparql and it’ll pull all its information from there.

Event Timeline

CBogen set the point value for this task to 5.Jan 4 2021, 4:43 PM

Hm, it looks like the script basically does the right thing if you call it differently: instead of --base-unit-types Q223662,Q208469 as the comment at the top of the script suggests (SI base unit, SI derived unit), use --base-unit-types Q69197847 (coherent SI unit).

That said, I think the script should still be updated to not use the term “base unit” when it actually means “coherent unit”.

Change 656955 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Update unit conversion script

Change 656955 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Update unit conversion script

Thanks for fixing the script and clarifying the wording.