Skip to content

Commit

Permalink
Revert "Merge branch 'pr/refactor/use-replace-url-prefix' of https://…
Browse files Browse the repository at this point in the history
…github.com/ontoportal-lirmm/ontologies_api"

This reverts commit 38a3b7e, reversing
changes made to 3e72043.
  • Loading branch information
alexskr committed Feb 10, 2024
1 parent 38a3b7e commit 8afc6d8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 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: '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'
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'

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
24 changes: 12 additions & 12 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: 7a897a8e9c01d3a412d9011df8e26d770d58cd7d
branch: develop
revision: 75436fe8e387febc53e34ee31ff0e6dd837a9d3f
branch: master
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: f60341e8426adcad447a6fc3adb5b80207c5987a
branch: develop
revision: 63c986880aa88c9384043e6611a682434a14aba7
branch: master
specs:
ncbo_annotator (0.0.1)
goo
Expand All @@ -26,8 +26,8 @@ GIT

GIT
remote: https://github.com/ncbo/ncbo_cron.git
revision: 6185e9f59f35fe131bf53624ef82dd8e399e5448
branch: develop
revision: 46bd8e7eb7cfde6d173bdf55808a8e28d6700f1e
branch: master
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: 41e61ddccdde09a45961b0f2bf7ad0ddb18b382e
branch: develop
revision: 013abea4af3b10910ec661dbb358a4b6cae198a4
branch: master
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: c77d0b390e19c394989e9467e447fcc653b53fa5
branch: develop
revision: ec3236a71ff172579923245646d0ea058844794e
branch: master
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: 55e7dbf858eb571c767bc67868f9af61663859cb
branch: develop
revision: d418d56a6c9ff5692f925b45739a2a1c66bca851
branch: master
specs:
sparql-client (1.0.1)
json_pure (>= 1.4)
Expand Down
3 changes: 2 additions & 1 deletion helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ 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)
LinkedData::Models::Base.replace_url_prefix_to_id(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
end

def retrieve_latest_submissions(options = {})
Expand Down
10 changes: 7 additions & 3 deletions helpers/batch_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ 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
ont_id = LinkedData::Models::Base.replace_url_prefix_to_id(ont_id_orig.to_s)

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
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 @@ -42,7 +43,10 @@ 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 = LinkedData::Models::Base.replace_url_prefix_to_id(ont_id_orig.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
if all_latest_by_id[ont_id]
cls.submission = all_latest_by_id[ont_id]
to_reply << cls
Expand Down

0 comments on commit 8afc6d8

Please sign in to comment.