ropensci / EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
https://docs.ropensci.org/EML
Other
97 stars 33 forks source link

project award element does not seem to be accessible #305

Open srearl opened 4 years ago

srearl commented 4 years ago

One of the enhancements of EML 2.2.0 is the ability to add additional and more structured details of funding with the <award> element within <project>. However, the <award> element does not seem to be accessible.

Confirming that we are using the appropriate version of EML: emld::eml_version() [1] "eml-2.2.0"

EML::eml$project() suggests a structure characteristic of EML 2.1.1 lacking the <award> element.

amoeba commented 4 years ago

Hey @srearl, thanks for the report. Looks related to https://github.com/ropensci/EML/issues/287 and it looks like we have some more work there to get this to work.

In the mean time, because of the new list-based structure we use, you may be able to manually set an award list member on your project so long as its in the right spot. Haven't tested so your mileage may vary.

I'll try to make some time to look at this and #287 later this week.

mbjones commented 4 years ago

I can confirm that the EML::eml$project() constructor does not seem to reflect the EML 2.2.0 schema.

However, I was able to produce valid EML using the list structure:

library(emld)
library(EML)
emld::eml_version("eml-2.2.0")

me <- list(individualName = list(givenName = "Matt", surName = "Jones"))
my_eml <- list(
  packageId = list("foo.bar"),
  system = "https://dataone.org",
  dataset = list(
    title = "Check award structure in EML 2.2.0",
    creator = me,
    abstract = "Dataset abstract",
    contact = me,
    project = list(
      title = "Project title",
      personnel = list(individualName = list(givenName = "Matt", surName = "Jones"),
                       role = list("Principal Investigator")),
      abstract = "Project abstract",
      funding = list(para = "Funding para"),
      award = list(
        funderName = "National Science Foundation",
        funderIdentifier = "https://doi.org/10.13039/00000001",
        awardNumber = "1546024",
        title = "Scientia Arctica: A Knowledge Archive for Discovery and Reproducible Science in the Arctic",
        awardUrl = "https://www.nsf.gov/awardsearch/showAward?AWD_ID=1546024"
      )
    )
  )
)
eml_validate(my_eml)
write_eml(my_eml, "eml.xml")

That code produces this valid EML:

<?xml version="1.0" encoding="UTF-8"?>
<eml:eml xmlns:eml="https://eml.ecoinformatics.org/eml-2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stmml="http://www.xml-cml.org/schema/stmml-1.2" packageId="foo.bar" system="https://dataone.org" xsi:schemaLocation="https://eml.ecoinformatics.org/eml-2.2.0 https://eml.ecoinformatics.org/eml-2.2.0/eml.xsd">
  <dataset>
    <title>Check award structure in EML 2.2.0</title>
    <creator>
      <individualName>
        <givenName>Matt</givenName>
        <surName>Jones</surName>
      </individualName>
    </creator>
    <abstract>Dataset abstract</abstract>
    <contact>
      <individualName>
        <givenName>Matt</givenName>
        <surName>Jones</surName>
      </individualName>
    </contact>
    <project>
      <title>Project title</title>
      <personnel>
        <individualName>
          <givenName>Matt</givenName>
          <surName>Jones</surName>
        </individualName>
        <role>Principal Investigator</role>
      </personnel>
      <abstract>Project abstract</abstract>
      <funding>
        <para>Funding para</para>
      </funding>
      <award>
        <funderName>National Science Foundation</funderName>
        <funderIdentifier>https://doi.org/10.13039/00000001</funderIdentifier>
        <awardNumber>1546024</awardNumber>
        <title>Scientia Arctica: A Knowledge Archive for Discovery and Reproducible Science in the Arctic</title>
        <awardUrl>https://www.nsf.gov/awardsearch/showAward?AWD_ID=1546024</awardUrl>
      </award>
    </project>
  </dataset>
</eml:eml>

So it seems there is a constructor issue to be worked out. I wonder if this is limited to just the project constructor, or if all constructors that differ between 2.1.1 and 2.2.0 are incorrect when there are changes in 2.2.0? @cboettig any thoughts on how the constructors are generated for the different versions?

mbjones commented 4 years ago

I just reread Issue #287 and realized that all of this was already pointed out in that issue. Fixing #287 should fix this eml$project() issue, so this is really a duplicate.