Page MenuHomePhabricator

Basic support for units in quantity datatype
Closed, ResolvedPublic


  • QuantityValue can hold a unit identifier
  • The DataType for quantities accepts URIs as units
  • It is possible to specify a unit URI for a quantity value in the API (wbeditentity, wbsetclaim, etc)

Out of scope:

  • UI widget for selecting units
  • localization of units
  • unit conversion

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:09 AM
bzimport set Reference to bz63722.
bzimport added a subscriber: Unknown Object (MLST).

Update: We plan to enable it without conversion on and then get feedback if we should roll it out without conversion initially or not. We still need to make a few changes for that though.

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

Change 177814 had a related patch set uploaded (by Daniel Kinzler):
Allow units to be specified for quantity values.


Result of some discussion with Thiemo and Katie:

  • Units are represented as URIs (hashed or truncated for SimpleQuery indexing)
  • Per default (and on Wikidata), they should be Wikidata Item URIs (needs Validator).
  • Choices may or may not be limited to a fixed list
  • when parsing units directly from an input string, the full URI must be given.

Outside the scope of this task:

  • Units are selected using an EntitySelector (with a special option for "none"). The selected unit is passed as an option (using the same hack we use for Globe and Calendar).
  • Units are formatted (localized) using item labels. To provide a short form, these may be overwritten using message keys based on item IDs, e.g. something like wikibase-unit-symbol-Q828224, which would e.g. be "km" for English and "Км" for Russian. These could be populated from "unit symbol" statements on the respective item.
daniel set Security to None.
Lydia_Pintscher renamed this task from Support units in quantity datatype to Basic support for units in quantity datatype.Dec 11 2014, 11:18 AM

Change 177814 merged by jenkins-bot:
Allow units to be specified for quantity values.

daniel claimed this task.