Units and scales (and currency) in Table Schema #992
Replies: 31 comments
-
Pint is a great Python library for units. http://pint.readthedocs.org/ |
Beta Was this translation helpful? Give feedback.
-
Thinking about this through the lens of a Fiscal Data Package profile, a Related: |
Beta Was this translation helpful? Give feedback.
-
@danfowler JTS already supports currency as a format on number: |
Beta Was this translation helpful? Give feedback.
-
@pwalsh i know - though I'm wondering if that was a good idea vs proper units. Note also we did not support "factor" ;-) |
Beta Was this translation helpful? Give feedback.
-
OK, I think we should introduce @danfowler could you take a quick look at QUDT and the units spec and see if you can identify any differences. |
Beta Was this translation helpful? Give feedback.
-
@rgrp I can take a look. |
Beta Was this translation helpful? Give feedback.
-
I would suggest handling currency separate from units of measure, but in the same overall framework along with controlled vocabularies and coordinate reference systems. These are all 'reference systems'. The special thing about currency is that conversion factors are time-dependent, and the changes are large. This does not apply to typical uom. There is also some time-dependency in both spatial and temporal coordinate systems due to (a) moving spatial datum dues to plate tectonics - yes this does matter in applications like precision agriculture; (b) leap seconds, though in both cases most users would not notice. |
Beta Was this translation helpful? Give feedback.
-
@rgrp @danfowler any progress here? @dr-shorthair great points. I'm wondering, though, if the conversion aspects you highlight are relevant for the spec itself (rather than relevant for potential applications of the spec). |
Beta Was this translation helpful? Give feedback.
-
Great discussion! Just wanted to chime in that I think this would be helpful for CSV columns as well :) |
Beta Was this translation helpful? Give feedback.
-
@rgrp do you want to move forward on this? |
Beta Was this translation helpful? Give feedback.
-
Would that look something like the following? "schema": {
"fields": [
{
"name": "Year",
"description": "Year",
"type": "date"
},
{
"name": "Total",
"description": "Total carbon emissions from fossil fuel consumption and cement production (million metric tons of C)",
"type": "number",
"unit": "Mt",
"unitSystem": "SI"
}
] […] |
Beta Was this translation helpful? Give feedback.
-
@rgieseke yes - that is correct. Your |
Beta Was this translation helpful? Give feedback.
-
@pwalsh next steps here would be:
|
Beta Was this translation helpful? Give feedback.
-
@rgrp Yes, sorry I mis-remembered |
Beta Was this translation helpful? Give feedback.
-
@rgieseke |
Beta Was this translation helpful? Give feedback.
-
@muehlenpfordt et al at Open Power System Data seem to have produced Data Packages with a |
Beta Was this translation helpful? Give feedback.
-
I also went with https://github.com/openclimatedata/global-carbon-budget/blob/master/datapackage.json#L59 I think the main use case is to easily read in a data set and apply a unit transformation, e.g. for comparison with another dataset. |
Beta Was this translation helpful? Give feedback.
-
For us, the use case is to clarify the unit of measurement, i.e. whether the numbers in the columns should be read as Megawatts `MW`, Kilowatts `kW`, Megawatthours `MWh`, etc. For the case of currencies, we will put `EURO` or `DKK` etc.
|
Beta Was this translation helpful? Give feedback.
-
@muehlenpfordt how do you indicate a currency unit? Do you have a specific prefix or ...? |
Beta Was this translation helpful? Give feedback.
-
I haven't implemented it yet, but I had thought putting
? That seems a bit redundant. On the other hand it might help considering the amount of different currencies. What do you think? I am open for you suggestions. |
Beta Was this translation helpful? Give feedback.
-
How about something like "unit": "EUR",
"unitSystem": "ISO-4217" |
Beta Was this translation helpful? Give feedback.
-
@rgieseke really like that approach. I think this is mature enough to become a pattern. I also think we may want to move the units draft spec http://specs.okfnlabs.org/units/ back to FD specs /cc @danfowler @pwalsh - now #537 |
Beta Was this translation helpful? Give feedback.
-
We have a use case for this in biotracks, see CellMigStandOrg/biotracks#9 |
Beta Was this translation helpful? Give feedback.
-
I have a question. Will there be any specified way of converting measurements from one unit to another? Say celsius to kelvin or fahrenheit. Or is this outside the scope of the spec? |
Beta Was this translation helpful? Give feedback.
-
@Kenji-K this would be outside of the spec - it would be something a tool would implement (but the spec could form the basis for that tool's API) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hey, is there still interest in this feature ? |
Beta Was this translation helpful? Give feedback.
-
Yes, also interested, to use it for Camtrap DP. Although one can of course expand the Frictionless Table Schema as they want (e.g. adding a |
Beta Was this translation helpful? Give feedback.
-
@yohanboniface yes a lot of interest. First start would be a detailed pattern. Note @Stephen-Gates had a go at that in #607 - we are really open to getting a pattern and then turning that into part of the spec. |
Beta Was this translation helpful? Give feedback.
-
Working with scientific data, we are very interested in having units implemented in the schema. For the string notation of the units, we use that from astropy. This allows simple conversion of units. This allows simple conversion of tabular quantity data into other units. I hope these aspects provide some useful information to improve the specs or even for the validation of scientific data in general. |
Beta Was this translation helpful? Give feedback.
-
STATUS:
Excellent discussion with @dr-shorthair today led me to consider importance of units and scales (and currency) in JSON Table Schema.
Suggest we could specific at
MAY
level:References
Beta Was this translation helpful? Give feedback.
All reactions