Dataset metadata export through the API

49 views
Skip to first unread message

ofu...@gmail.com

unread,
Mar 23, 2019, 12:51:39 PM3/23/19
to Dataverse Users Community
Hi,
I want to run batch metadata export through the API of datasets with handles (and not DOI). How can I do this? I have tried the following:


curl -H "X-Dataverse-key:de03e242......."  -X GET http://localhost:8080/api/admin/metadata/ExportAll


Thanks in advance.

Cheers
Obi

Pete Meyer

unread,
Mar 25, 2019, 12:19:13 PM3/25/19
to Dataverse Users Community
Hi Obi,



On Saturday, March 23, 2019 at 12:51:39 PM UTC-4, ofu...@gmail.com wrote:
Hi,
I want to run batch metadata export through the API of datasets with handles (and not DOI). How can I do this? I have tried the following:


 

curl -H "X-Dataverse-key:de03e242......."  -X GET http://localhost:8080/api/admin/metadata/ExportAll

I think this API endpoint is case-sensitive, `http://localhost:8080/api/admin/metadata/exportAll` might be worth trying.

Best,
Pete

ofu...@gmail.com

unread,
Mar 26, 2019, 4:16:10 PM3/26/19
to Dataverse Users Community
Thanks Pete.
  
I tried   curl http://localhost:8080/api/datasets/export?exporter=dc&persistentId=hdl:10037.1/10020
[
but got an error message: 
              {"status":"ERROR","message":"A dataset with the persistentId null could not be found."}


and I received the following message:

                  {"status":"WORKFLOW_IN_PROGRESS"}

Cheers,
Obi

Pete Meyer

unread,
Mar 26, 2019, 4:38:36 PM3/26/19
to Dataverse Users Community
Hi Obi,


On Tuesday, March 26, 2019 at 4:16:10 PM UTC-4, ofu...@gmail.com wrote:
Thanks Pete.
  
I tried   curl http://localhost:8080/api/datasets/export?exporter=dc&persistentId=hdl:10037.1/10020
[
but got an error message: 
              {"status":"ERROR","message":"A dataset with the persistentId null could not be found."}

That looks like either a bug, or me mixing up the handle syntax (I'm not very familiar with handles).
 


and I received the following message:

                  {"status":"WORKFLOW_IN_PROGRESS"}


That suggests that it's working (or at least, the system thinks it was able to start re-exporting everything).  Do you see exports for datasets after the job has finished?

Best,
Pete

Sherry Lake

unread,
Mar 26, 2019, 4:45:18 PM3/26/19
to dataverse...@googlegroups.com
Hi Obi,

I do not have handles, but in order to get the curl line below to work with my doi I used this command:

On the command line, this command did not work without the "\" in front of the ampersand "&". And I had to specify the correct metadata exporter - oai_dc

Supported exporters (export formats) are ddioai_ddidctermsoai_dc, and dataverse_json.

I couldn't get the "exportAll" command to work either.

--
Sherry

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/3e63d1b7-b1d1-4747-aea0-240ff7698a05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ofu...@gmail.com

unread,
Mar 27, 2019, 6:33:45 AM3/27/19
to Dataverse Users Community
Thanks Pete and Sherry.

"\" in front of the ampersand "&" works for datasets with doi and not hdl.
exportAll did not work.

We have about 40 datasets with hdl and we discovered that when one click on "Export Metadata" and choose "Dublin Core", the generated value of the field "license" is "None":

   <dcterms:license>NONE</dcterms:license>

Datasets with doi are ok:
    <dcterms:license>CC0</dcterms:license>
 
 
I need help on how I can change the value from NONE to CC0.

Cheers
Obi
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

Philip Durbin

unread,
Mar 27, 2019, 7:37:35 AM3/27/19
to dataverse...@googlegroups.com
Hi Obi,

Now I remember the "NONE" license for datasets for Handles you mentioned earlier[1].

Can you please create an issue about this at https://github.com/IQSS/dataverse/issues ?

I'm thinking it's a bug.

Thanks!

Phil

p.s. The ampersand (&) has special meaning to your shell (often Bash) and an alternative to escaping it with a backslash (\) is to put the entire URL in quotes.

p.p.s. For what it's worth, I also get "WORKFLOW_IN_PROGRESS" when I run `curl http://localhost:8080/api/admin/metadata/exportAll`. This is a strange message so if anyone feels like opening an issue about this (even just to document it), please feel free.


To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.

To post to this group, send email to dataverse...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages