-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructors not speaking EML 2.2.0 #287
Comments
Maybe just the second options call on line 7 needs to be commented out so that 2.2.0 is set for the |
Yup, Matt's suggestion sounds good, though I'm not sure these constructors were ever quite as robust or convenient as you might want them to be. I have an experimental project over at https://github.com/cboettig/build.eml which tries to generate constructor functions for all complex types which are actually first class R package functions, with documentation etc. That project could use some more love but I think the basics should work at least as well as the built-in templates? Ultimately that does feel like a better way to go. (Of course this is also by scraping the XSD files, something that usually pushes me past the limits of my poor grasp of XPATH). ( |
I can't get Here is the traceback:
which leads me to think it is due to the |
I figured out a solution that just tosses the https://github.com/jeanetteclark/EML/tree/constructor_functions What I'm even less sure of is how we can support both the EML 2.2.0 and EML 2.1.1 versions of the constructor functions. Maybe an EML::eml_version() helper that will call |
@jeanetteclark thanks for this. I think the Yeah, we could probably cludge something together to let a user call Still, I think breaking out the constructor task into a separate package like I've tried to do in With better schema parsing, these docs could indicate better what is required vs optional, what is repeatable, and add some decent examples, but these first class functions are already better than the constructors tacked in here (in I suppose one could have two versions of the package, one for 2.2.0 and one for 2.1.1 if necessary. |
Partially addresses ropensci/EML#287 by changing emld_db to built off of the 2.2.0 JSON file. Removing the xml:lang attributes from the 2.2.0 JSON file is required because of how the templating function breaks when an argument with a colon is run through parse(). the xml:lang attribute can still be set on any EML element (list) manually. HT @jeanetteclark for a first pass impl of this: ropensci/EML#287 (comment).
Addresses ropensci#287. Note that dynamically switching the constructors based on version isn't supported here: We just have constructors for a single version (2.2.0) at a time. Note this depends on ropensci/emld#66 landing in master to work right because we build the constructors from the copy of the JSON file in master.
Just sent in two (dependent) PRs for EML (#308) and emld (ropensci/emld#66) to fix the |
Stevan Earl noted that the constructor functions don't seem to have arguments for the EML 2.2.0 element.
As an example, if you try
eml$project()
, you won't see anaward
argument.It looks like the args are just the EML 2.1.1 args. I checked the 2.2.0 database/JSON file and it looks good so it seems like the bug might somewhere like https://github.com/ropensci/EML/blob/master/data-raw/construct_complexTypes.R.
I do see this:
EML/data-raw/construct_complexTypes.R
Lines 6 to 7 in e4d8f9e
The text was updated successfully, but these errors were encountered: