-
Notifications
You must be signed in to change notification settings - Fork 32
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
validating EML 2.2/schema location #292
Comments
Hi @, thanks for filing an issue. It looks like there are a few things going on. Re:
What error(s) does Oxygen report? I don't have a license over here to test with. Re:
XML validation is a pitfall-laden part of working with XML. The
This looks like a bug. @cboettig it looks like > library(EML)
> me <- list(individualName = list(givenName = "Carl", surName = "Boettiger"))
> my_eml <- list(dataset = list(
+ title = "A Minimal Valid EML Dataset",
+ creator = me,
+ contact = me)
+ )
> eml_validate(my_eml)
[1] FALSE
attr(,"errors")
[1] "Element '{https://eml.ecoinformatics.org/eml-2.2.0}eml': The attribute 'packageId' is required but missing."
[2] "Element '{https://eml.ecoinformatics.org/eml-2.2.0}eml': The attribute 'system' is required but missing." |
@amoeba - Oxygen error is (on line 2): |
@amoeba Thanks! That behavior was intentional, though maybe misguided.
Clearly in the list constructor has no mechanism to automatically generate a We could allow I agree it's a bit weird that it validates when you call Also, I know we've discussed the schemaLocation issue before and the potential security risk of using a resolvable URL as the schemaLocation instead of using the locally installed copy of the schema, but if it makes the EML we generate more compatible with other tools, perhaps we should use that as our default schemaLocation instead. IMO it's the security issue is more the responsibility of the user and the other external tools. Open to discussion as to whether this would mean that the R package use the local copy or the online copy to validate (we could at at least check hashes or something, though it's nice to be able to validate offline!) |
There are a couple of topics coming up here, so I will try to address them individually. Note: comments based on my experience with a subset of EML-builders who work with LTER and EDI. Those users typically pre-assign the packageId, and the PASTA system also checks schema validity. Sometimes we suggest commercial XML editors like Oxygen. Re validation within R in general, assigning packageIds: EML-builders should see the error; so I agree, this is misguided:
The temporary Re schemaLocation: IMO current behavior is fine -- the simple, local filename is a good choice for a default Some EML-builders will want to (a) use the OxygenXML editor or (b) point So bottom line(s):
|
@scelmendorf we're discussing a number of things now that don't directly help you out so I want to address your original issues first. To avoid the errors about my_eml <- list(packageId = "mypackage",
system = "mysystem",
dataset = list( # continued... And, as you found out, if you The second part of your issue, Oxygen not being able to validate your documents without modification, your guess is probably right on and editing the Does that help you out enough? It's a bit of a half fix, though it looks like we're keen to discuss some quality of life improvements that'd make what you experienced less painful. @cboettig, @mobb, mind if I open two new issues to discuss (1) the possibility of adding warnings/messages when @mobb, Re:
Looks like it does always try a local copy stored with the package, though this package uses the |
Thanks @amoeba. I can add the schema location (that was my original solution - I just didn't know if that was intentional), and have been putting in the packageID; I just came across the write_eml issues when trying to make a reproducible example for the schemaLocation. My 2 cents is that it would be easier for most users if the schemaLocation default were HTTP resolvable and yes putting in warnings for filling in default packageId and system would be useful. |
Thanks all! yes, new issues / PRs would be great for both the warning message and a remote schemaLocation default value. (or I'll get around to that sooner-or-later!) |
I'm having trouble generating/validating 2.2. I think the problem is that the second part of the schema location is just eml.xsd rather than the full path, but unsure. Reproducible example below w/comments
The text was updated successfully, but these errors were encountered: