From 7cc7fd575794b68da57e0c51a60561cf701b851c 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 --- Gemfile.lock | 1 + lib/ncbo_annotator.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bed91370..23a81362 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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