Coder Social home page Coder Social logo

Comments (8)

aurielfournier avatar aurielfournier commented on July 21, 2024 2

units package

https://cran.r-project.org/web/packages/units/index.html

from dataspice.

annakrystalli avatar annakrystalli commented on July 21, 2024 1

I guess it depends on whether we want to conform with the schema.org unit definition property of variableMeasured.

The unitCode property requires adherance to the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.

But:
a) we are not using unitCode property
b) there is no obvious link to definitive information on UN/CEFACT unit definitions

unitText which we are using, requires text indicating the unit of measurement and is suggested as useful if you cannot provide a standard unit code forΒ unitCode. Given this I'm not sure
which standard we should suggest adhering to in dataspice. UN/CEFACT seems to be geared towards commerce. Perhaps ISO (as per eml2 unit definition) would be more appropriate for our purposes?

Any opinions?

from dataspice.

khondula avatar khondula commented on July 21, 2024 1

Some other specifications I've come across for my work with ODM2 units

from dataspice.

cboettig avatar cboettig commented on July 21, 2024 1

The units package in R is based on the Unidata units, which include all SI units. I agree that Unidata units are probably a much better choice for us than schema's UN/CEFACT codes. The schema definition for unit code does suggest that you can use other unit codes if you provide a prefix, but this seems not ideal to me (1. not sure what the unidata prefix would be, and 2., most users would find unidata:m a more confusing unit than m.) I think we should stick with unitText, but we should warn if units::as_units() does not recognize the unit?

We could go a step further in using units::as_units to attempt to convert the provided text into a standard form, i.e. units package recognizes these are all the same units:

library(units)
as_units("Meter/sec") 
as_units("m/s") 
as_units("meter / Second") 
as_units("meter * seconds / Second ^ 2") 

EML units are based on the older STMML standard, which I believe isn't really used by projects other than EML now(?).

from dataspice.

amoeba avatar amoeba commented on July 21, 2024 1

Oh as_units is super nice. For match failures I bet we could do a string distance comparison to the controlled list and suggest a few candidates too which might be nice.

from dataspice.

amoeba avatar amoeba commented on July 21, 2024

Had a good question in my dataspice demo at NCEAS today that prompted me to think more about this. Could we maybe even warn the user if their unit isn't in a controlled vocabulary? This pushes dataspice further into the territory of metadata quality which I don't think is a bad idea.

from dataspice.

annakrystalli avatar annakrystalli commented on July 21, 2024

Sorry, error, I meant mainly based on SI units in EML

from dataspice.

annakrystalli avatar annakrystalli commented on July 21, 2024

as_units looks great indeed. Maybe we could integrate using units::as_units() to complete the unitText attributes.csv column in the edit_attributes shiny app? πŸ˜ƒ

from dataspice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.