FAIRsharing / fairsharing.github.io

The website for FAIRsharing, currently running at https://fairsharing.org.
https://fairsharing.org/
GNU Affero General Public License v3.0
9 stars 4 forks source link

Importing OSF DOIs via the Publications edit tab #2429

Open allysonlister opened 2 days ago

allysonlister commented 2 days ago

I cannot retrieve 10.17605/OSF.IO/9r62x from the Publications page. It's an OSF DOI. When I press Import DOI it just spins and hangs.

@knirirr asked me to make a ticket, and says: Behind the scenes a CORS problem prevents crosscite.org from redirecting to osf.io. So, not strictly a hang, but the Javascript doesn't exit cleanly and reload the buttons.

knirirr commented 2 days ago

Is this actually an article? https://osf.io/9r62x/ It looks to me like the description of a resource.

What happens is that dx.doi.org doesn't get any hits, so data.crosscite.org is called next and does two things:

  1. Returns some search results which aren't what you're looking for, then...
  2. Attempts to load the web page at osf.io (not their API, if they have one), which fails with a CORS error.

I think that the proper solution here would be to attempt to catch the error at (2) and return gracefully from that; the results at (1) aren't correct and I can't deal with the redirection to a web page.

EDIT: osf.io has an API: https://developer.osf.io/

The only way to get this to work (assuming publications are being sought) is to write a new query to look for publications in osf.io directly, once the previous two have failed.

allysonlister commented 2 days ago

ah, i see, so dx.doi.org doesn't return anything because it's not of the correct type?

Yes, it is essentially an OSF directory containing a variety of things including documents but also including all past versions of the database.

Would other osf dois that point to publications/documents/manuscripts work?

knirirr commented 2 days ago

ah, i see, so dx.doi.org doesn't return anything because it's not of the correct type?

I believe so.

Would other osf dois that point to publications/documents/manuscripts work?

I don't know. Do you happen to have any to try?

allysonlister commented 2 days ago

Try https://doi.org/10.17605/OSF.IO/3WQPR

It's a pdf but should work as adocument. however it is of resource type "other". You may need to just search osf for an appropriate resource type and take its doi.

knirirr commented 2 days ago

Searching OSF will require writing new API queries; data.crosscite.org doesn't redirect correctly and so can't be used. This will need a new PR, so please would you review the current one (which at least removes a crash) and I'll start another when I have time.