Skip to content

Commit

Permalink
License metadata upload fix. (#100)
Browse files Browse the repository at this point in the history
Fixes license metadata upload issue.

pyDataverse's Dataverse metadata schema
(pyDataverse/schemas/json/dataset_upload_default_schema.json in their
Github repository) seems to accept license as a string (as Dataverse's
Native API seems to have previously done in version 4) rather than an
object with "name" and "uri" values.

Made slight change to Dataverse upload job to note this and work around
it.
  • Loading branch information
mcantelon committed May 24, 2023
1 parent 39bf89a commit 6cdb6d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uploader/Dataverse/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ def run(self):
],
}
)
json.dump(dv_json, dv_json_file)

# Make slight metadata change to accord with pyDataverse client
dv_json["datasetVersion"]["license"] = dv_json["datasetVersion"]["license"][
"name"
]

ds.from_json(json.dumps(dv_json), validate=False)

# Get the division acronym from the metadata in the AIP
Expand Down

0 comments on commit 6cdb6d0

Please sign in to comment.