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

Error generating DOI #36

Closed
dchiquito opened this issue Jun 16, 2021 · 2 comments · Fixed by #37
Closed

Error generating DOI #36

dchiquito opened this issue Jun 16, 2021 · 2 comments · Fixed by #37
Assignees

Comments

@dchiquito
Copy link
Contributor

dchiquito commented Jun 16, 2021

I am trying to generate the DOI for a dandiset with this metadata:

{
  "id": "DANDI:000001/draft",
  "url": "https://dandiarchive.org/000001/draft",
  "name": "1",
  "about": [],
  "access": [],
  "license": [
    "spdx:CC0-1.0"
  ],
  "version": "draft",
  "@context": "https://raw.githubusercontent.com/dandi/schema/master/releases/0.4.1/context.json",
  "citation": "d (2021) 1. Online: https://dandiarchive.org/000001/draft",
  "keywords": [],
  "protocol": [],
  "schemaKey": "Dandiset",
  "identifier": "DANDI:000001",
  "repository": "https://dandiarchive.org/",
  "contributor": [
    {
      "name": "d",
      "roleName": [],
      "schemaKey": "Organization",
      "contactPoint": [],
      "includeInCitation": false
    },
    {
      "name": "d",
      "roleName": [
        "dcite:ContactPerson"
      ],
      "schemaKey": "Person",
      "affiliation": [],
      "includeInCitation": true
    }
  ],
  "description": "1",
  "studyTarget": [],
  "assetsSummary": {
    "numberOfBytes": 5670812,
    "numberOfFiles": 1
  },
  "schemaVersion": "0.4.1",
  "ethicsApproval": [],
  "wasGeneratedBy": [],
  "relatedResource": [],
  "manifestLocation": []
}

I am getting a KeyError: contributorType from https://github.com/dandi/dandischema/blob/master/dandischema/datacite.py#L159.

I think that prepending dcite: to all of the elements in DATACITE_CONTRTYPE might resolve the issue?

@satra
Copy link
Member

satra commented Jun 16, 2021

the prefix dcite has to dropped. let me fix that in the current PR.

@dchiquito
Copy link
Contributor Author

I think the actual issue is that the first contributor in the list had no roles (roleName: []). [] evaluates to False, so contributorType is not set, so it is not there to be pop'd.

@satra satra closed this as completed in #37 Jun 16, 2021
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

Successfully merging a pull request may close this issue.

3 participants