Page MenuHomePhabricator

Basic support for units in quantity datatype
Closed, ResolvedPublic

Description

  • 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

Details

Reference
bz63722

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).
Fale added a comment.Oct 5 2014, 2:43 PM

Is there any news on this?

Update: We plan to enable it without conversion on test.wikidata.org 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.

Snipre added a subscriber: Snipre.Nov 29 2014, 11:53 AM
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.

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

Patch-For-Review

Stryn added a subscriber: Stryn.Dec 8 2014, 10:42 PM
daniel added a subscriber: daniel.Dec 9 2014, 12:54 PM

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 updated the task description. (Show Details)Dec 11 2014, 10:46 AM
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.

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

Ainali added a subscriber: Ainali.Dec 16 2014, 8:53 PM
daniel closed this task as Resolved.Dec 18 2014, 5:55 PM
daniel claimed this task.
Snipre removed a subscriber: Snipre.Dec 19 2014, 5:25 PM