ropensci / emld

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

support as_emld.raw, closes #19, #20 #23

Closed cboettig closed 6 years ago

cboettig commented 6 years ago

@isteves Here's a quick re-take on your PR that should be compatible with JSON and XML raw vectors by being explicit about the input type with an additional from argument. If no type is given, will attempt xml parsing with a warning.

isteves commented 6 years ago

Great, I'm excited to give it a try!

isteves commented 6 years ago

I wonder if the from argument should also be added to read_eml? https://github.com/cboettig/eml2/blob/master/R/read_eml.R (or at least passed in with ...)

cboettig commented 6 years ago

@isteves oh, good catch, we should definitely expose from there, probably directly rather than with ... so that it's documented. want to PR eml2 for that?

Should probably check if there's anywhere we're calling as_emld internally in eml2 code other than read_eml that should also consider being explicit in this argument.

isteves commented 6 years ago

@cboettig will do! Looking through eml2, it looks like you've used in some of the set_ functions with list/vector inputs, which I think should be unaffected. I see it also in eml_get. The cases when you'd want a from argument here would be pretty rare (if at all), but it might be worth adding in.