From 54ddd1eba531efc662e16bc613b3de778d6f2ed5 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Wed, 28 Feb 2024 22:05:30 +0100 Subject: [PATCH] fix annotator after updating RDF version to 3.0 --- .github/workflows/ruby-unit-tests.yml | 2 ++ Gemfile.lock | 3 ++- lib/ncbo_annotator.rb | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby-unit-tests.yml b/.github/workflows/ruby-unit-tests.yml index 2e5c21cb..5829a11a 100644 --- a/.github/workflows/ruby-unit-tests.yml +++ b/.github/workflows/ruby-unit-tests.yml @@ -15,6 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: create config.rb file + run: cp config/config.test.rb config/config.rb - name: Set up solr configsets run: ./test/solr/generate_ncbo_configsets.sh - name: Install Dependencies diff --git a/Gemfile.lock b/Gemfile.lock index bed91370..601f57a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: cd5bc312bd3acd2ff056a87a6f37b5419f3444dc + revision: cb03c4888cc95006e653eb70dd29ee69901dd6cd branch: development specs: goo (0.0.2) @@ -196,6 +196,7 @@ GEM PLATFORMS x86_64-darwin-23 + x86_64-linux DEPENDENCIES addressable (~> 2.8.0) diff --git a/lib/ncbo_annotator.rb b/lib/ncbo_annotator.rb index 64a84105..d7b4fa79 100644 --- a/lib/ncbo_annotator.rb +++ b/lib/ncbo_annotator.rb @@ -733,11 +733,13 @@ def redis_last_mgrep_restart_default_timestamp() def create_term_entry(redis, instance_prefix, ontResourceId, resourceId, label_type, val, semanticTypes) begin # NCBO-696 - Remove case-sensitive variations on terms in annotator dictionary - val.upcase!() + val = val.dup.upcase rescue ArgumentError => e + binding.pry + val = val.dup # NCBO-832 - SCTSPA Annotator Cache building error (UTF-8) val = val.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') - val.upcase!() + val = val.upcase end # exclude single-character or empty/null values