API for getting Dataset DOI from Datafile DOI?

25 views
Skip to first unread message

Raman Prasad

unread,
Jul 16, 2018, 12:07:38 PM7/16/18
to Dataverse Users Community
What is the best way to get a Dataset DOI when you start with a Datafile DOI?

Input: persistentID of a file

Desired info: JSON-LD citation for the file's dataset

We tried using the search API to get the dataset's persistentID but were unsuccessful.

example:


   -> gave 27k+ results

Please let us know if there's a workaround.  Any way to these would help:
  - file persistentId -> file id
  - file persistentId -> dataset persistent Id 
  - file persistentId -> dataset file Id

Thanks,

Raman

Philip Durbin

unread,
Jul 16, 2018, 6:47:24 PM7/16/18
to dataverse...@googlegroups.com
Hi Raman, you've definitely found a bug and a problem with the index on Harvard Dataverse. For now, can you try the demo site? I seem to be having fairly good luck finding https://demo.dataverse.org/file.xhtml?persistentId=doi:10.5072/FK2/Q1RSNG/MVJGHT with https://demo.dataverse.org/api/search?q=filePersistentId:MVJGHT

I'd say that from there you'd have to parse the citation to get the dataset DOI, but because the demo site (and Harvard Dataverse) use the default :DataFilePIDFormat setting of "randomString/DEPENDENT"* in this case you can easily derived the dataset pid from the file pid by simply the last slash and every after it so that "doi:10.5072/FK2/Q1RSNG/MVJGHT" becomes "doi:10.5072/FK2/Q1RSNG".

I hope this makes sense! This seems fairly related to https://github.com/IQSS/dataverse/issues/4616

Thanks,

Phil


--
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-community+unsub...@googlegroups.com.
To post to this group, send email to dataverse-community@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/ad7761f3-e73a-42c5-b8e9-8a917b4bb736%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages