Skip to content

Commit

Permalink
Merge pull request #141 from ncbo/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master, release v5.29.0
  • Loading branch information
alexskr authored Mar 14, 2024
2 parents 8afc6d8 + 0dd8fc5 commit e829093
Show file tree
Hide file tree
Showing 12 changed files with 32,123 additions and 729 deletions.
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107
gem 'redcarpet'

# NCBO
gem 'goo', github: 'ncbo/goo', branch: 'master'
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'master'
gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'master'
gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'master'
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'master'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
gem 'goo', github: 'ncbo/goo', branch: 'develop'
gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'develop'
gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'develop'
gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'develop'
gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'develop'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'develop'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
Expand Down
86 changes: 44 additions & 42 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/ncbo/goo.git
revision: 75436fe8e387febc53e34ee31ff0e6dd837a9d3f
branch: master
revision: 4ea0e70a4361fc694700e11f1012129452278c7d
branch: develop
specs:
goo (0.0.2)
addressable (~> 2.8)
Expand All @@ -15,8 +15,8 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_annotator.git
revision: 63c986880aa88c9384043e6611a682434a14aba7
branch: master
revision: fe0783c542479ed0a12da5663ef28e1673e80eba
branch: develop
specs:
ncbo_annotator (0.0.1)
goo
Expand All @@ -26,8 +26,8 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_cron.git
revision: 46bd8e7eb7cfde6d173bdf55808a8e28d6700f1e
branch: master
revision: b5bc460250aa8a61e5825615e1337fb1dc46f335
branch: develop
specs:
ncbo_cron (0.0.1)
dante
Expand All @@ -42,8 +42,8 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_ontology_recommender.git
revision: 013abea4af3b10910ec661dbb358a4b6cae198a4
branch: master
revision: d047de0a9650df321db47300eba8ff8c195e0854
branch: develop
specs:
ncbo_ontology_recommender (0.0.1)
goo
Expand All @@ -53,8 +53,8 @@ GIT

GIT
remote: https://github.com/ncbo/ontologies_linked_data.git
revision: ec3236a71ff172579923245646d0ea058844794e
branch: master
revision: a973d62ca8be3a6cd86677d9bed24f361f580882
branch: develop
specs:
ontologies_linked_data (0.0.1)
activesupport
Expand All @@ -73,8 +73,8 @@ GIT

GIT
remote: https://github.com/ncbo/sparql-client.git
revision: d418d56a6c9ff5692f925b45739a2a1c66bca851
branch: master
revision: 55e7dbf858eb571c767bc67868f9af61663859cb
branch: develop
specs:
sparql-client (1.0.1)
json_pure (>= 1.4)
Expand Down Expand Up @@ -108,13 +108,13 @@ GEM
airbrussh (1.5.1)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
backports (3.24.1)
backports (3.25.0)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
bigdecimal (1.4.2)
builder (3.2.4)
capistrano (3.18.0)
capistrano (3.18.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -153,45 +153,45 @@ GEM
grpc (~> 1.59)
get_process_mem (0.2.7)
ffi (~> 1.0)
google-analytics-data (0.5.0)
google-analytics-data (0.6.0)
google-analytics-data-v1beta (>= 0.11, < 2.a)
google-cloud-core (~> 1.6)
google-analytics-data-v1beta (0.11.2)
google-analytics-data-v1beta (0.12.0)
gapic-common (>= 0.21.1, < 2.a)
google-cloud-errors (~> 1.0)
google-cloud-core (1.6.1)
google-cloud-core (1.7.0)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (2.1.1)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.3.1)
google-protobuf (3.25.2-aarch64-linux)
google-protobuf (3.25.2-arm64-darwin)
google-protobuf (3.25.2-x86_64-darwin)
google-protobuf (3.25.2-x86_64-linux)
googleapis-common-protos (1.4.0)
google-protobuf (~> 3.14)
googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27)
googleapis-common-protos-types (1.11.0)
google-cloud-errors (1.4.0)
google-protobuf (3.25.3-aarch64-linux)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x86_64-darwin)
google-protobuf (3.25.3-x86_64-linux)
googleapis-common-protos (1.5.0)
google-protobuf (~> 3.18)
googleauth (1.10.0)
googleapis-common-protos-types (~> 1.7)
grpc (~> 1.41)
googleapis-common-protos-types (1.13.0)
google-protobuf (~> 3.18)
googleauth (1.11.0)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.1)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.61.0-aarch64-linux)
grpc (1.62.0-aarch64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.61.0-arm64-darwin)
grpc (1.62.0-arm64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.61.0-x86_64-darwin)
grpc (1.62.0-x86_64-darwin)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
grpc (1.61.0-x86_64-linux)
grpc (1.62.0-x86_64-linux)
google-protobuf (~> 3.25)
googleapis-common-protos-types (~> 1.0)
haml (5.2.2)
Expand All @@ -206,10 +206,11 @@ GEM
json-schema (2.8.1)
addressable (>= 2.4)
json_pure (2.7.1)
jwt (2.7.1)
jwt (2.8.1)
base64
kgio (2.11.4)
language_server-protocol (3.17.0.3)
libxml-ruby (5.0.2)
libxml-ruby (5.0.3)
logger (1.6.0)
macaddr (1.7.2)
systemu (~> 2.6.5)
Expand All @@ -221,7 +222,7 @@ GEM
method_source (1.0.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0206)
mime-types-data (3.2024.0305)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-stub_any_instance (1.0.3)
Expand Down Expand Up @@ -271,7 +272,7 @@ GEM
rack (>= 0.4)
rack-cors (1.0.6)
rack (>= 1.6.0)
rack-mini-profiler (3.3.0)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-protection (1.5.5)
rack
Expand All @@ -286,7 +287,7 @@ GEM
redcarpet (3.6.0)
redis (5.1.0)
redis-client (>= 0.17.0)
redis-client (0.19.1)
redis-client (0.21.0)
connection_pool
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
Expand All @@ -303,26 +304,26 @@ GEM
rsolr (2.5.0)
builder (>= 2.1.2)
faraday (>= 0.9, < 3, != 2.0.0)
rubocop (1.60.2)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
ruby-progressbar (1.13.0)
ruby-xxHash (0.4.0.2)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (2.0.24)
tzinfo (>= 0.3.22)
signet (0.18.0)
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
Expand Down Expand Up @@ -374,6 +375,7 @@ PLATFORMS
aarch64-linux
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-18
x86_64-darwin-23
x86_64-linux

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ services:
- 4store

solr-ut:
image: ontoportal/solr-ut:0.0.2
image: ontoportal/solr-ut:0.1.0
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8983/solr/term_search_core1/admin/ping?wt=json | grep -iq '\"status\":\"OK\"}' || exit 1"]
start_period: 3s
Expand All @@ -114,7 +114,7 @@ services:
retries: 5

agraph-ut:
image: franzinc/agraph:v8.0.1
image: franzinc/agraph:v8.1.0
platform: linux/amd64
environment:
- AGRAPH_SUPER_USER=test
Expand Down
8 changes: 4 additions & 4 deletions helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ def populate_from_params(obj, params)

# Make sure everything is loaded
if obj.is_a?(LinkedData::Models::Base)
obj.bring_remaining unless !obj.exist?
obj.bring_remaining if obj.exist?
no_writable_attributes = obj.class.attributes(:all) - obj.class.attributes
params = params.reject {|k,v| no_writable_attributes.include? k.to_sym}
end

params.each do |attribute, value|
next if value.nil?

Expand Down Expand Up @@ -346,8 +347,7 @@ def uri_as_needed(id)
# If the setting is enabled, replace the URL prefix with the proper id prefix
# EX: http://stagedata.bioontology.org/ontologies/BRO would become http://data.bioontology.org/ontologies/BRO
def replace_url_prefix(id)
id = id.sub(LinkedData.settings.rest_url_prefix, LinkedData.settings.id_url_prefix) if LinkedData.settings.replace_url_prefix && id.start_with?(LinkedData.settings.rest_url_prefix)
id
LinkedData::Models::Base.replace_url_prefix_to_id(id)
end

def retrieve_latest_submissions(options = {})
Expand Down
10 changes: 3 additions & 7 deletions helpers/batch_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ def batch_class_lookup(class_id_by_ontology, goo_include)
class_id_to_ontology = Hash.new
class_id_by_ontology.keys.each do |ont_id_orig|
ont_id = ont_id_orig
if LinkedData.settings.replace_url_prefix && ont_id_orig.to_s.start_with?(LinkedData.settings.rest_url_prefix)
ont_id = ont_id_orig.sub(LinkedData.settings.rest_url_prefix, LinkedData.settings.id_url_prefix)
end
ont_id = LinkedData::Models::Base.replace_url_prefix_to_id(ont_id_orig.to_s)

