ontoportal-lirmm / bioportal_web_ui

A Rails application for ontologies portal.
http://agroportal.lirmm.fr/
Other
6 stars 5 forks source link

Bug (solved): metadata downloader returning files without content for formats: nquads and jsonld #227

Closed RaimiSol closed 1 year ago

RaimiSol commented 1 year ago

At the endpoint /ontologies/:acronym the buttons N-Triple and JSON-LD trigger downloads for files with content "undefined".

I solved the issue by modifying the line 96 in metadata_downloader_controller.js

Using chrome devtools the problem showing up was that the condition subJson["URI"] !== undefined` didn't catched null values the consequences were:

syphax-bouazzouni commented 1 year ago

OK, can you please provide us with a PR with your fix?

syphax-bouazzouni commented 1 year ago

To reproduce

  1. Go to https://agroportal.lirmm.fr/ontologies/SIREN
  2. Click on the button N-Triple

Image

  1. See the downloaded file, with only undefined written instead for the ontology metadata

Image

Proposed fix

See https://github.com/ontoportal-lirmm/bioportal_web_ui/pull/256, @SirineMhedhbi clean and review the code