ropensci / emld

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

`as_emld` bug? #24

Closed isteves closed 6 years ago

isteves commented 6 years ago

The bug seems to have something to do with the context part of as_emld. I think this code used to work, but it doesn't anymore. Within eml_get, it looks good up until the last step, when robj is passed back into as_emld.

eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice")
eml <- eml2::read_eml(eml_path)
eml2::eml_get(eml, "physical")
#> {}
cboettig commented 6 years ago

Good catch, thanks! Just pushed a quick edit I think should fix it.

I did adjust as_emld.list method to always include a context (even though the print method hides the context part), since it is still technically part of any EML object and losing it can create trouble, as it did in https://github.com/cboettig/eml2/issues/15). However, the add_context function didn't handle this particular case, so now it does.

should fix the above code, we'll see what travis thinks...