Skip to content

Commit

Permalink
Merge pull request #156 from ncbo/develop
Browse files Browse the repository at this point in the history
Develop to master merge
  • Loading branch information
alexskr authored Jul 25, 2024
2 parents 6d7643f + db96fed commit 02bcf36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helpers/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def populate_classes_from_search(classes, ontology_acronyms=nil)
doc[:submission] = old_class.submission
doc[:properties] = MultiJson.load(doc.delete(:propertyRaw)) if include_param_contains?(:properties)
instance = LinkedData::Models::Class.read_only(doc)
instance.prefLabel = instance.prefLabel.first if instance.prefLabel.is_a?(Array)
filter_language_attributes(@params, instance)
classes_hash[ont_uri_class_uri] = instance
end

Expand Down
4 changes: 2 additions & 2 deletions test/controllers/test_annotator_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ def test_default_properties_output
assert_equal 9, annotations.length
annotations.sort! { |a,b| a["annotatedClass"]["prefLabel"].first.downcase <=> b["annotatedClass"]["prefLabel"].first.downcase }
assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data", annotations.first["annotatedClass"]["@id"]
assert_equal "Aggregate Human Data", Array(annotations.first["annotatedClass"]["prefLabel"]).first
assert_equal "Aggregate Human Data", annotations.first["annotatedClass"]["prefLabel"]

params = {text: text, include: "prefLabel,definition"}
get "/annotator", params
assert last_response.ok?
annotations = MultiJson.load(last_response.body)
assert_equal 9, annotations.length
annotations.sort! { |a,b| Array(a["annotatedClass"]["prefLabel"]).first.downcase <=> Array(b["annotatedClass"]["prefLabel"]).first.downcase }
annotations.sort! { |a,b| a["annotatedClass"]["prefLabel"].downcase <=> b["annotatedClass"]["prefLabel"].downcase }
assert_equal "http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Aggregate_Human_Data", annotations.first["annotatedClass"]["@id"]
assert_equal ["A resource that provides data from clinical care that comprises combined data from multiple individual human subjects."], annotations.first["annotatedClass"]["definition"]
end
Expand Down

0 comments on commit 02bcf36

Please sign in to comment.