ropensci / emld

:package: JSON-LD representation of EML
https://docs.ropensci.org/emld
Other
13 stars 6 forks source link

Should `validate_units` be reworked to use the right version of the unitDictionary? #56

Closed amoeba closed 4 years ago

amoeba commented 4 years ago

@jeanetteclark ran into a situation earlier where she was working with an EML 2.1.1 doc but had her emld_db option set as eml-2.2.0.

As you can see below,

https://github.com/ropensci/emld/blob/4e6db62a55d59c1a184800b3a6841d0935eb25d1/R/eml_validate.R#L52

https://github.com/ropensci/emld/blob/4e6db62a55d59c1a184800b3a6841d0935eb25d1/R/validate_units.R#L15-L19

With the new machinery in place to automatically detect the appropriate EML schema to validate with from the input doc, this causes her 2.1.1 doc to have its units validated with the EML 2.2.0 unitDictionary.

I consider this just an oversight on my part and would be happy to change this behavior so that the version of the unitDictionary is dependent on the input document and not the global.

What do others think?

PS: eml_additional_validation is also not version-specific but I think the rules are backwards compatible so that's fine enough for now I think.

mobb commented 4 years ago

I agree - if its creating EML 2.2, it should be validating against the 2.2 unitDictionary. The one used today looks very much like EML 2.1

Current dictionary (EML 2.2): This file: https://github.com/NCEAS/eml/blob/master/eml-unitDictionary.xml

related to https://github.com/EDIorg/EMLassemblyline/issues/72#issuecomment-644456190 AssemblyLine is a wrapper for the R EML package.

amoeba commented 4 years ago

Thanks @mobb, and apologies about the outdated eml-unitDictionary. I've updated it in #60 to match the version we released with EML 2.2.0 and updated eml_validate to use the appropriate file when validating units. @cboettig could you please have a look?