IQSS / dataverse-client-r

R Client for Dataverse Repositories
https://iqss.github.io/dataverse-client-r
61 stars 25 forks source link

get_dataset by hdl code #17

Closed ikashnitsky closed 6 years ago

ikashnitsky commented 7 years ago

There is no DOI for the dataset that I want to grab http://hdl.handle.net/10622/DN9QDM Is it possible to get it somehow? If not, is it possible to add the feature of specifying the dataset by the hdl code?

leeper commented 7 years ago

I believe get_dataset("hdl:10622/DN9QDM") should work for you. Does it not?

ikashnitsky commented 7 years ago

No, for some reason that does not work

Error in get_dataset("hdl:10622/DN9QDM") : Not Found (HTTP 404).

leeper commented 7 years ago

Seems like a bug. Let me investigate.

conjugateprior commented 6 years ago

Bug confirmed. Some more detail:

code1 <- get_file("chapter03.R", "doi:10.7910/DVN/ARKOTI")
# succeeds

code2 <- get_file("1995-1999 Levels of Source _ Target.tab", "hdl:1902.1/FYXLAWZRIA")
Error in get_file("1995-1999 Levels of Source _ Target.tab", "hdl:1902.1/FYXLAWZRIA") : 
  Service Unavailable (HTTP 503).

Also fails for http://hdl.handle.net/1902.1/FYXLAWZRIA which will resolve in a browser.

But

> code3 <- get_file_metadata(109356, "http://hdl.handle.net/1902.1/FYXLAWZRIA")
> code3
[1] "<?xml version='1.0' encoding='UTF-8'?><codeBook xmlns=\"http://www.icpsr.umich.edu/DDI\" version=\"2.0\"><stdyDscr><citation><titlStmt><titl>10 Million International Dyadic Events</titl><IDNo agency=\"hdl\">1902.1/FYXLAWZRIA</IDNo></titlStmt><rspStmt><AuthEnty>King, Gary; Lowe, Will</AuthEnty></rspStmt><biblCit>King, Gary; Lowe, Will, 2008, \"10 Million International Dyadic Events\", hdl:1902.1/FYXLAWZRIA, Harvard Dataverse, V5, UNF:3:dSE0bsQK2o6xXlxeaDEhcg==</biblCit></citation></stdyDscr><fileDscr ID=\"f109356\"><

[snip]

and this works with hdl:1902.1/FYXLAWZRIA too. So a DV-side error perhaps?

I'd like to offer an equivalent working curl command, but nothing about the DV Data access API here works for queries involving this repo, via curl or elsewhere. However, the documentation seems like a work in progress, so I may simply have not hit on the right combination of endpoint and parameters.

pdurbin commented 6 years ago

the documentation seems like a work in progress

@conjugateprior uh oh. You're talking about the API Guide, aren't you? Can you please open an issue at https://github.com/IQSS/dataverse/issues about what's confusing. We do sprint planning and estimates based on that issue tracker rather than this one. We can try to improve the documentation.

conjugateprior commented 6 years ago

@pdurbin Right-o, I posted two tickets over there. One for the download problem and a separate one for the documentation.

pdurbin commented 6 years ago

@conjugateprior yes, thanks for opening https://github.com/IQSS/dataverse/issues/4373 and https://github.com/IQSS/dataverse/issues/4374

leeper commented 6 years ago

Sorry about delay in getting to this. There were two issues, one is that you need to specify the server (it defaults to Harvard). The other is there was a bug, which is now fixed. You should see:

> get_dataset("hdl:10622/DN9QDM", key = "", server = "datasets.socialhistory.org")
Dataset (453): 
Version: 1.0, RELEASED
Release Date: 2017-05-29T14:01:26Z
9 Files:
                             label version   id       contentType
1 Shapefile_RussianEmpire_1897.rar       1 1831 application/x-rar