Skip to content
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

Set attributes for properties, e.g. <title xml:lang="eng"> #340

Closed
peterdesmet opened this issue Apr 29, 2022 · 3 comments
Closed

Set attributes for properties, e.g. <title xml:lang="eng"> #340

peterdesmet opened this issue Apr 29, 2022 · 3 comments

Comments

@peterdesmet
Copy link
Member

Is it possible to define attributes for properties? My use case is that I want to generate an EML file that can be uploaded and understood by a GBIF IPT. The IPT has a particular way of setting userId, by assigning a directory attribute. Is there a way to replicate that (in e.g. set_responsibleParty)?

<creator>
  <individualName>
    <givenName>Peter</givenName>
    <surName>Desmet</surName>
  </individualName>
  <userId directory="http://orcid.org/">0000-0002-8442-8025</userId>
</creator>
@peterdesmet
Copy link
Member Author

Ha, I see this is a duplicate of #338. Closing here.

@mbjones
Copy link
Member

mbjones commented Apr 29, 2022

@peterdesmet I think this is different from #338, which addresses attributes inside of additionalMetadata, which is handled differently from the rest of the EML schema. The @directory attribute is a standard part of the EML schema on the userId elelment and should be able to be set without a problem. We use it exactly as you described in our documents in the Arctic Data Center (it is recommended best practice for ORCIDs). The one difference is that DataONE, LTER, and other networks have converged on using the full ORCID in the userId value. Here's an example with directory set correctly:

me <- list(
    individualName = list(
        givenName = "Peter", 
        surName = "Desmet"), 
    userId = list(
        directory="https://orcid.org/", 
        'https://orcid.org/0000-0002-8442-8025'))
eml <- list(dataset = list(
    title = "dataset title",
    contact = me,
    creator = me),
    system = "doi",
    packageId = "10.xxx")
doc <- as_emld(eml)
eml_validate(doc)

@peterdesmet
Copy link
Member Author

Oh excellent! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants