Code Monkey home page Code Monkey logo

ontologies_api_ruby_client's Issues

Faraday multipart middleware moved out

Hi,

I don't know if you had already saw this issue.

The issue

At Agroportal, we are using the tag 2.0.2 (as you, i think) and recently when we did a bundle update we got the last version of faraday 2.1.0 where the multipart middleware (that is used here) is no more present (so causing a runtime error, see screenshot below ), it was moved to a separate gem called faraday-multipart.

image

More infos here : https://github.com/lostisland/faraday/blob/main/UPGRADING.md#bundled-middleware-moved-out

The fix for tag 2.0.2

For the tag 2.0.2 (used in production), we solved it by fixing the faraday version in the gemspec to 1.4.3

Gem::Specification.new do |gem|
  gem.authors       = ["Paul R Alexander"]
  gem.email         = ["[email protected]"]
  gem.description   = %q{Models and serializers for ontologies and related artifacts backed by 4store}
  gem.summary       = %q{This library can be used for interacting with a 4store instance that stores NCBO-based ontology information. Models in the library are based on Goo. Serializers support RDF serialization as Rack Middleware and automatic generation of hypermedia links.}
  gem.homepage      = "https://github.com/ncbo/ontologies_api_ruby_client"

  gem.files         = `git ls-files`.split($\)
  gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
  gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
  gem.name          = "ontologies_api_client"
  gem.require_paths = ["lib"]
  gem.version       = "2.0.2"

  gem.add_dependency('activesupport', '~> 5.2.6')
  gem.add_dependency('excon')
  gem.add_dependency('faraday', '1.4.3')
  gem.add_dependency('lz4-ruby')
  gem.add_dependency('multi_json')
  gem.add_dependency('oj')
  gem.add_dependency('spawnling', '2.1.5')

  # gem.executables = %w()
end

The fix for tag 2.0.3

The fix for the last tag is to add the faraday-multipart gem as a dependency in the gemspec.

purl method generates URLs that result in 404 Not Found

The purl method is generating URLs that result in 404 Not Found. Some examples:

osteochondrosis (from RADLEX)
PURL: http://purl.bioontology.org/ontology/RADLEX?conceptid=http%3A%2F%2Fradlex.org%2FRID%2FRID5369

Abnormal Cell (from NCIT)
PURL: http://purl.bioontology.org/ontology/NCIT?conceptid=http%3A%2F%2Fncicb.nci.nih.gov%2Fxml%2Fowl%2FEVS%2FThesaurus.owl%23C12913

The PURLs will resolve properly if the conceptid parameter's value isn't URL encoded.

API calls in refresh_cache method intermittently failing

I'm testing the BioPortal Rails application against Ruby 3.0.6, and the staging version of the BioPortal REST API, which is currently running on the AllegroGraph database. In my local dev environment, I'm seeing intermittent failures from two of the API calls inside of the refresh_cache method:

def refresh_cache
  Spawnling.new do
    LinkedData::Client::Models::Ontology.all
    LinkedData::Client::Models::OntologySubmission.all
    LinkedData::Client::Models::User.all
    exit
  end
end

The call to fetch all OntologySubmission objects results in an empty array, or a Faraday::TimeoutError. The call to fetch all users sometimes returns user data, and sometimes results in the same Faraday::TimeoutError.

