Page MenuHomePhabricator

[M] Units support for quantity datatype
Open, Needs TriagePublic

Description

We have this:
When entering data for a qualifier whose property has a data type of "quantity", the user can't enter units for the quantity, only a number.
In wikidata the user can enter the number and the units - e.g. if the statement is 'length' they can add the value for length plus 'metres', 'inches', etc.

We want this:
We want to support units for those quantity values, so we can have statements about, for example, the dimensions of an image

Examples:
A quantity can be population, maximum capacity, floors above ground, and numeric value, or others (see full list of Wikidata properties that use the quantity data type).

Acceptance Criteria:

  • can enter units for the quantity values
    • via File page
    • via UploadWizard

Event Timeline

Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptNov 29 2019, 1:36 PM

Here's a question – where do the units come from? Are we using a hard-coded list, or somehow fetching a list of appropriate units based on the property? Units will also be property-specific (a "length" property will have different units from a "weight" property).

How does Wikidata handle this?

egardner renamed this task from Units support for quantity datatype to [Medium] Units support for quantity datatype.Dec 10 2019, 5:36 PM
egardner renamed this task from [Medium] Units support for quantity datatype to [M] Units support for quantity datatype.

Here's a question – where do the units come from? Are we using a hard-coded list, or somehow fetching a list of appropriate units based on the property? Units will also be property-specific (a "length" property will have different units from a "weight" property).
How does Wikidata handle this?

Wikidata. You can put in centimeter or Cameroon

Any news on this? We just created https://www.wikidata.org/wiki/Property:P7787 to indicate the heading the photographer was looking when taking the image. The unit would be degree (http://www.wikidata.org/entity/Q28390). Currently can't use that, just without a unit, see for example https://commons.wikimedia.org/w/index.php?title=File:%D0%A1h%C3%A2teau_d%27Amboise_4.jpg&diff=prev&oldid=387384011

This is work that will be coming up soon. Best estimate for deployment is early Feb., but it could be earlier if things work out. We're a bit short-handed at the moment.

@matthiasmullie what am I doing wrong at /w/api.php?action=wbeditentity&format=json&id=M51867633&token=123445678903dd2%2B%5C&data=%7B%22claims%22%3A%5B%7B%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P7787%22%2C%22datavalue%22%3A%7B%22value%22%3A%20%7B%22amount%22%20%3A%20%22%2B67%22%2C%20%22unit%22%20%3A%20%22http%3A%2F%2Fwww.wikidata.org%2Fentity%2FQ28390%22%7D%2C%22type%22%3A%22quantity%22%7D%7D%2C%22type%22%3A%22statement%22%2C%22rank%22%3A%22normal%22%7D%5D%7D ?