Hi there !
I'm a new user of dataverse and I'm trying to make a new function with the aim of duplicating a dataset (only the metadatas, of course). In order to do this, I'm using the dataverse python client, but I got some problems with it. To me, I got 2 solutions for my project:
- getting the metadatas and use the "update_metadata" function directly, after having modified some fields outside the metadataBlocks
- getting the metadata json, parsing it and use the "create_dataset" function of the python api to create a new dataset with all the fields recovered
For both idea, I got a problem. The first one doesn't work for two reasons: the "dataset.updatemetadata()" function doesn't work, even with the metadatas of the same dataset. I tried to update the metadatas of a published dataset with his own dataset (the one the function "dataset.get_metadata()" gave to me), and this doesn't work. That's why the "dataset.create_draft()" function doesn't seem to work too, because it does the same thing, and ... no draft version appear :(
The second one doesn't work too for me. I can create a new dataset with basic infos, like multiple author, for example, but I can't specify specifics infos. For example, I can give a list of authors, but I didn't find anyway to specify author affiliations or Identfiers. I can give at best a list of values for author, but I can't give a dictionnary with more specifics values, for example. I even tried to use the utils.add_field() directly in order to add fields to the dataset. Maybe I'm not using the right keys. Are they different from the Json generated ? The strange thing here is that "utils.add_field()" is the one used to create the dataset from "dataverse.create_dataset()" no ?
I think for both my problems, the problem would be "me", so I'd like to know if some of you have work with the dataverse python client, and if they succeed in adding specific keys and values to a dataset, and if it would be possible to see a functionnal example of this.
All my tests were made on the dataverse-demo (my dataverse is here:
https://dataverse-demo.iq.harvard.edu/dataverse/grimdataverse), with the API-token given to me. Is there any rights restrictions on this website ? That could explain some things, maybe ?
If you need some more infos to help me, like my codes, datas example, etc, I would be glad to give you this :)
Ps: Sorry for my terrible english here, I'm just a french dude trying to figure out what he has done wrong here :(