NCEAS / arcticdatautils

Utility functions in R for processing data for the Arctic Data Center
https://nceas.github.io/arcticdatautils/
Apache License 2.0
10 stars 20 forks source link

eml_party: adding multiple organizations #92

Closed smfreund closed 5 years ago

smfreund commented 6 years ago

Cannot use eml_party to add more than one organizationName.


eml_party("creator", "Bryce", "Mecum", organization = c("NCEAS", "Planet Earth"))
 Show Traceback

 Rerun with Debug
 Error in node_append_content(x$node, value) : 
  Expecting a single string value: [type=character; extent=2]. ```
dmullen17 commented 5 years ago

Based on the EML schema https://knb.ecoinformatics.org/emlparser/docs/eml-2.1.1/eml-party.png and reference guide: https://manual.altova.com/xmlspy/spyenterprise/index.html?xseditingviews_schv_cmview_objects.htm, it looks like orngaizationName is a single element and can't contain multiple fields.

We can just stick to the one-string workaround organization = "NCEAS, Planet Earth"

amoeba commented 5 years ago

Hey @dmullen17 that's not quite right: Each party can have multiple organizations:

screen shot 2018-10-09 at 11 56 45 am

The above reads as "1 or infinite of { individualName, organizationName, positionName }.

e.g.,

r$> doc
<eml packageId="asdf" system="asdf" xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.1 eml.xsd">
  <dataset>
    <title>title</title>
    <creator>
      <individualName>
        <givenName>A</givenName>
        <surName>Person</surName>
      </individualName>
      <organizationName>org1</organizationName>
      <organizationName>org2</organizationName>
    </creator>
    <contact>
      <individualName>
        <givenName>A</givenName>
        <surName>Person</surName>
      </individualName>
    </contact>
  </dataset>
</eml>

r$> eml_validate(doc
    )
[1] TRUE
attr(,"errors")
character(0)
dmullen17 commented 5 years ago

So that's what that symbol means! Thanks for the info @amoeba, eml_party should probably be able to handle multiple inputs to those 3 fields - reopening.