Page MenuHomePhabricator

Configure conversion for all units that have a conversion factor to SI units defined
Closed, ResolvedPublic

Description

After experimenting with unit conversion for a while, it seems we can now add conversion for all units that have an appropriate conversion factor defined.

Caveat: sanity check the size of the resulting conversion table. If it is too big, we need to drop rarely used units.

Event Timeline

Smalyshev renamed this task from Configure coonversion for all units that have a conversion factor to CI units defined to Configure conversion for all units that have a conversion factor to CI units defined.Jun 22 2017, 12:27 AM
Smalyshev renamed this task from Configure conversion for all units that have a conversion factor to CI units defined to Configure conversion for all units that have a conversion factor to SI units defined.
Smalyshev updated the task description. (Show Details)
Smalyshev triaged this task as Medium priority.Jun 29 2017, 10:42 PM

My check shows 197 units which are derived from Q47574 (unit of measurement) and have SI conversion and are used.
415 units without usage check. Another 8 items that have SI conversion but not marked as unit of measurement - probably mistakes. I think it's OK size-wise.

Other issues:

  1. We have about 40 units having no English labels. While there's no need for it for conversion, we store it in config for human-readability. What is the best course of action here (I could add labels maybe but in general what we do with such ones)?
  1. We have Q8799 (byte) and derived units. They are not, strictly speaking, SI units. But they are standard units. Should we include them?

Change 362606 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[operations/mediawiki-config@master] Add more units for conversion

https://gerrit.wikimedia.org/r/362606

Side note of something that occurred to me when looking at the patch:

We should consider preserving the uncertainty of the conversion factor. This would allow use to support conversion e.g. for historical units for which only an approximate conversion factor exists.

We should consider preserving the uncertainty of the conversion factor.

Should be possible, but given how dirty the precision data on actual values are, due to automatic assigns etc. - not sure if we're ready for it yet - i.e whether these intervals would provide actually something useful. I don't know too much though about how people use this, so would appreciate some feedback from somebody who actually uses these intervals.

Change 362606 merged by jenkins-bot:
[operations/mediawiki-config@master] Add more units for conversion

https://gerrit.wikimedia.org/r/362606

Mentioned in SAL (#wikimedia-operations) [2017-07-24T18:11:08Z] <reedy@tin> Synchronized wmf-config/unitConversionConfig.json: T168582 (duration: 00m 43s)

@Lea_Lacroix_WMDE @Lydia_Pintscher This is live now, and can be announced: all units that had a conversion factor defined on July 1st now support unit conversion. This is not highly visible, since we currently only use unit conversion for RDF export. But it means that you can now specify a length in nautical miles (Q93318), and you will be able to find it with a query for things longer than x meters.

I added a length in nautical miles to the sandbox item, see https://www.wikidata.org/wiki/Special:EntityData/Q4115189.ttl?oldid=525352158. In the RDF output, find wds:Q4115189-a4ad667a-4650-bd42-2fee-b8cfd828d70c and wdv:3c7c33b76fdc13deec2e26fc274f4963.

I'd really love to show unit conversion in the edit preview for quantities, and warn if it's not supported...