ncbo / bioportal_web_ui

A Rails application for biological ontologies
http://bioportal.bioontology.org/
Other
21 stars 2 forks source link

Class permalinks result in 404 Not Found #272

Closed jvendetti closed 1 year ago

jvendetti commented 1 year ago

Description from end user on the support list regarding the RADLEX ontology:

The problem I am encountering is with the permalink function attached to individual entries. Normally, upon clicking the permalink button, which is located at the top right corner of an entry, a link is generated that directs to that specific entry. However, when attempting to use this function recently, I have found that the generated link is broken. That is, the link cannot be resolved or navigated to, resulting in an inability to directly access or share the specific entry via this method.

Example:

Functional link: https://bioportal.bioontology.org/ontologies/RADLEX/?p=classes&conceptid=http%3A%2F%2Fradlex.org%2FRID%2FRID5369&jump_to_nav=true

On that page generated defective permalink: https://bioportal.bioontology.org/ontologies/RADLEX/?p=classes&conceptid=http%3A%2F%2Fradlex.org%2FRID%2FRID5369&jump_to_nav=true

I checked several ontologies and the issue doesn't appear to be specific to RADLEX.

Complete set of requests for the example class provided above:

GET:
http://purl.bioontology.org/ontology/RADLEX?conceptid=http%3A%2F%2Fradlex.org%2FRID%2FRID5369
302 Moved Temporarily

GET:
http://bioportal.bioontology.org/ontologies/RADLEX/classes?conceptid=http%3A%2F%2Fradlex.org%2FRID%2FRID5369
302 Found

GET:
https://bioportal.bioontology.org/ontologies/RADLEX/classes?conceptid=http%253A%252F%252Fradlex.org%252FRID%252FRID5369
301 Moved Permanently

GET:
https://bioportal.bioontology.org/ontologies/RADLEX?p=classes&conceptid=http%253A%252F%252Fradlex.org%252FRID%252FRID5369
404 Not Found

It looks like by the 3rd request, the conceptid parameter is URL encoded twice, resulting in the broken link.

alexskr commented 1 year ago

I updated ontologies_api config so that new purls get generated with 'https://' prefix. That should reduce number of redirects by one.

we have a script for updating target URL for existing purls but it is not working for 100% of ontologies yet

jvendetti commented 1 year ago

For purposes of clarity, the script referred to above is a new Rake task in the ncbo_cron project (purl_management.rake) that calls the fix_purl method.

I've also updated our environment-specific configuration files to use HTTPS for the $PURL_PREFIX variable in the following commits:

https://github.com/ncbo/bioportal_config/commit/f09211ab2b6ebdaed7fbe51de4a5d973145a492f https://github.com/ncbo/bioportal_config/commit/dd33f645bd5d106f890178fb12625c7c7b4efd0b

jvendetti commented 1 year ago

Fixed as of release 6.11.0, after moving to a newer version of the ontologies_api_client gem.