ncbo / bioportal-project

Serves to consolidate (in Zenhub) all public issues in BioPortal
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

improved troubleshooting for rapper calls #221

Open graybeal opened 2 years ago

graybeal commented 2 years ago

When rapper calls fail in BioPortal, they are hard to troubleshoot because (a) there is no indicator that the rapper command was executing or what exactly the command was, (b) the rapper error messages are very brief and don't contain the text of the document near the failure point, (c) there are two rapper calls (according to old/OntoPortal documentation, and you can't tell which one failed, and (d) the file being parsed is deleted whether the rapper execution(s) was successful or not. (Reference https://github.com/ncbo/bioportal-project/issues/216.) Key code is at https://github.com/ncbo/goo/blob/master/lib/goo/sparql/client.rb.

It would be great to make some quick improvements to improve this situation. I would recommend: (1) Do a puts rapper_command_call or equivalent logging call after line 66 (2) If either line 68 or line 74 Exception is raised, do not delete the resulting file or directory (I believe that's bnodes_filter in lines 118-119 or the subsequent lines to 128; apparently bnodes_filter is not detecting or responding to the Exception being raised earlier in the bnodes_filter_file) so that troubleshooting can take place on that file. (3) Add minimal comments to describe that lines 65-66 and lines 86 and following are converting the file to TTL and storing the resulting triples in the backend store, while lines 70-75 are removing blank nodes from the TTL file. (4) I am not sure if there actually is a second rapper call being executed anywhere; review https://github.com/OntoPortal/administration/blob/master/docs/_ontologies/troubleshooting_submissions.md to see if the sequence there is actually correct, and if so, consider improvements for it as well.