diff --git a/Gemfile.lock b/Gemfile.lock index d430872b..a926e745 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ncbo/goo.git - revision: f943ac33e87c55c88131c32d826ed5d39c89302c + revision: 39f67ab7fae7675b6ff417ace0ab923e40ffcbcd branch: master specs: goo (0.0.2) @@ -16,7 +16,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 9ab4be437ed84f5a480e7f0d8799824fcea310ae + revision: 536cbe5cef9e23abc299ed44942c0b3966f9c18d branch: master specs: ontologies_linked_data (0.0.1) @@ -63,7 +63,7 @@ GEM concurrent-ruby (1.3.4) connection_pool (2.4.1) cube-ruby (0.0.3) - date (3.3.4) + date (3.4.0) docile (1.4.1) domain_name (0.6.20240107) faraday (2.8.1) @@ -77,8 +77,8 @@ GEM domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.7.2) - json_pure (2.7.2) + json (2.8.2) + json_pure (2.8.1) libxml-ruby (5.0.3) logger (1.6.1) macaddr (1.7.2) @@ -92,12 +92,12 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1001) + mime-types-data (3.2024.1105) mini_mime (1.1.5) minitest (4.7.5) multi_json (1.15.0) net-http-persistent (2.9.4) - net-imap (0.4.16) + net-imap (0.4.18) date net-protocol net-pop (0.1.2) @@ -107,19 +107,19 @@ GEM net-smtp (0.5.0) net-protocol netrc (0.11.0) - oj (3.16.6) + oj (3.16.7) bigdecimal (>= 3.0) ostruct (>= 0.2) omni_logger (0.1.4) logger - ostruct (0.6.0) + ostruct (0.6.1) pony (1.13.1) mail (>= 2.0) - pry (0.14.2) + pry (0.15.0) coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.1.1) - rack (3.1.7) + rack (3.1.8) rack-test (2.1.0) rack (>= 1.3) rake (10.5.0) @@ -136,7 +136,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.3.8) + rexml (3.3.9) rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) @@ -154,7 +154,7 @@ GEM simplecov_json_formatter (0.1.4) systemu (2.6.5) thread_safe (0.3.6) - timeout (0.4.1) + timeout (0.4.2) tzinfo (0.3.62) uuid (2.3.9) macaddr (~> 1.0) diff --git a/docker-compose.yml b/docker-compose.yml index 6c55b6bd..2215312d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,7 +80,7 @@ services: retries: 10 mgrep-ut: - image: ontoportal/mgrep:0.0.2 + image: ontoportal/mgrep:0.0.3 platform: linux/amd64 healthcheck: test: ["CMD", "nc", "-z", "-v", "127.0.0.1", "55556"] diff --git a/lib/ncbo_annotator.rb b/lib/ncbo_annotator.rb index e1e76c3b..5f69c43f 100644 --- a/lib/ncbo_annotator.rb +++ b/lib/ncbo_annotator.rb @@ -14,7 +14,6 @@ require_relative 'ncbo_annotator/mgrep/mgrep' require_relative 'ncbo_annotator/config' require_relative 'ncbo_annotator/monkeypatches' -require_relative 'ncbo_recommender' # Require all models project_root = File.dirname(File.absolute_path(__FILE__)) @@ -340,7 +339,7 @@ def create_term_cache_for_submission(logger, sub, redis=nil, redis_prefix=nil) resourceId, Annotator::Annotation::MATCH_TYPES[:type_synonym], syn, - semanticTypes) unless (syn.casecmp(prefLabel) == 0) + semanticTypes) unless (syn.to_s.casecmp(prefLabel) == 0) end create_term_entry(redis, redis_prefix, @@ -662,11 +661,11 @@ 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.to_s.upcase!() rescue ArgumentError => e # NCBO-832 - SCTSPA Annotator Cache building error (UTF-8) val = val.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') - val.upcase!() + val.to_s.upcase!() end # exclude single-character or empty/null values diff --git a/lib/ncbo_recommender.rb b/lib/ncbo_recommender.rb deleted file mode 100644 index 03e72d74..00000000 --- a/lib/ncbo_recommender.rb +++ /dev/null @@ -1,88 +0,0 @@ -require 'logger' -require 'ontologies_linked_data' -require_relative 'recommendation' - -module Recommender - module Models - - class NcboRecommender - - def initialize() - @logger = Kernel.const_defined?("LOGGER") ? Kernel.const_get("LOGGER") : Logger.new(STDOUT) - end - - DEFAULT_HIERARCHY_LEVELS = 5 - - def recommend(text, ontologies=[], include_classes=false) - annotator = Annotator::Models::NcboAnnotator.new - annotations = annotator.annotate(text, { - ontologies: ontologies, - semantic_types: [], - filter_integers: false, - expand_class_hierarchy: true, - expand_hierarchy_levels: DEFAULT_HIERARCHY_LEVELS, - expand_with_mappings: false, - min_term_size: nil, - whole_word_only: true, - with_synonyms: true - }) - - recommendations = {} - classes_matched = [] - - annotations.each do |ann| - classId = ann.annotatedClass.id.to_s - ont = ann.annotatedClass.submission.ontology - ontologyId = ont.id.to_s - - unless recommendations.include?(ontologyId) - cls_count = get_ontology_class_count(ont) - next if cls_count <= 0 # skip any ontologies without a ready latest submission - recommendations[ontologyId] = Recommendation.new - recommendations[ontologyId].ontology = ont - recommendations[ontologyId].numTermsTotal = cls_count - end - - rec = recommendations[ontologyId] - cls_ont_key = "#{classId}_#{ontologyId}" - unless classes_matched.include?(cls_ont_key) - classes_matched << cls_ont_key - rec.annotatedClasses << ann.annotatedClass if include_classes - rec.numTermsMatched += 1 - end - rec.increment_score(ann) - end - - recommendations.values.each {|v| v.normalize_score} - return recommendations.values.sort {|a,b| b.score <=> a.score} - end - - - private - - def get_ontology_class_count(ont) - sub = nil - begin - #TODO: there appears to be a bug that does not allow retrieving submission by its id - # because the id is incorrect. The workaround is to get the ontology object and - # then retrieve its latest submission. - sub = LinkedData::Models::Ontology.find(ont.id).first.latest_submission - rescue - @logger.error("Unable to retrieve latest submission for #{ont.id.to_s} in Recommender.") - end - return 0 if sub.nil? - begin - sub.bring(metrics: LinkedData::Models::Metric.attributes) - cls_count = sub.metrics.classes - rescue - @logger.error("Unable to retrieve metrics for latest submission of #{ont.id.to_s} in Recommender.") - cls_count = LinkedData::Models::Class.where.in(sub).count - end - return cls_count || 0 - end - - - end - - end -end diff --git a/lib/recommendation.rb b/lib/recommendation.rb deleted file mode 100644 index 3ced1ded..00000000 --- a/lib/recommendation.rb +++ /dev/null @@ -1,35 +0,0 @@ -module Recommender - - class Recommendation - - include LinkedData::Hypermedia::Resource - - attr_accessor :ontology, :score, :numTermsMatched, :numTermsTotal, :annotatedClasses - - embed :annotatedClasses - - def initialize - @score = 0 - @numTermsMatched = 0 - @numTermsTotal = 0 - @annotatedClasses = [] - end - - def increment_score(annotation) - annotation.annotations.each do |occ| - if occ[:matchType] == "PREF" - @score += 10 - elsif occ[:matchType] == "SYN" - @score += 5 - end - end - @score += annotation.hierarchy.length * 2 - end - - def normalize_score() - @score = (@score / Math.log10(@numTermsTotal)).round(2) - end - - end - -end \ No newline at end of file diff --git a/test/test_annotator.rb b/test/test_annotator.rb index f63e0235..58ca9718 100644 --- a/test/test_annotator.rb +++ b/test/test_annotator.rb @@ -251,16 +251,17 @@ def test_annotate with_synonyms: true }) direct = annotations - assert direct.length >= size && direct.length > 0 + assert_operator 0, :<, direct.length + assert_operator size, :<, direct.length found = 0 class_page.each do |cls| if cls.prefLabel.length > 2 #TODO: This assertion may fail if the dictionary file on mgrep server does not contain the terms from the test ontologies - assert (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length > 0 + assert_operator 0, :<, (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length, "expected to find #{cls.id}" found += 1 end end - assert found >= size + assert_operator size, :<=, found end # test for a specific class annotation @@ -279,12 +280,12 @@ def test_annotate with_synonyms: true }) - assert annotations.length == 1 - assert annotations.first.annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Storage" - assert annotations.first.annotations.length == 1 - assert annotations.first.annotations.first[:from] == 1 - assert annotations.first.annotations.first[:to] == term_text.length - assert text[annotations.first.annotations.first[:from] - 1, annotations.first.annotations.first[:to]] == term_text + assert_equal 1, annotations.length + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Storage", annotations.first.annotatedClass.id.to_s + assert_equal 1, annotations.first.annotations.length + assert_equal 1, annotations.first.annotations.first[:from] + assert_equal term_text.length, annotations.first.annotations.first[:to] + assert_equal term_text, text[annotations.first.annotations.first[:from] - 1, annotations.first.annotations.first[:to]] # check for a non-existent ontology non_existent_ont = ["DOESNOTEXIST"] @@ -370,14 +371,15 @@ def test_annotate_minsize_term }) direct = annotations - assert direct.length >= size && direct.length > 0 + assert_operator 0, :<, direct.length + assert_operator size, :<, direct.length found = 0 filter_out_next = [] must_be_next = [] class_page.each do |cls| if cls.prefLabel.length > 2 #TODO: This assertion may fail if the dictionary file on mgrep server does not contain the terms from the test ontologies - assert (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length > 0 + assert_operator 0, :<, (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length found += 1 if cls.prefLabel.length < 10 filter_out_next << cls @@ -403,12 +405,13 @@ def test_annotate_minsize_term direct = annotations filter_out_next.each do |cls| - assert (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length == 0 + assert_equal 0, (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length end must_be_next.each do |cls| - assert (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length > 0 + assert_operator 0, :<, (direct.select { |x| x.annotatedClass.id.to_s == cls.id.to_s }).length end - assert must_be_next.length > 0 && filter_out_next.length > 0 + assert_operator 0, :<, must_be_next.length + assert_operator 0, :<, filter_out_next.length end def test_annotate_stop_words @@ -430,7 +433,7 @@ def test_annotate_stop_words "http://purl.obolibrary.org/obo/MCBCC_0000296#Deletion"] not_show.each do |cls| - assert (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length > 0 + assert_operator 0, :<, (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length end #annotation should not show up @@ -449,7 +452,7 @@ def test_annotate_stop_words }) not_show.each do |cls| - assert (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length == 0 + assert_equal 0, (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length end #empty array must annotate all @@ -468,7 +471,7 @@ def test_annotate_stop_words }) not_show.each do |cls| - assert (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length > 0 + assert_operator 0, :<, (annotations.select { |x| x.annotatedClass.id.to_s == cls }).length end end @@ -477,16 +480,16 @@ def test_annotate_hierarchy text = "Aggregate Human Data Aggregate Human Data" annotator = Annotator::Models::NcboAnnotator.new annotations = annotator.annotate(text) - assert annotations.length == 1 - assert annotations.first.annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data" - assert annotations.first.annotatedClass.submission.ontology.acronym == "BROTEST-0" - assert annotations.first.annotations.length == 2 - assert annotations.first.annotations.first[:from] = 1 - assert annotations.first.annotations.first[:to] = 1+("Aggregate Human Data".length) - assert annotations.first.annotations[1][:from] = 2 + ("Aggregate Human Data".length) - assert text[annotations.first.annotations.first[:from]-1,annotations.first.annotations.first[:to]-1] == "Aggregate Human Data" - assert annotations.first.annotations[1][:to] == (1 + ("Aggregate Human Data".length)) + ("Aggregate Human Data".length) - assert text[annotations.first.annotations[1][:from]-1,annotations.first.annotations[1][:to]-1] == "Aggregate Human Data" + assert_equal 1, annotations.length + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data", annotations.first.annotatedClass.id.to_s + assert_equal "BROTEST-0", annotations.first.annotatedClass.submission.ontology.acronym + assert_equal 2, annotations.first.annotations.length + assert_equal 1, annotations.first.annotations.first[:from] + assert_equal "Aggregate Human Data".length, annotations.first.annotations.first[:to] + assert_equal 2 + ("Aggregate Human Data".length), annotations.first.annotations[1][:from] + assert_equal "Aggregate Human Data", text[annotations.first.annotations.first[:from]-1,annotations.first.annotations.first[:to]] + assert_equal (1 + ("Aggregate Human Data".length)) + ("Aggregate Human Data".length), annotations.first.annotations[1][:to] + assert_equal "Aggregate Human Data", text[annotations.first.annotations[1][:from]-1,annotations.first.annotations[1][:to]-1] annotations = annotator.annotate(text, { ontologies: [], semantic_types: [], @@ -499,16 +502,16 @@ def test_annotate_hierarchy with_synonyms: true }) - assert annotations.length == 1 - assert annotations.first.annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data" - assert annotations.first.annotatedClass.submission.ontology.acronym == "BROTEST-0" - assert annotations.first.annotations.length == 2 - assert annotations.first.annotations.first[:from] = 1 - assert annotations.first.annotations.first[:to] = 1+("Aggregate Human Data".length) + assert_equal 1, annotations.length + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data", annotations.first.annotatedClass.id.to_s + assert_equal "BROTEST-0", annotations.first.annotatedClass.submission.ontology.acronym + assert_equal 2, annotations.first.annotations.length + assert_equal 1, annotations.first.annotations.first[:from] + assert_equal "Aggregate Human Data".length, annotations.first.annotations.first[:to] - assert annotations.first.hierarchy.length == 1 - assert annotations.first.hierarchy.first.annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Clinical_Care_Data" - assert annotations.first.hierarchy.first.distance == 1 + assert_equal 1, annotations.first.hierarchy.length + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Clinical_Care_Data", annotations.first.hierarchy.first.annotatedClass.id.to_s + assert_equal 1, annotations.first.hierarchy.first.distance annotations = annotator.annotate(text, { ontologies: [], semantic_types: [], @@ -521,13 +524,13 @@ def test_annotate_hierarchy with_synonyms: true }) - assert annotations.first.hierarchy.length == 3 - assert annotations.first.hierarchy.first.annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Clinical_Care_Data" - assert annotations.first.hierarchy.first.distance == 1 - assert annotations.first.hierarchy[1].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Resource" - assert annotations.first.hierarchy[1].distance == 2 - assert annotations.first.hierarchy[2].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Information_Resource" - assert annotations.first.hierarchy[2].distance == 3 + assert_equal 3, annotations.first.hierarchy.length + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Clinical_Care_Data", annotations.first.hierarchy.first.annotatedClass.id.to_s + assert_equal 1, annotations.first.hierarchy.first.distance + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Resource", annotations.first.hierarchy[1].annotatedClass.id.to_s + assert_equal 2, annotations.first.hierarchy[1].distance + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Information_Resource", annotations.first.hierarchy[2].annotatedClass.id.to_s + assert_equal 3, annotations.first.hierarchy[2].distance end def test_annotate_hierachy_terms_multiple @@ -546,56 +549,56 @@ def test_annotate_hierachy_terms_multiple with_synonyms: true }) - assert annotations[0].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data" - assert annotations[0].annotations.length == 3 - assert annotations[0].hierarchy.length == 4 + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data", annotations[0].annotatedClass.id.to_s + assert_equal 3, annotations[0].annotations.length + assert_equal 4, annotations[0].hierarchy.length hhh = annotations[0].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } hhh.sort! - assert hhh == [ + assert_equal [ "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Information_Resource", "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Clinical_Care_Data", "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Resource" - ].sort + ].sort, hhh - assert annotations[1].annotatedClass.id.to_s == "http://purl.obolibrary.org/obo/MCBCC_0000288#ChromosomalMutation" - assert annotations[1].annotations.length == 2 + assert_equal "http://purl.obolibrary.org/obo/MCBCC_0000288#ChromosomalMutation", annotations[1].annotatedClass.id.to_s + assert_equal 2, annotations[1].annotations.length hhh = annotations[1].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - hhh == ["http://purl.obolibrary.org/obo/MCBCC_0000287#GeneticVariation"] + assert_equal ["http://purl.obolibrary.org/obo/MCBCC_0000287#GeneticVariation"], hhh - assert annotations[2].annotatedClass.id.to_s == "http://purl.obolibrary.org/obo/MCBCC_0000289#ChromosomalDeletion" - assert annotations[2].annotations.length == 1 + assert_equal "http://purl.obolibrary.org/obo/MCBCC_0000289#ChromosomalDeletion", annotations[2].annotatedClass.id.to_s + assert_equal 1, annotations[2].annotations.length hhh = annotations[2].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } assert hhh == ["http://purl.obolibrary.org/obo/MCBCC_0000287#GeneticVariation", "http://purl.obolibrary.org/obo/MCBCC_0000288#ChromosomalMutation"] - assert annotations[3].annotatedClass.id.to_s == "http://purl.obolibrary.org/obo/MCBCC_0000296#Deletion" + assert_equal "http://purl.obolibrary.org/obo/MCBCC_0000296#Deletion", annotations[3].annotatedClass.id.to_s hhh = annotations[3].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh = ["http://purl.obolibrary.org/obo/MCBCC_0000287#GeneticVariation", - "http://purl.obolibrary.org/obo/MCBCC_0000295#GeneMutation"] + assert_equal ["http://purl.obolibrary.org/obo/MCBCC_0000287#GeneticVariation", + "http://purl.obolibrary.org/obo/MCBCC_0000295#GeneMutation"], hhh - assert annotations[4].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Resource" + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Data_Resource", annotations[4].annotatedClass.id.to_s hhh = annotations[4].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh == ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", - "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Information_Resource"] + assert_equal ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", + "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Information_Resource"], hhh - assert annotations[5].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource" + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", annotations[5].annotatedClass.id.to_s hhh = annotations[5].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh == [] #root + assert_empty hhh - assert annotations[6].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Federal_Funding_Resource" + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Federal_Funding_Resource", annotations[6].annotatedClass.id.to_s hhh = annotations[6].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh == ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", - "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Funding_Resource"] + assert_equal ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource", + "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Funding_Resource"], hhh - assert annotations[7].annotatedClass.id.to_s == "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Funding_Resource" + assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Funding_Resource", annotations[7].annotatedClass.id.to_s hhh = annotations[7].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh == ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource" ] + assert_equal ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Resource" ], hhh - assert annotations[8].annotatedClass.id.to_s == "http://purl.obolibrary.org/obo/MCBCC_0000275#ReceptorAntagonists" + assert_equal "http://purl.obolibrary.org/obo/MCBCC_0000275#ReceptorAntagonists", annotations[8].annotatedClass.id.to_s hhh = annotations[8].hierarchy.sort {|x| x.distance }.map { |x| x.annotatedClass.id.to_s } - assert hhh == ["http://purl.obolibrary.org/obo/MCBCC_0000256#ChemicalsAndDrugs"] + assert_equal ["http://purl.obolibrary.org/obo/MCBCC_0000256#ChemicalsAndDrugs"], hhh end diff --git a/test/test_recommender.rb b/test/test_recommender.rb deleted file mode 100644 index b3c4bca3..00000000 --- a/test/test_recommender.rb +++ /dev/null @@ -1,47 +0,0 @@ -require_relative 'test_case' -require 'json' -require 'redis' - -class TestRecommender < TestCase - - def self.before_suite - @@text = < 0, msg='Failed to return annotatedClasses') - end - end - -end -