Closed maelle closed 7 years ago
Good question, I'll have to dig into the error. But yes, there's https://github.com/ropensci/EML/blob/master/inst/xsd/test/eml-datasetWithUnits.xml
all those test files that start with eml-
are tested for basic roundtrip read/write/validate by https://github.com/ropensci/EML/blob/master/tests/testthat/test-testfiles.R, so that should at least give you a starting point.
I'd bet the problem here is probably the coercion for as(..., additionalMetadata)
needs to be updated for xml2....
Ok I'll have a look next week (working day almost over here :wink: )
In the example file the unitList starts by:
<additionalMetadata>
<metadata>
<stmml:unitList
In my file it starts by:
<additionalMetadata>
<unitList
I'll try to think of an easy example with unitList that'd be created from scratch in the tests, I guess it'd be useful (my own EML is huge).
Note, because I also suspect the problem is the coercion, and because I am not able to understand how to fix this, I'll stop investigating for now. :angel:
Test added (well I hope it'd be a valid one if not for the current bug... just replaced meters with terameters in the example EML from the creating EML vignette, and added a very small units data.frame with only id and unitType)
@cboettig you've now removed the test with an unit list? If so why?
Oops sorry I found it again @cboettig
So you solved this in https://github.com/ropensci/EML/commit/be0faa72d4eefa3a489fefc0860aa8df22d28aea
and I can validate my own EML, thanks a lot!! Well I guess you knew you had fixed it when the test started passing. :grin:
Is there a test of EML validation when the EML has an unitList? I couldn't find one.
I had an EML that used to get TRUE from
eml_validate
. I created it this way:I've also tried to do something closer to the units vignette (but well it's really the same?)
cc @carlesmila