ropensci / rcrossref

R client for various CrossRef APIs
https://docs.ropensci.org/rcrossref
Other
166 stars 20 forks source link

shortDOIs do not resolve #167

Closed njbart closed 6 years ago

njbart commented 6 years ago

It seems rcrossref is not able to resolve shortDOIs (see http://shortdoi.org/ and https://www.doi.org/resources.html), as judged from this example, using a DOI and its corresponding shortDOI:

> cr_cn(dois="10.1126/science.169.3946.635")
[1] "@article{Frank_1970,\n\tdoi = {10.1126/science.169.3946.635},\n\turl = {https://doi.org/10.1126%2Fscience.169.3946.635},\n\tyear = 1970,\n\tmonth = {aug},\n\tpublisher = {American Association for the Advancement of Science ({AAAS})},\n\tvolume = {169},\n\tnumber = {3946},\n\tpages = {635--641},\n\tauthor = {H. S. Frank},\n\ttitle = {The Structure of Ordinary Water: New data and interpretations are yielding new insights into this fascinating substance},\n\tjournal = {Science}\n}"
> cr_cn(dois="10/cvm544")
Warning messages:
1: 10/cvm544 agency not found - proceeding with 'crossref' ... 
2: 10/cvm544 w/ (404) - Resource not found. 
> 

10/cvm544 does resolve as expected at https://doi.org/10/cvm544.

sckott commented 6 years ago

we're using the crossref api which as far as I know deals only with full DOIs - have you had luck with short dois with crossref in another context?

njbart commented 6 years ago

Well, it seems crossref.org actually invented shortDOIs themselves (see https://www.crossref.org/labs/toi-doi-i-e-short-dois/), and they do list them on https://search.crossref.org/help/search.

Also, using my example shortDOI, https://search.crossref.org/?q=10%2Fcvm544 does return the corresponding long DOI. (Not sure though why it does not provide the article metadata in one step as it does in the case of https://crossref.org/?q=+10.1126%2Fscience.169.3946.635.)

sckott commented 6 years ago

Right, i'm not sure why it doesn't work. I'll ask the Crossref folks.

sckott commented 6 years ago

@njbart still no response on this

gbilder commented 6 years ago

Hi. This has to do with the way shortDOIs were implemented. DOIs do not automatically have a ShortDOI equivalent. Rather, shortDOIs are generated on request (I think by the handle proxy). This means that the short DOI is stored in the handle system, not in our metadata, so the API cannot search/filter for them. Same applies to Crossref Metadata Search though, as you've seen, it has a hack that at least recognises a potential ShortDOI and attempts to return the actual DOI. And as you say, it would be handy if it would take the extra step of then reapplying the search with the full DOI. We could, in theory, do the same thing on the API (recognise a ShortDOI and convert it to long DOI on the fly). But we are also looking at potentially generating ShortDOIs for all the DOIs in our system and then storing that info in our metadata. But before we do, we really need to think a bit more about the future of ShortDOIs with some of the other RAs of the DOI Foundation (e.g. DataCite).

sckott commented 6 years ago

thanks @gbilder !

sckott commented 6 years ago

@njbart see the comment above. So i'd get the full DOI first, then proceed with any data retrieval.

GilmourR commented 4 years ago

A shortDOI looks like this: https://doi.org/fx464n. To retrieve from Crossref, the call is: httr::GET(https://doi.org/fx464n). The shortDOI is sometimes written as doi:10/fx464n, although this form cannot be used to retrieve from Crossref with GET(), nor can it be used as an abbreviated URL in a browser. It is necessary to write the full shortDOI: https://doi.org/fx464n, which drops the 10/.