Open thesadie opened 4 years ago
Hey @thesadie, thanks for filing an issue. It's great that you're looking to use taxonomic IDs with your taxonomic coverage.
This package, emld
, is an internal package used by the EML package which is what we have built for scientists & other users. Do you have a use case where you need to use emld
directly? Normally, we'd suggest you use EML directly.
That said, I'm actually having a hard time getting XML attributes to serialize correctly with emld
which actually should work. I think we'd run:
library(EML)
me <- list(individualName = list(givenName = "Example", surName = "User"))
my_eml <- list(dataset = list(
title = "A Minimal Valid EML Dataset",
creator = me,
contact = me)
)
my_eml$dataset$coverage$taxonomicCoverage <- list(
taxonomicClassification = list(
taxonRankName = "Species",
taxonRankValue = "Gypsophila paniculata",
taxonId = list(
"#provider" = "ITIS",
value = "20293")
))
write_eml(my_eml, "ex.xml")
But I'm getting a taxonId
element that looks like this:
<taxonId>
<#provider>ITIS</#provider>
<value>20293</value>
@cboettig any thoughts? I didn't see any unit tests or such that show this working though I do note that our eml-2.2.0.json
does have what looks like the right data for taxonId
: "taxonId": ["#provider"],
.
@thesadie I'm not sure if we need to fix anything at this point but we'll update here as we discuss.
New to EML 2.2.0 is support for ids in taxonomicClassification
I want to be able to set the attributes of tags in order to include
<taxonId>
in taxonomic coverage. The attribute is dropped silently when i useemld::as_xml()
. Is there a way to do this?