if all_latest_by_id[ont_id]
latest_submissions << all_latest_by_id[ont_id]
all_class_ids << class_id_by_ontology[ont_id_orig]
Expand All @@ -43,10 +42,7 @@ def batch_class_lookup(class_id_by_ontology, goo_include)
ont_classes.each do |cls|
if class_id_to_ontology[cls.id.to_s]
ont_id_orig = class_id_to_ontology[cls.id.to_s]
ont_id = ont_id_orig
if LinkedData.settings.replace_url_prefix && ont_id_orig.to_s.start_with?(LinkedData.settings.rest_url_prefix)
ont_id = ont_id_orig.sub(LinkedData.settings.rest_url_prefix, LinkedData.settings.id_url_prefix)
end
ont_id = LinkedData::Models::Base.replace_url_prefix_to_id(ont_id_orig.to_s)
if all_latest_by_id[ont_id]
cls.submission = all_latest_by_id[ont_id]
to_reply << cls
Expand Down
12 changes: 7 additions & 5 deletions helpers/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module SearchHelper
"labelSuggestNgram" => MATCH_TYPE_LABEL,
MATCH_TYPE_LABELGENERATED => MATCH_TYPE_LABELGENERATED,
"labelGeneratedExact" => MATCH_TYPE_LABELGENERATED,
"labellabelGeneratedSuggestEdge" => MATCH_TYPE_LABELGENERATED,
"labellabelGeneratedSuggestNgram" => MATCH_TYPE_LABELGENERATED,
"labelGeneratedSuggestEdge" => MATCH_TYPE_LABELGENERATED,
"labelGeneratedSuggestNgram" => MATCH_TYPE_LABELGENERATED,
"notation" => "notation",
"cui" => "cui",
"semanticType" => "semanticType"
Expand All @@ -57,6 +57,7 @@ module SearchHelper
QUERYLESS_FIELDS_PARAMS = {
"ontologies" => nil,
"notation" => "notation",
"oboId" => "oboId",
"cui" => "cui",
"semantic_types" => "semanticType",
ONTOLOGY_TYPES_PARAM => "ontologyType",
Expand All @@ -65,6 +66,7 @@ module SearchHelper
}

QUERYLESS_FIELDS_STR = QUERYLESS_FIELDS_PARAMS.values.compact.join(" ")
QUERYLESS_FIELDS_STR_NO_IDS = QUERYLESS_FIELDS_STR.gsub(/(notation|oboId)\s/, '')

def get_term_search_query(text, params={})
validate_params_solr_population(ALLOWED_INCLUDES_PARAMS)
Expand Down Expand Up @@ -98,7 +100,7 @@ def get_term_search_query(text, params={})

if params[EXACT_MATCH_PARAM] == "true"
query = "\"#{solr_escape(text)}\""
params["qf"] = "resource_id^20 prefLabelExact^10 synonymExact #{QUERYLESS_FIELDS_STR}"
params["qf"] = "resource_id^20 notation^20 oboId^20 prefLabelExact^10 synonymExact #{QUERYLESS_FIELDS_STR_NO_IDS}"
params["hl.fl"] = "resource_id prefLabelExact synonymExact #{QUERYLESS_FIELDS_STR}"
elsif params[SUGGEST_PARAM] == "true" || text[-1] == '*'
text.gsub!(/\*+$/, '')
Expand All @@ -113,9 +115,9 @@ def get_term_search_query(text, params={})
else
query = solr_escape(text)
end

params["qf"] = "resource_id^100 prefLabelExact^90 prefLabel^70 synonymExact^50 synonym^10 #{QUERYLESS_FIELDS_STR}"
params["qf"] = "resource_id^100 notation^100 oboId^100 prefLabelExact^90 prefLabel^70 synonymExact^50 synonym^10 #{QUERYLESS_FIELDS_STR_NO_IDS}"
params["qf"] << " property" if params[INCLUDE_PROPERTIES_PARAM] == "true"
params["bq"] = "idAcronymMatch:true^80"
params["hl.fl"] = "resource_id prefLabelExact prefLabel synonymExact synonym #{QUERYLESS_FIELDS_STR}"
params["hl.fl"] = "#{params["hl.fl"]} property" if params[INCLUDE_PROPERTIES_PARAM] == "true"
end
Expand Down
2 changes: 2 additions & 0 deletions test/controllers/test_ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ def test_on_demand_ontology_pull
del.delete if del
stop_server
LinkedData.settings.enable_security = false
del = User.find("blocked").first
del.delete if del
end
end

Expand Down
Loading

0 comments on commit e829093

Please sign in to comment.