The responses of these calls are never examined/logged, so they essentially appear to be silent failures. @mdorf is looking into why the /submissions endpoint returns an emtpy array from an AllegroGraph database (see ncbo/ontologies_api#117).

We may want to consider - at a minimum - logging error responses from these calls, so that we're at least aware when they occur.

Cache not invalidated after new submissions are processed

We've had several reports from the developers of the EDAM ontology where they upload a new ontology submission and the user interface only shows the submission status as uploaded. After waiting (sometimes as long as 24 hours), they're never able to see the status as anything other than uploaded, i.e., the data for the new submission never becomes visible.

I've reproduced this behavior in our production environment on two separate occasions, and observed the following:

  • It doesn't matter if you are logged in our out. The new submission shows as "uploaded" for both cases.
  • Clearing the browser cache has no effect.
  • Manually clearing BioPortal's goo and HTTP caches from the administrative page has no effect.

The only way I was able to get the new data to become visible in the UI was to click the "Flush UI Cache" button on the administrative page, which clears the front end in-memory cache (memcached).

I've also verified (by looking at the production parsing logs), that the EDAM ontology is relatively small and the system has no difficulty during the parsing process. From start to finish, we process the ontology in roughly 12 minutes.

gemspec file is outdated

It appears that the gemspec file in this project hasn't been actively maintained, i.e.:

  • Since we're using this code in production, the version number should be (at least) 1.0.0.
  • We haven't been bumping the version number with code changes.
  • The email and summary fields should be updated with more current information.

find method on LinkedData::Client::Models::Class throws argument error

I couldn't find any functionality in the BioPortal RoR application that triggers a call to find on LinkedData::Client::Models::Class, nor do we have any unit tests that exercise that particular method.

If you attempt to call the method in a debugging environment, e.g.:

LinkedData::Client::Models::Class.find(
  'http://purl.bioontology.org/ontology/STY/T047', 
  'https://data.bioontology.org/ontologies/STY'
)

... the library throws an ArgumentError:

ArgumentError: wrong number of arguments (given 1, expected 0)

The method attempts to explore a non-existent type of hypermedia link on an ontology object (i.e., 'class' instead of 'single_class').

Updating ontology metadata sometimes fails with Faraday::TimeoutError

Received a complaint on the support list from a user that tried to remove an administrator from their ontology via the "Edit Ontology Information" form in the BioPortal UI, and received a 500 error. This form is accessed in the UI by going to any ontology summary page, e.g., http://bioportal.bioontology.org/ontologies/ECSO, and clicking the "Edit ontology information" link.

The production log file shows a Faraday::Timeout error:

I, [2017-04-05T10:47:07.646950 #21412]  INFO -- : Completed 500 Internal Server Error in 60274ms (ActiveRecord: 0.0ms)
F, [2017-04-05T10:47:07.649109 #21412] FATAL -- :
Faraday::TimeoutError (read timeout reached):
  app/controllers/ontologies_controller.rb:398:in `update'

I, [2017-04-05T10:47:07.650174 #21412]  INFO -- : Processing by ErrorsController#internal_server_error as HTML
I, [2017-04-05T10:47:07.650307 #21412]  INFO -- :   Parameters: {"utf8"=>"โœ“", "authenticity_token"=>"", "ontology"=>{"name"=>"The Ecosystem Ontology", "administeredBy"=>["", "http://data.bioontology.org/users/brycemecum", "http://data.bioontology.org/users/mobb", "http://data.bioontology.org/users/schild"], "viewingRestriction"=>"public", "acl"=>["", "http://data.bioontology.org/users/cjones", "http://data.bioontology.org/users/mobb", "http://data.bioontology.org/users/schild", "http://data.bioontology.org/users/sophisticus", "http://data.bioontology.org/users/xixiluo"], "hasDomain"=>["", "", "http://data.bioontology.org/categories/Other"], "isView"=>"0", "subscribe_notifications"=>"1"}, "commit"=>"Save ontology", "id"=>"ECSO"}
I, [2017-04-05T10:47:07.655224 #21412]  INFO -- :   Rendered errors/internal_server_error.html.erb within layouts/ontology (2.0ms)
I, [2017-04-05T10:47:07.658264 #21412]  INFO -- :   Rendered layouts/_topnav.html.haml (1.8ms)
I, [2017-04-05T10:47:07.658598 #21412]  INFO -- :   Rendered layouts/_notices.html.erb (0.2ms)
I, [2017-04-05T10:47:07.658686 #21412]  INFO -- :   Rendered layouts/_header.html.erb (3.2ms)
I, [2017-04-05T10:47:07.659514 #21412]  INFO -- :   Rendered layouts/_footer.html.erb (0.7ms)
I, [2017-04-05T10:47:07.659725 #21412]  INFO -- : Completed 500 Internal Server Error in 9ms (Views: 7.5ms | ActiveRecord: 0.0ms)

Just FYI - I removed the value of the authenticity token in the parameter list above.

Calling the update method in this project on an ontology object results in a read timeout. I wasn't able to reproduce this behavior after several attempts. We'll need to investigate under what circumstances the timeouts occur.

URI.escape is obsolete warnings after Ruby 2.7 upgrade

After upgrading to Ruby 2.7, the log files for the BioPortal RoR application are full of URI.escape is obsolete warnings, originating from this library, e.g.:

Started GET "/ajax/classes/label?ontology=NIFSTD&concept=http%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000019" for 127.0.0.1 at 2022-12-19 11:34:52 -0800
Processing by ConceptsController#show_label as */*
  Parameters: {"ontology"=>"NIFSTD", "concept"=>"http://purl.obolibrary.org/obo/UBERON_0000019"}
/Users/vendetti/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/bundler/gems/ontologies_api_ruby_client-ca18863efae6/lib/ontologies_api_client/link_explorer.rb:64: warning: URI.escape is obsolete
  Rendering text template
  Rendered text template (Duration: 0.0ms | Allocations: 6)
Completed 200 OK in 362ms (Views: 0.3ms | ActiveRecord: 0.0ms | Allocations: 548234)

Validate API key before running unit tests

Unit tests fail with a confusing and unhelpful error when it is run with an invalid API key. A new unit test should be added to verify that the provided API key validates before proceeding to other unit tests.

relates to #14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.