From 2b1210b2a807b333695c1fa4571e605737ef3b41 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Mon, 1 Jan 2024 20:27:30 +0100 Subject: [PATCH 1/8] fix the object analytics fetching after the new year change (#19) --- Gemfile.lock | 4 ++-- bin/import_google_ua_analytics_data | 12 ++++++++---- lib/ncbo_cron/analytics/object_analytics.rb | 19 ++++++++++++------- .../analytics/page_visits_analytics.rb | 4 ++-- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c65a2e6a..30e9e614 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,7 +26,7 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git - revision: e98b884999e5ce917a8be5fdc37f7b4797a1559e + revision: c6d681dcb05e3d88c6c17baff42c5581871e39ac branch: master specs: ontologies_linked_data (0.0.1) @@ -282,4 +282,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.3.23 + 2.3.15 diff --git a/bin/import_google_ua_analytics_data b/bin/import_google_ua_analytics_data index eadfd936..efc216d1 100755 --- a/bin/import_google_ua_analytics_data +++ b/bin/import_google_ua_analytics_data @@ -41,9 +41,10 @@ module NcboCron (start_year..Date.today.year).each do |y| aggregated_results[acronym] = Hash.new if aggregated_results[acronym].nil? aggregated_results[acronym][y.to_s] = Hash.new unless aggregated_results[acronym].has_key?(y.to_s) + # fill up non existent months with zeros + last_month = y.eql?(Date.today.year) ? Date.today.month : 12 + (1..last_month).each { |n| aggregated_results[acronym][y.to_s][n.to_s] = 0 if aggregated_results[acronym][y.to_s].is_a?(Hash) && !aggregated_results[acronym][y.to_s].has_key?(n.to_s)} end - # fill up non existent months with zeros - (1..12).each { |n| aggregated_results[acronym].values.each { |v| v[n.to_s] = 0 unless v.has_key?(n.to_s) } } break end end @@ -82,9 +83,12 @@ module NcboCron (start_year..Date.today.year).each do |y| aggregated_results = Hash.new if aggregated_results.nil? aggregated_results[y.to_s] = Hash.new unless aggregated_results.has_key?(y.to_s) + + # fill up non existent months with zeros + last_month = y.eql?(Date.today.year) ? Date.today.month.to_i : 12 + (1..last_month).each { |n| aggregated_results[y.to_s][n.to_s] = 0 if aggregated_results[y.to_s].is_a?(Hash) && !aggregated_results[y.to_s].has_key?(n.to_s)} end - # fill up non existent months with zeros - (1..12).each { |n| aggregated_results.values.each { |v| v[n.to_s] = 0 unless v.has_key?(n.to_s) } } + break end end diff --git a/lib/ncbo_cron/analytics/object_analytics.rb b/lib/ncbo_cron/analytics/object_analytics.rb index c4254db7..12765d96 100644 --- a/lib/ncbo_cron/analytics/object_analytics.rb +++ b/lib/ncbo_cron/analytics/object_analytics.rb @@ -123,7 +123,8 @@ def merge_and_fill_missing_data(new_data, old_data,logger, start_date = @start_d year = year.to_s if new_data[acronym].has_key?(year) if old_data[acronym].has_key?(year) - (1..Date.today.month).each do |month| + last_month = year.eql?(Date.today.year.to_s) ? Date.today.month : 12 + (1..last_month).each do |month| month = month.to_s old_data[acronym][year][month] ||= 0 unless old_data[acronym][year][month].eql?(new_data[acronym][year][month]) @@ -144,9 +145,7 @@ def merge_and_fill_missing_data(new_data, old_data,logger, start_date = @start_d logger.info "Filling in missing years data..." old_data = fill_missing_data(old_data) end - - # sort_ga_data(old_data) - old_data + sort_ga_data(old_data) end def aggregate_results(aggregated_results, results) @@ -179,16 +178,22 @@ def fill_missing_data(ga_data) (start_year..Date.today.year).each do |y| ga_data[acronym] = Hash.new if ga_data[acronym].nil? ga_data[acronym][y.to_s] = Hash.new unless ga_data[acronym].has_key?(y.to_s) + + # fill up non existent months with zeros + last_month = y.eql?(Date.today.year) ? Date.today.month.to_i : 12 + (1..last_month).each { |n| ga_data[acronym][y.to_s][n.to_s] = 0 if ga_data[acronym][y.to_s].is_a?(Hash) && !ga_data[acronym][y.to_s].has_key?(n.to_s) } end - # fill up non existent months with zeros - (1..12).each { |n| ga_data[acronym].values.each { |v| v[n.to_s] = 0 if v.is_a?(Hash) && !v.has_key?(n.to_s) } } end end def sort_ga_data(ga_data) ga_data.transform_values { |value| value.transform_values { |val| - val.sort_by { |key, _| key.to_i }.to_h + if val.is_a?(Hash) + val.sort_by { |key, _| key.to_i }.to_h + else + val + end }.sort_by { |k, _| k.to_i }.to_h }.sort.to_h end diff --git a/lib/ncbo_cron/analytics/page_visits_analytics.rb b/lib/ncbo_cron/analytics/page_visits_analytics.rb index b2354c00..fd88588a 100644 --- a/lib/ncbo_cron/analytics/page_visits_analytics.rb +++ b/lib/ncbo_cron/analytics/page_visits_analytics.rb @@ -6,8 +6,8 @@ module NcboCron module Models class PageVisitsAnalytics < ObjectAnalytics - def initialize(start_date: Date.today.prev_month, old_data: {}) - super(redis_field: 'pages_analytics', start_date: Date.today.prev_month, old_data: { }) + def initialize(start_date: Date.today.prev_month.to_s, old_data: {}) + super(redis_field: 'pages_analytics', start_date: Date.today.prev_month.to_s, old_data: { }) end private From 4dc2c2233e4dcea575bc248242a0cb5abb92c1d1 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Fri, 5 Jan 2024 09:11:45 +0100 Subject: [PATCH 2/8] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f47ff304..7112f0f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -135,7 +135,6 @@ GEM google-cloud-env (2.1.0) faraday (>= 1.0, < 3.a) google-cloud-errors (1.3.1) - google-protobuf (3.25.1-x86_64-darwin) google-protobuf (3.25.1-x86_64-linux) googleapis-common-protos (1.4.0) google-protobuf (~> 3.14) @@ -150,9 +149,6 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.60.0-x86_64-darwin) - google-protobuf (~> 3.25) - googleapis-common-protos-types (~> 1.0) grpc (1.60.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) @@ -175,7 +171,7 @@ GEM mail (2.6.6) mime-types (>= 1.16, < 4) method_source (1.0.0) - mime-types (3.5.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) mini_mime (1.1.5) @@ -256,7 +252,6 @@ GEM webrick (1.8.1) PLATFORMS - x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -288,4 +283,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.4.21 + 2.3.15 From 5bf8a237421cf3483604ea83ec20e46d6a5e59ad Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Sat, 17 Feb 2024 09:03:16 +0000 Subject: [PATCH 3/8] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 54 +++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7112f0f6..69f601f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: 03da25b671d2ffa515b5dce51c6bd35980ae60c7 + revision: 8ddd2d719617ad082c6964a9efdac153cdd2b48e branch: master specs: goo (0.0.2) @@ -26,7 +26,7 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git - revision: c6d681dcb05e3d88c6c17baff42c5581871e39ac + revision: 95e77989e4e8ea2fde86cf4f048f7d6cd7a6829f branch: master specs: ontologies_linked_data (0.0.1) @@ -79,19 +79,19 @@ GEM public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.5) + bigdecimal (3.1.6) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) builder (3.2.4) coderay (1.1.3) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) cube-ruby (0.0.3) dante (0.2.0) debug_inspector (1.2.0) declarative (0.0.20) docile (1.4.0) - domain_name (0.6.20231109) + domain_name (0.6.20240107) email_spec (2.1.1) htmlentities (~> 4.3.3) launchy (~> 2.1) @@ -112,44 +112,43 @@ GEM googleapis-common-protos-types (>= 1.11.0, < 2.a) googleauth (~> 1.9) grpc (~> 1.59) - google-analytics-data (0.4.0) - google-analytics-data-v1beta (>= 0.7, < 2.a) + google-analytics-data (0.5.0) + google-analytics-data-v1beta (>= 0.11, < 2.a) google-cloud-core (~> 1.6) - google-analytics-data-v1beta (0.10.0) - gapic-common (>= 0.20.0, < 2.a) + google-analytics-data-v1beta (0.11.2) + gapic-common (>= 0.21.1, < 2.a) google-cloud-errors (~> 1.0) - google-apis-analytics_v3 (0.13.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.2) + google-apis-analytics_v3 (0.14.0) + google-apis-core (>= 0.12.0, < 2.a) + google-apis-core (0.13.0) addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) + googleauth (~> 1.9) httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick google-cloud-core (1.6.1) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (2.1.0) + google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.3.1) - google-protobuf (3.25.1-x86_64-linux) + google-protobuf (3.25.3-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) + googleapis-common-protos-types (1.12.0) google-protobuf (~> 3.18) - googleauth (1.9.1) + 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.60.0-x86_64-linux) + grpc (1.61.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) htmlentities (4.3.4) @@ -164,7 +163,7 @@ GEM jwt (2.7.1) launchy (2.5.2) addressable (~> 2.8) - libxml-ruby (4.1.2) + libxml-ruby (5.0.2) logger (1.6.0) macaddr (1.7.2) systemu (~> 2.6.5) @@ -173,7 +172,7 @@ GEM method_source (1.0.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) + mime-types-data (3.2024.0206) mini_mime (1.1.5) minitest (4.7.5) mlanett-redis-lock (0.2.7) @@ -193,21 +192,21 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.0.4) - rack (3.0.8) + rack (3.0.9) rack-test (2.1.0) rack (>= 1.3) rake (13.1.0) rdf (1.0.8) addressable (>= 2.2) - redis (5.0.8) + redis (5.1.0) redis-client (>= 0.17.0) - redis-client (0.19.1) + redis-client (0.20.0) connection_pool representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - request_store (1.5.1) + request_store (1.6.0) rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -224,7 +223,7 @@ GEM 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) @@ -249,7 +248,6 @@ GEM uber (0.1.0) uuid (2.3.9) macaddr (~> 1.0) - webrick (1.8.1) PLATFORMS x86_64-linux @@ -283,4 +281,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.3.15 + 2.3.14 From 488ed371d51f4e7f28cf2fa4bb15ffdf72b84500 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Fri, 26 Apr 2024 10:54:21 +0200 Subject: [PATCH 4/8] Feature: add index all data step to the processing queue (#21) * update the docker-based running tests script * add :index_all_data step the process actions * update github action test CI to do it using all the backends --- .github/workflows/ruby-unit-tests.yml | 47 +- Gemfile | 8 +- Gemfile.lock | 116 +- config/config.rb.sample | 11 +- config/solr/property_search/enumsconfig.xml | 12 - .../mapping-ISOLatin1Accent.txt | 246 ---- config/solr/property_search/schema.xml | 1179 --------------- config/solr/property_search/solrconfig.xml | 1299 ----------------- config/solr/solr.xml | 60 - config/solr/term_search/enumsconfig.xml | 12 - .../term_search/mapping-ISOLatin1Accent.txt | 246 ---- config/solr/term_search/schema.xml | 1222 ---------------- config/solr/term_search/solrconfig.xml | 1299 ----------------- docker-compose.yml | 179 +-- lib/ncbo_cron/ontology_helper.rb | 1 + rakelib/annotator_management.rake | 25 +- rakelib/docker_based_test.rake | 120 ++ rakelib/group_management.rake | 4 +- rakelib/purl_management.rake | 3 +- rakelib/user_management.rake | 8 +- test/data/graphdb-repo-config.ttl | 33 + test/data/graphdb-test-load.nt | 0 test/test_case.rb | 16 +- test/test_ontology_submission_parser.rb | 10 +- 24 files changed, 405 insertions(+), 5751 deletions(-) delete mode 100644 config/solr/property_search/enumsconfig.xml delete mode 100644 config/solr/property_search/mapping-ISOLatin1Accent.txt delete mode 100644 config/solr/property_search/schema.xml delete mode 100644 config/solr/property_search/solrconfig.xml delete mode 100644 config/solr/solr.xml delete mode 100644 config/solr/term_search/enumsconfig.xml delete mode 100644 config/solr/term_search/mapping-ISOLatin1Accent.txt delete mode 100644 config/solr/term_search/schema.xml delete mode 100644 config/solr/term_search/solrconfig.xml create mode 100644 rakelib/docker_based_test.rake create mode 100644 test/data/graphdb-repo-config.ttl create mode 100644 test/data/graphdb-test-load.nt diff --git a/.github/workflows/ruby-unit-tests.yml b/.github/workflows/ruby-unit-tests.yml index 8a420ba1..1ade7407 100644 --- a/.github/workflows/ruby-unit-tests.yml +++ b/.github/workflows/ruby-unit-tests.yml @@ -9,22 +9,35 @@ jobs: strategy: fail-fast: false matrix: - backend: ['ncbo_cron'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend + goo-slice: [ '20', '100', '500' ] + ruby-version: [ '2.7' ] + triplestore: [ 'fs', 'ag', 'vo', 'gb' ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: copy config.rb file from template - run: cp config/config.rb.sample config/config.rb - - name: Build docker-compose - run: docker-compose build - - name: Run unit tests - run: | - ci_env=`bash <(curl -s https://codecov.io/env)` - docker-compose run $ci_env -e CI --rm ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v' - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - with: - flags: unittests - verbose: true - fail_ci_if_error: false # optional (default = false) - + - uses: actions/checkout@v3 + - name: create config.rb file + run: cp config/config.rb.sample config/config.rb + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get -y install raptor2-utils + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run unit tests + # unit tests are run inside a container + # http://docs.codecov.io/docs/testing-with-docker + run: | + ci_env=`bash <(curl -s https://codecov.io/env)` + GOO_SLICES=${{ matrix.goo-slice }} bundle exec rake test:docker:${{ matrix.triplestore }} TESTOPTS="-v" + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + flags: unittests + verbose: true + fail_ci_if_error: false # optional (default = false) diff --git a/Gemfile b/Gemfile index 54646cf4..a11b3d4d 100644 --- a/Gemfile +++ b/Gemfile @@ -21,14 +21,16 @@ gem 'redis' gem 'rest-client' gem 'sys-proctable' gem 'request_store' +gem 'parallel' +gem 'json-ld' # Monitoring gem 'cube-ruby', require: 'cube' -gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'master' +gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development' gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master' -gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'master' -gem 'ncbo_annotator', github: 'ontoportal-lirmm/ncbo_annotator', branch: 'master' +gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development' +gem 'ncbo_annotator', github: 'ontoportal-lirmm/ncbo_annotator', branch: 'development' # Testing group :test do gem 'email_spec' diff --git a/Gemfile.lock b/Gemfile.lock index 69f601f2..e8daabbe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,15 @@ GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: 8ddd2d719617ad082c6964a9efdac153cdd2b48e - branch: master + revision: 0e554fce49713ce4d5a742a06c2fb59a547caf47 + branch: development specs: goo (0.0.2) addressable (~> 2.8) pry - rdf (= 1.0.8) + rdf (= 3.2.11) + rdf-raptor + rdf-rdfxml + rdf-vocab redis rest-client rsolr @@ -15,8 +18,8 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ncbo_annotator.git - revision: 57204d8e54432ba660af4c49806e2a3019a23fa2 - branch: master + revision: 1eb751b65d10ae23d45c74e0516c78754a8419f0 + branch: development specs: ncbo_annotator (0.0.1) goo @@ -26,8 +29,8 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git - revision: 95e77989e4e8ea2fde86cf4f048f7d6cd7a6829f - branch: master + revision: 135b0df0d6394f69162f496674c5b2f2a3dcba4c + branch: development specs: ontologies_linked_data (0.0.1) activesupport @@ -46,7 +49,7 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/sparql-client.git - revision: aed51baf4106fd0f3d0e3f9238f0aad9406aa3f0 + revision: 180c818f7715baac64b2699bb452ef5c756f62c5 branch: master specs: sparql-client (1.0.1) @@ -79,9 +82,9 @@ GEM public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.6) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) + bigdecimal (3.1.7) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) builder (3.2.4) coderay (1.1.3) concurrent-ruby (1.2.3) @@ -101,7 +104,7 @@ GEM faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - faraday-retry (2.2.0) + faraday-retry (2.2.1) faraday (~> 2.0) ffi (1.16.3) gapic-common (0.21.1) @@ -112,15 +115,15 @@ GEM googleapis-common-protos-types (>= 1.11.0, < 2.a) googleauth (~> 1.9) grpc (~> 1.59) - 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-apis-analytics_v3 (0.14.0) - google-apis-core (>= 0.12.0, < 2.a) - google-apis-core (0.13.0) + google-apis-analytics_v3 (0.15.0) + google-apis-core (>= 0.14.0, < 2.a) + google-apis-core (0.14.1) addressable (~> 2.5, >= 2.5.1) googleauth (~> 1.9) httpclient (>= 2.8.1, < 3.a) @@ -128,18 +131,19 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - 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-cloud-errors (1.4.0) + google-protobuf (3.25.3-x86_64-darwin) google-protobuf (3.25.3-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.12.0) + googleapis-common-protos (1.5.0) + google-protobuf (~> 3.18) + googleapis-common-protos-types (~> 1.7) + grpc (~> 1.41) + googleapis-common-protos-types (1.14.0) google-protobuf (~> 3.18) googleauth (1.11.0) faraday (>= 1.0, < 3.a) @@ -148,7 +152,10 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.61.0-x86_64-linux) + grpc (1.62.0-x86_64-darwin) + google-protobuf (~> 3.25) + googleapis-common-protos-types (~> 1.0) + grpc (1.62.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) htmlentities (4.3.4) @@ -158,21 +165,31 @@ GEM httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.7.1) - json_pure (2.7.1) - jwt (2.7.1) + json (2.7.2) + json-canonicalization (0.4.0) + json-ld (3.2.5) + htmlentities (~> 4.3) + json-canonicalization (~> 0.3, >= 0.3.2) + link_header (~> 0.0, >= 0.0.8) + multi_json (~> 1.15) + rack (>= 2.2, < 4) + rdf (~> 3.2, >= 3.2.10) + json_pure (2.7.2) + jwt (2.8.1) + base64 launchy (2.5.2) addressable (~> 2.8) - libxml-ruby (5.0.2) + libxml-ruby (5.0.3) + link_header (0.0.8) logger (1.6.0) macaddr (1.7.2) systemu (~> 2.6.5) mail (2.6.6) mime-types (>= 1.16, < 4) - method_source (1.0.0) + method_source (1.1.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) mlanett-redis-lock (0.2.7) @@ -185,22 +202,36 @@ GEM omni_logger (0.1.4) logger os (1.1.4) + parallel (1.24.0) parseconfig (1.1.2) pony (1.13.1) mail (>= 2.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.4) - rack (3.0.9) + public_suffix (5.0.5) + rack (3.0.10) rack-test (2.1.0) rack (>= 1.3) - rake (13.1.0) - rdf (1.0.8) - addressable (>= 2.2) - redis (5.1.0) - redis-client (>= 0.17.0) - redis-client (0.20.0) + rake (13.2.1) + rdf (3.2.11) + link_header (~> 0.0, >= 0.0.8) + rdf-raptor (3.2.0) + ffi (~> 1.15) + rdf (~> 3.2) + rdf-rdfxml (3.2.2) + builder (~> 3.2) + htmlentities (~> 4.3) + rdf (~> 3.2) + rdf-xsd (~> 3.2) + rdf-vocab (3.2.7) + rdf (~> 3.2, >= 3.2.4) + rdf-xsd (3.2.1) + rdf (~> 3.2) + rexml (~> 3.2) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.1) connection_pool representable (3.2.0) declarative (< 0.1.0) @@ -215,7 +246,7 @@ GEM netrc (~> 0.8) retriable (3.1.2) rexml (3.2.6) - rsolr (2.5.0) + rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) ruby-xxHash (0.4.0.2) @@ -250,6 +281,7 @@ GEM macaddr (~> 1.0) PLATFORMS + x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -260,6 +292,7 @@ DEPENDENCIES goo! google-analytics-data google-apis-analytics_v3 + json-ld mail (= 2.6.6) minitest (< 5.0) multi_json @@ -267,6 +300,7 @@ DEPENDENCIES ncbo_cron! oj (~> 3.0) ontologies_linked_data! + parallel parseconfig pony pry @@ -281,4 +315,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.3.14 + 2.4.22 diff --git a/config/config.rb.sample b/config/config.rb.sample index 10cf7e90..1387a9fc 100644 --- a/config/config.rb.sample +++ b/config/config.rb.sample @@ -7,7 +7,7 @@ GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QU GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/update/" GOO_PORT = ENV.include?("GOO_PORT") ? ENV["GOO_PORT"] : 9000 MGREP_HOST = ENV.include?("MGREP_HOST") ? ENV["MGREP_HOST"] : "localhost" -MGREP_PORT = ENV.include?("MGREP_PORT") ? ENV["MGREP_PORT"] : 55555 +MGREP_PORT = ENV.include?("MGREP_PORT") ? ENV["MGREP_PORT"] : 55556 MGREP_DICT_PATH = ENV.include?("MGREP_DICT_PATH") ? ENV["MGREP_DICT_PATH"] : "./test/data/dictionary.txt" REDIS_GOO_CACHE_HOST = ENV.include?("REDIS_GOO_CACHE_HOST") ? ENV["REDIS_GOO_CACHE_HOST"] : "localhost" REDIS_HTTP_CACHE_HOST = ENV.include?("REDIS_HTTP_CACHE_HOST") ? ENV["REDIS_HTTP_CACHE_HOST"] : "localhost" @@ -16,8 +16,9 @@ REDIS_PORT = ENV.include?("REDIS_PORT") ? ENV["REDIS_PORT" REPORT_PATH = ENV.include?("REPORT_PATH") ? ENV["REPORT_PATH"] : "./test/tmp/ontologies_report.json" REPOSITORY_FOLDER = ENV.include?("REPOSITORY_FOLDER") ? ENV["REPOSITORY_FOLDER"] : "./test/data/ontology_files/repo" REST_URL_PREFIX = ENV.include?("REST_URL_PREFIX") ? ENV["REST_URL_PREFIX"] : "http://localhost:9393" -SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr/prop_search_core1" -SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr/term_search_core1" +SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr" +SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr" +GOO_SLICES = ENV["GOO_SLICES"] || 500 LinkedData.config do |config| config.goo_backend_name = GOO_BACKEND_NAME.to_s @@ -73,8 +74,8 @@ NcboCron.config do |config| # do not deaemonize in docker config.daemonize = false - config.search_index_all_url = "http://localhost:8983/solr/term_search_core2" - config.property_search_index_all_url = "http://localhost:8983/solr/prop_search_core2" + config.search_index_all_url = "http://localhost:8983/solr" + config.property_search_index_all_url = "http://localhost:8983/solr" # Google Analytics GA4 config config.analytics_path_to_key_file = "config/your_analytics_key.json" diff --git a/config/solr/property_search/enumsconfig.xml b/config/solr/property_search/enumsconfig.xml deleted file mode 100644 index 72e7b7d3..00000000 --- a/config/solr/property_search/enumsconfig.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - ONTOLOGY - VALUE_SET_COLLECTION - - - ANNOTATION - DATATYPE - OBJECT - - \ No newline at end of file diff --git a/config/solr/property_search/mapping-ISOLatin1Accent.txt b/config/solr/property_search/mapping-ISOLatin1Accent.txt deleted file mode 100644 index ede77425..00000000 --- a/config/solr/property_search/mapping-ISOLatin1Accent.txt +++ /dev/null @@ -1,246 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Syntax: -# "source" => "target" -# "source".length() > 0 (source cannot be empty.) -# "target".length() >= 0 (target can be empty.) - -# example: -# "À" => "A" -# "\u00C0" => "A" -# "\u00C0" => "\u0041" -# "ß" => "ss" -# "\t" => " " -# "\n" => "" - -# À => A -"\u00C0" => "A" - -# Á => A -"\u00C1" => "A" - -#  => A -"\u00C2" => "A" - -# à => A -"\u00C3" => "A" - -# Ä => A -"\u00C4" => "A" - -# Å => A -"\u00C5" => "A" - -# Æ => AE -"\u00C6" => "AE" - -# Ç => C -"\u00C7" => "C" - -# È => E -"\u00C8" => "E" - -# É => E -"\u00C9" => "E" - -# Ê => E -"\u00CA" => "E" - -# Ë => E -"\u00CB" => "E" - -# Ì => I -"\u00CC" => "I" - -# Í => I -"\u00CD" => "I" - -# Î => I -"\u00CE" => "I" - -# Ï => I -"\u00CF" => "I" - -# IJ => IJ -"\u0132" => "IJ" - -# Ð => D -"\u00D0" => "D" - -# Ñ => N -"\u00D1" => "N" - -# Ò => O -"\u00D2" => "O" - -# Ó => O -"\u00D3" => "O" - -# Ô => O -"\u00D4" => "O" - -# Õ => O -"\u00D5" => "O" - -# Ö => O -"\u00D6" => "O" - -# Ø => O -"\u00D8" => "O" - -# Œ => OE -"\u0152" => "OE" - -# Þ -"\u00DE" => "TH" - -# Ù => U -"\u00D9" => "U" - -# Ú => U -"\u00DA" => "U" - -# Û => U -"\u00DB" => "U" - -# Ü => U -"\u00DC" => "U" - -# Ý => Y -"\u00DD" => "Y" - -# Ÿ => Y -"\u0178" => "Y" - -# à => a -"\u00E0" => "a" - -# á => a -"\u00E1" => "a" - -# â => a -"\u00E2" => "a" - -# ã => a -"\u00E3" => "a" - -# ä => a -"\u00E4" => "a" - -# å => a -"\u00E5" => "a" - -# æ => ae -"\u00E6" => "ae" - -# ç => c -"\u00E7" => "c" - -# è => e -"\u00E8" => "e" - -# é => e -"\u00E9" => "e" - -# ê => e -"\u00EA" => "e" - -# ë => e -"\u00EB" => "e" - -# ì => i -"\u00EC" => "i" - -# í => i -"\u00ED" => "i" - -# î => i -"\u00EE" => "i" - -# ï => i -"\u00EF" => "i" - -# ij => ij -"\u0133" => "ij" - -# ð => d -"\u00F0" => "d" - -# ñ => n -"\u00F1" => "n" - -# ò => o -"\u00F2" => "o" - -# ó => o -"\u00F3" => "o" - -# ô => o -"\u00F4" => "o" - -# õ => o -"\u00F5" => "o" - -# ö => o -"\u00F6" => "o" - -# ø => o -"\u00F8" => "o" - -# œ => oe -"\u0153" => "oe" - -# ß => ss -"\u00DF" => "ss" - -# þ => th -"\u00FE" => "th" - -# ù => u -"\u00F9" => "u" - -# ú => u -"\u00FA" => "u" - -# û => u -"\u00FB" => "u" - -# ü => u -"\u00FC" => "u" - -# ý => y -"\u00FD" => "y" - -# ÿ => y -"\u00FF" => "y" - -# ff => ff -"\uFB00" => "ff" - -# fi => fi -"\uFB01" => "fi" - -# fl => fl -"\uFB02" => "fl" - -# ffi => ffi -"\uFB03" => "ffi" - -# ffl => ffl -"\uFB04" => "ffl" - -# ſt => ft -"\uFB05" => "ft" - -# st => st -"\uFB06" => "st" diff --git a/config/solr/property_search/schema.xml b/config/solr/property_search/schema.xml deleted file mode 100644 index 20824ea6..00000000 --- a/config/solr/property_search/schema.xml +++ /dev/null @@ -1,1179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/solr/property_search/solrconfig.xml b/config/solr/property_search/solrconfig.xml deleted file mode 100644 index 771a0f32..00000000 --- a/config/solr/property_search/solrconfig.xml +++ /dev/null @@ -1,1299 +0,0 @@ - - - - - - - - - 8.8.2 - - - - - - - - - - - ${solr.data.dir:} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${solr.lock.type:native} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${solr.ulog.dir:} - ${solr.ulog.numVersionBuckets:65536} - - - - - ${solr.autoCommit.maxTime:15000} - false - - - - - - ${solr.autoSoftCommit.maxTime:-1} - - - - - - - - - - - - - - ${solr.max.booleanClauses:500000} - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - 20 - - - 200 - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explicit - 10 - - - - - - - - - - - - - - - - explicit - json - true - - - - - - _text_ - - - - - - - - - text_general - - - - - - default - _text_ - solr.DirectSolrSpellChecker - - internal - - 0.5 - - 2 - - 1 - - 5 - - 4 - - 0.01 - - - - - - - - - - - - default - on - true - 10 - 5 - 5 - true - true - 10 - 5 - - - spellcheck - - - - - - - - - - true - false - - - terms - - - - - - - - - - - 100 - - - - - - - - 70 - - 0.5 - - [-\w ,/\n\"']{20,200} - - - - - - - ]]> - ]]> - - - - - - - - - - - - - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - 10 - .,!? - - - - - - - WORD - - - en - US - - - - - - - - - - - - [^\w-\.] - _ - - - - - - - yyyy-MM-dd['T'[HH:mm[:ss[.SSS]][z - yyyy-MM-dd['T'[HH:mm[:ss[,SSS]][z - yyyy-MM-dd HH:mm[:ss[.SSS]][z - yyyy-MM-dd HH:mm[:ss[,SSS]][z - [EEE, ]dd MMM yyyy HH:mm[:ss] z - EEEE, dd-MMM-yy HH:mm:ss z - EEE MMM ppd HH:mm:ss [z ]yyyy - - - - - java.lang.String - text_general - - *_str - 256 - - - true - - - java.lang.Boolean - booleans - - - java.util.Date - pdates - - - java.lang.Long - java.lang.Integer - plongs - - - java.lang.Number - pdoubles - - - - - - - - - - - - - - - - - - - - text/plain; charset=UTF-8 - - - - - - - - - - - - - - diff --git a/config/solr/solr.xml b/config/solr/solr.xml deleted file mode 100644 index d9d089e4..00000000 --- a/config/solr/solr.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - ${solr.max.booleanClauses:500000} - ${solr.sharedLib:} - ${solr.allowPaths:} - - - - ${host:} - ${solr.port.advertise:0} - ${hostContext:solr} - - ${genericCoreNodeNames:true} - - ${zkClientTimeout:30000} - ${distribUpdateSoTimeout:600000} - ${distribUpdateConnTimeout:60000} - ${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider} - ${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider} - - - - - ${socketTimeout:600000} - ${connTimeout:60000} - ${solr.shardsWhitelist:} - - - - - diff --git a/config/solr/term_search/enumsconfig.xml b/config/solr/term_search/enumsconfig.xml deleted file mode 100644 index 72e7b7d3..00000000 --- a/config/solr/term_search/enumsconfig.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - ONTOLOGY - VALUE_SET_COLLECTION - - - ANNOTATION - DATATYPE - OBJECT - - \ No newline at end of file diff --git a/config/solr/term_search/mapping-ISOLatin1Accent.txt b/config/solr/term_search/mapping-ISOLatin1Accent.txt deleted file mode 100644 index ede77425..00000000 --- a/config/solr/term_search/mapping-ISOLatin1Accent.txt +++ /dev/null @@ -1,246 +0,0 @@ -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Syntax: -# "source" => "target" -# "source".length() > 0 (source cannot be empty.) -# "target".length() >= 0 (target can be empty.) - -# example: -# "À" => "A" -# "\u00C0" => "A" -# "\u00C0" => "\u0041" -# "ß" => "ss" -# "\t" => " " -# "\n" => "" - -# À => A -"\u00C0" => "A" - -# Á => A -"\u00C1" => "A" - -#  => A -"\u00C2" => "A" - -# à => A -"\u00C3" => "A" - -# Ä => A -"\u00C4" => "A" - -# Å => A -"\u00C5" => "A" - -# Æ => AE -"\u00C6" => "AE" - -# Ç => C -"\u00C7" => "C" - -# È => E -"\u00C8" => "E" - -# É => E -"\u00C9" => "E" - -# Ê => E -"\u00CA" => "E" - -# Ë => E -"\u00CB" => "E" - -# Ì => I -"\u00CC" => "I" - -# Í => I -"\u00CD" => "I" - -# Î => I -"\u00CE" => "I" - -# Ï => I -"\u00CF" => "I" - -# IJ => IJ -"\u0132" => "IJ" - -# Ð => D -"\u00D0" => "D" - -# Ñ => N -"\u00D1" => "N" - -# Ò => O -"\u00D2" => "O" - -# Ó => O -"\u00D3" => "O" - -# Ô => O -"\u00D4" => "O" - -# Õ => O -"\u00D5" => "O" - -# Ö => O -"\u00D6" => "O" - -# Ø => O -"\u00D8" => "O" - -# Œ => OE -"\u0152" => "OE" - -# Þ -"\u00DE" => "TH" - -# Ù => U -"\u00D9" => "U" - -# Ú => U -"\u00DA" => "U" - -# Û => U -"\u00DB" => "U" - -# Ü => U -"\u00DC" => "U" - -# Ý => Y -"\u00DD" => "Y" - -# Ÿ => Y -"\u0178" => "Y" - -# à => a -"\u00E0" => "a" - -# á => a -"\u00E1" => "a" - -# â => a -"\u00E2" => "a" - -# ã => a -"\u00E3" => "a" - -# ä => a -"\u00E4" => "a" - -# å => a -"\u00E5" => "a" - -# æ => ae -"\u00E6" => "ae" - -# ç => c -"\u00E7" => "c" - -# è => e -"\u00E8" => "e" - -# é => e -"\u00E9" => "e" - -# ê => e -"\u00EA" => "e" - -# ë => e -"\u00EB" => "e" - -# ì => i -"\u00EC" => "i" - -# í => i -"\u00ED" => "i" - -# î => i -"\u00EE" => "i" - -# ï => i -"\u00EF" => "i" - -# ij => ij -"\u0133" => "ij" - -# ð => d -"\u00F0" => "d" - -# ñ => n -"\u00F1" => "n" - -# ò => o -"\u00F2" => "o" - -# ó => o -"\u00F3" => "o" - -# ô => o -"\u00F4" => "o" - -# õ => o -"\u00F5" => "o" - -# ö => o -"\u00F6" => "o" - -# ø => o -"\u00F8" => "o" - -# œ => oe -"\u0153" => "oe" - -# ß => ss -"\u00DF" => "ss" - -# þ => th -"\u00FE" => "th" - -# ù => u -"\u00F9" => "u" - -# ú => u -"\u00FA" => "u" - -# û => u -"\u00FB" => "u" - -# ü => u -"\u00FC" => "u" - -# ý => y -"\u00FD" => "y" - -# ÿ => y -"\u00FF" => "y" - -# ff => ff -"\uFB00" => "ff" - -# fi => fi -"\uFB01" => "fi" - -# fl => fl -"\uFB02" => "fl" - -# ffi => ffi -"\uFB03" => "ffi" - -# ffl => ffl -"\uFB04" => "ffl" - -# ſt => ft -"\uFB05" => "ft" - -# st => st -"\uFB06" => "st" diff --git a/config/solr/term_search/schema.xml b/config/solr/term_search/schema.xml deleted file mode 100644 index fa95e127..00000000 --- a/config/solr/term_search/schema.xml +++ /dev/null @@ -1,1222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/solr/term_search/solrconfig.xml b/config/solr/term_search/solrconfig.xml deleted file mode 100644 index 771a0f32..00000000 --- a/config/solr/term_search/solrconfig.xml +++ /dev/null @@ -1,1299 +0,0 @@ - - - - - - - - - 8.8.2 - - - - - - - - - - - ${solr.data.dir:} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${solr.lock.type:native} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${solr.ulog.dir:} - ${solr.ulog.numVersionBuckets:65536} - - - - - ${solr.autoCommit.maxTime:15000} - false - - - - - - ${solr.autoSoftCommit.maxTime:-1} - - - - - - - - - - - - - - ${solr.max.booleanClauses:500000} - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - 20 - - - 200 - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explicit - 10 - - - - - - - - - - - - - - - - explicit - json - true - - - - - - _text_ - - - - - - - - - text_general - - - - - - default - _text_ - solr.DirectSolrSpellChecker - - internal - - 0.5 - - 2 - - 1 - - 5 - - 4 - - 0.01 - - - - - - - - - - - - default - on - true - 10 - 5 - 5 - true - true - 10 - 5 - - - spellcheck - - - - - - - - - - true - false - - - terms - - - - - - - - - - - 100 - - - - - - - - 70 - - 0.5 - - [-\w ,/\n\"']{20,200} - - - - - - - ]]> - ]]> - - - - - - - - - - - - - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - 10 - .,!? - - - - - - - WORD - - - en - US - - - - - - - - - - - - [^\w-\.] - _ - - - - - - - yyyy-MM-dd['T'[HH:mm[:ss[.SSS]][z - yyyy-MM-dd['T'[HH:mm[:ss[,SSS]][z - yyyy-MM-dd HH:mm[:ss[.SSS]][z - yyyy-MM-dd HH:mm[:ss[,SSS]][z - [EEE, ]dd MMM yyyy HH:mm[:ss] z - EEEE, dd-MMM-yy HH:mm:ss z - EEE MMM ppd HH:mm:ss [z ]yyyy - - - - - java.lang.String - text_general - - *_str - 256 - - - true - - - java.lang.Boolean - booleans - - - java.util.Date - pdates - - - java.lang.Long - java.lang.Integer - plongs - - - java.lang.Number - pdoubles - - - - - - - - - - - - - - - - - - - - text/plain; charset=UTF-8 - - - - - - - - - - - - - - diff --git a/docker-compose.yml b/docker-compose.yml index 9f5d628d..d554f11a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,46 +1,37 @@ x-app: &app - build: - context: . - args: - RUBY_VERSION: '2.7' - # Increase the version number in the image tag every time Dockerfile or its arguments is changed - image: ncbo_cron:0.0.2 + image: agroportal/ontologies_api:development environment: &env - BUNDLE_PATH: /srv/ontoportal/bundle # default bundle config resolves to /usr/local/bundle/config inside of the container # we are setting it to local app directory if we need to use 'bundle config local' - BUNDLE_APP_CONFIG: /srv/ontoportal/ncbo_cron/.bundle - COVERAGE: 'true' - GOO_REDIS_HOST: redis-ut - REDIS_GOO_CACHE_HOST: redis-ut - REDIS_HTTP_CACHE_HOST: redis-ut - REDIS_PERSISTENT_HOST: redis-ut + BUNDLE_APP_CONFIG: /srv/ontoportal/ontologies_api/.bundle + BUNDLE_PATH: /srv/ontoportal/bundle + COVERAGE: 'true' # enable simplecov code coverage + REDIS_HOST: redis-ut REDIS_PORT: 6379 - SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr/term_search_core1 - SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr/prop_search_core1 - MGREP_HOST: mgrep-ut - MGREP_PORT: 55556 + SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr + SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr stdin_open: true tty: true - command: "bundle exec rackup -o 0.0.0.0 --port 9393" + command: /bin/bash volumes: - # bundle volume for hosting gems installed by bundle; it helps in local development with gem udpates + # bundle volume for hosting gems installed by bundle; it speeds up gem install in local development - bundle:/srv/ontoportal/bundle - # ncbo_cron code - - .:/srv/ontoportal/ncbo_cron + - .:/srv/ontoportal/ontologies_api # mount directory containing development version of the gems if you need to use 'bundle config local' #- /Users/alexskr/ontoportal:/Users/alexskr/ontoportal depends_on: &depends_on - solr-ut: + solr-prop-ut: condition: service_healthy - redis-ut: + solr-term-ut: condition: service_healthy - mgrep-ut: + redis-ut: condition: service_healthy services: - ncbo_cron: + api: <<: *app + env_file: + .env environment: <<: *env GOO_BACKEND_NAME: 4store @@ -52,33 +43,23 @@ services: profiles: - 4store depends_on: - <<: *depends_on - 4store-ut: - condition: service_started - - - ncbo_cron-agraph: - <<: *app - environment: - <<: *env - GOO_BACKEND_NAME: ag - GOO_PORT: 10035 - GOO_HOST: agraph-ut - GOO_PATH_QUERY: /repositories/bioportal_test - GOO_PATH_DATA: /repositories/bioportal_test/statements - GOO_PATH_UPDATE: /repositories/bioportal_test/statements - profiles: - - agraph - depends_on: - <<: *depends_on - agraph-ut: - condition: service_healthy + - solr-ut + - redis-ut + - mgrep-ut + - 4store-ut + ports: + - "9393:9393" + mgrep-ut: + image: ontoportal/mgrep-ncbo:0.1 + ports: + - "55556:55555" redis-ut: image: redis ports: - - 6379:6379 + - "6379:6379" + command: [ "redis-server", "--save", "", "--appendonly", "no" ] healthcheck: test: redis-cli ping interval: 10s @@ -87,69 +68,91 @@ services: 4store-ut: image: bde2020/4store - platform: linux/amd64 - #volume: fourstore:/var/lib/4store + volumes: + - 4store:/var/lib/4store command: > - bash -c "4s-backend-setup --segments 4 ontoportal_kb - && 4s-backend ontoportal_kb - && 4s-httpd -D -s-1 -p 9000 ontoportal_kb" + bash -c "if [ ! -d '/var/lib/4store/ontoportal_kb' ]; then 4s-backend-setup --segments 4 ontoportal_kb; fi ; 4s-backend ontoportal_kb ; 4s-httpd -D -s-1 -p 9000 ontoportal_kb" + + ports: + - "9000:9000" profiles: + - fs - 4store - ports: - - 9000:9000 solr-ut: image: solr:8 - volumes: - - ./test/solr/configsets:/configsets:ro - ports: - - "8983:8983" - command: > - bash -c "precreate-core term_search_core1 /configsets/term_search - && precreate-core prop_search_core1 /configsets/property_search - && solr-foreground" - 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 - interval: 10s - timeout: 5s - retries: 5 - - mgrep-ut: - image: ontoportal/mgrep:0.0.2 - platform: linux/amd64 - healthcheck: - test: ["CMD", "nc", "-z", "-v", "localhost", "55556"] - start_period: 3s - interval: 10s - timeout: 5s - retries: 5 ports: - - 55556:55555 - + - 8983:8983 + command: bin/solr start -cloud -f + # volumes: + #- solr_data:/var/solr/data agraph-ut: - image: franzinc/agraph:v8.0.0 + image: franzinc/agraph:v8.1.0 platform: linux/amd64 environment: - AGRAPH_SUPER_USER=test - AGRAPH_SUPER_PASSWORD=xyzzy shm_size: 1g - # ports: - # - 10035:10035 + ports: + # - 10035:10035 + - 10000-10035:10000-10035 + volumes: + - agdata:/agraph/data + # - ./agraph/etc:/agraph/etc command: > bash -c "/agraph/bin/agraph-control --config /agraph/etc/agraph.cfg start - ; agtool repos create bioportal_test + ; agtool repos create ontoportal_test --supersede ; agtool users add anonymous - ; agtool users grant anonymous root:bioportal_test:rw + ; agtool users grant anonymous root:ontoportal_test:rw ; tail -f /agraph/data/agraph.log" + # healthcheck: + # test: ["CMD-SHELL", "curl -sf http://127.0.0.1:10035/repositories/ontoportal_test/status | grep -iqE '(^running|^lingering)' || exit 1"] + # start_period: 10s + # interval: 10s + # timeout: 5s + # retries: 5 + profiles: + - ag + + virtuoso-ut: + image: tenforce/virtuoso:virtuoso7.2.5 + platform: linux/amd64 + environment: + - SPARQL_UPDATE=true + ports: + - 1111:1111 + - 8890:8890 + profiles: + - vo healthcheck: - test: ["CMD-SHELL", "agtool storage-report bioportal_test || exit 1"] - start_period: 20s + test: [ "CMD-SHELL", "curl -sf http://localhost:8890/sparql || exit 1" ] + start_period: 10s interval: 60s timeout: 5s retries: 3 + + graphdb-ut: + image: ontotext/graphdb:10.3.3 + platform: linux/amd64 + privileged: true + environment: + GDB_HEAP_SIZE: 5G + GDB_JAVA_OPTS: >- + -Xms5g -Xmx5g + ports: + - 7200:7200 + - 7300:7300 + volumes: + - ./test/data/graphdb-repo-config.ttl:/opt/graphdb/dist/configs/templates/data/graphdb-repo-config.ttl + - ./test/data/graphdb-test-load.nt:/opt/graphdb/dist/configs/templates/data/graphdb-test-load.nt + + entrypoint: > + bash -c " importrdf load -f -c /opt/graphdb/dist/configs/templates/data/graphdb-repo-config.ttl -m parallel /opt/graphdb/dist/configs/templates/data/graphdb-test-load.nt ; graphdb -Ddefault.min.distinct.threshold=3000 " profiles: - - agraph + - gb volumes: bundle: + agdata: + 4store: + #solr_data: \ No newline at end of file diff --git a/lib/ncbo_cron/ontology_helper.rb b/lib/ncbo_cron/ontology_helper.rb index 4d1f0716..2014b17a 100644 --- a/lib/ncbo_cron/ontology_helper.rb +++ b/lib/ncbo_cron/ontology_helper.rb @@ -10,6 +10,7 @@ module OntologyHelper :process_rdf => true, :generate_labels => true, :extract_metadata => true, + :index_all_data => true, :index_search => true, :index_properties => true, :run_metrics => true, diff --git a/rakelib/annotator_management.rake b/rakelib/annotator_management.rake index 02f23d8e..622cf41a 100644 --- a/rakelib/annotator_management.rake +++ b/rakelib/annotator_management.rake @@ -3,32 +3,39 @@ # desc 'Annotator Utilities' namespace :annotator do - require 'bundler/setup' - # Configure the process for the current cron configuration. - require_relative '../lib/ncbo_cron' - config_exists = File.exist?(File.expand_path('../../config/config.rb', __FILE__)) - abort('Please create a config/config.rb file using the config/config.rb.sample as a template') unless config_exists - require_relative '../config/config' - annotator = Annotator::Models::NcboAnnotator.new - cur_inst = annotator.redis_current_instance - alt_inst = annotator.redis_default_alternate_instance + def init_annotator + require 'bundler/setup' + # Configure the process for the current cron configuration. + require_relative '../lib/ncbo_cron' + config_exists = File.exist?(File.expand_path('../../config/config.rb', __FILE__)) + abort('Please create a config/config.rb file using the config/config.rb.sample as a template') unless config_exists + require_relative '../config/config' + + annotator = Annotator::Models::NcboAnnotator.new + cur_inst = annotator.redis_current_instance + alt_inst = annotator.redis_default_alternate_instance + [annotator, cur_inst, alt_inst] + end namespace :redis_instance do desc 'Get current Annotator redis terms cache prefix' task :get do + annotator, cur_inst, alt_inst = init_annotator puts cur_inst end desc 'Delete Annotator term cache from the alternate instance' # use with caution!!! useful for reducing memory/disk footprint task :purge_alternate do + annotator, cur_inst, alt_inst = init_annotator puts "Cleared Annotator Redis alternate terms cache #{alt_inst}" annotator.delete_term_cache(alt_inst) end desc 'Swap Annotator Redis term cache instance from primary to alternate' task :switch_to_alternate do + annotator, cur_inst, alt_inst = init_annotator annotator.redis_switch_instance puts "Annotator Redis terms cache instance has been switched to #{alt_inst}" end diff --git a/rakelib/docker_based_test.rake b/rakelib/docker_based_test.rake new file mode 100644 index 00000000..52af504c --- /dev/null +++ b/rakelib/docker_based_test.rake @@ -0,0 +1,120 @@ +# Rake tasks for running unit tests with backend services running as docker containers + +desc 'Run unit tests with docker based backend' +namespace :test do + namespace :docker do + task :up do + system("docker compose up -d") || abort("Unable to start docker containers") + unless system("curl -sf http://localhost:8983/solr || exit 1") + printf("waiting for Solr container to initialize") + sec = 0 + until system("curl -sf http://localhost:8983/solr || exit 1") do + sleep(1) + printf(".") + sec += 1 + if sec > 30 + abort(" Solr container hasn't initialized properly") + end + end + printf("\n") + end + end + task :down do + #system("docker compose --profile fs --profile ag stop") + #system("docker compose --profile fs --profile ag kill") + end + desc "run tests with docker AG backend" + task :ag do + ENV["GOO_BACKEND_NAME"]="allegrograph" + ENV["GOO_PORT"]="10035" + ENV["GOO_PATH_QUERY"]="/repositories/ontoportal_test" + ENV["GOO_PATH_DATA"]="/repositories/ontoportal_test/statements" + ENV["GOO_PATH_UPDATE"]="/repositories/ontoportal_test/statements" + ENV["COMPOSE_PROFILES"]="ag" + Rake::Task["test:docker:up"].invoke + # AG takes some time to start and create databases/accounts + # TODO: replace system curl command with native ruby code + unless system("curl -sf http://127.0.0.1:10035/repositories/ontoportal_test/status | grep -iqE '(^running|^lingering)' || exit 1") + printf("waiting for AllegroGraph container to initialize") + sec = 0 + until system("curl -sf http://127.0.0.1:10035/repositories/ontoportal_test/status | grep -iqE '(^running|^lingering)' || exit 1") do + sleep(1) + printf(".") + sec += 1 + end + end + puts + system("docker compose ps") # TODO: remove after GH actions troubleshooting is complete + Rake::Task["test"].invoke + Rake::Task["test:docker:down"].invoke + end + + desc "run tests with docker 4store backend" + task :fs do + ENV["GOO_PORT"]="9000" + ENV["COMPOSE_PROFILES"]='fs' + Rake::Task["test:docker:up"].invoke + Rake::Task["test"].invoke + Rake::Task["test:docker:down"].invoke + end + + desc "run tests with docker Virtuoso backend" + task :vo do + ENV["GOO_BACKEND_NAME"]="virtuoso" + ENV["GOO_PORT"]="8890" + ENV["GOO_PATH_QUERY"]="/sparql" + ENV["GOO_PATH_DATA"]="/sparql" + ENV["GOO_PATH_UPDATE"]="/sparql" + ENV["COMPOSE_PROFILES"]="vo" + Rake::Task["test:docker:up"].invoke + # + unless system("curl -sf http://localhost:8890/sparql || exit 1") + printf("waiting for Virtuoso container to initialize") + sec = 0 + until system("curl -sf http://localhost:8890/sparql || exit 1") do + sleep(1) + printf(".") + sec += 1 + if sec > 30 + system("docker compose logs virtuoso-ut") + abort(" Virtuoso container hasn't initialized properly") + end + end + end + Rake::Task["test"].invoke + Rake::Task["test:docker:down"].invoke + end + + + desc "run tests with docker GraphDb backend" + task :gb do + ENV["GOO_BACKEND_NAME"]="graphdb" + ENV["GOO_PORT"]="7200" + ENV["GOO_PATH_QUERY"]="/repositories/ontoportal" + ENV["GOO_PATH_DATA"]="/repositories/ontoportal/statements" + ENV["GOO_PATH_UPDATE"]="/repositories/ontoportal/statements" + ENV["COMPOSE_PROFILES"]="gb" + Rake::Task["test:docker:up"].invoke + + #system("docker compose cp ./test/data/graphdb-repo-config.ttl graphdb:/opt/graphdb/dist/configs/templates/graphdb-repo-config.ttl") + #system("docker compose cp ./test/data/graphdb-test-load.nt graphdb:/opt/graphdb/dist/configs/templates/graphdb-test-load.nt") + #system('docker compose exec graphdb sh -c "importrdf load -f -c /opt/graphdb/dist/configs/templates/graphdb-repo-config.ttl -m parallel /opt/graphdb/dist/configs/templates/graphdb-test-load.nt ;"') + unless system("curl -sf http://localhost:7200/repositories || exit 1") + printf("waiting for Graphdb container to initialize") + sec = 0 + until system("curl -sf http://localhost:7200/repositories || exit 1") do + sleep(1) + printf(".") + sec += 1 + if sec > 30 + system("docker compose logs graphdb") + abort(" Graphdb container hasn't initialized properly") + end + end + end + Rake::Task["test"].invoke + Rake::Task["test:docker:down"].invoke + end + + end +end diff --git a/rakelib/group_management.rake b/rakelib/group_management.rake index 2125af60..5586f96a 100644 --- a/rakelib/group_management.rake +++ b/rakelib/group_management.rake @@ -7,10 +7,11 @@ namespace :group do require_relative '../lib/ncbo_cron' config_exists = File.exist?(File.expand_path('../../config/config.rb', __FILE__)) abort('Please create a config/config.rb file using the config/config.rb.sample as a template') unless config_exists - require_relative '../config/config' + desc 'Create a new ontology group' task :create, [:acronym, :name] do |_t, args| + require_relative '../config/config' checkgroup = LinkedData::Models::Group.find(args.acronym).first abort("FAILED: The Group #{args.groupname} already exists") unless checkgroup.nil? group = LinkedData::Models::Group.new @@ -24,6 +25,7 @@ namespace :group do end desc 'Add ontology to a group' task :add_ontology, [:group_acronym, :ontology_acronym] do |_t, args| + require_relative '../config/config' grp = LinkedData::Models::Group.find(args.group_acronym).first abort("FAILED: The Group #{args.group_acronym} does not exist") if grp.nil? ontology = LinkedData::Models::Ontology.find(args.ontology_acronym).first diff --git a/rakelib/purl_management.rake b/rakelib/purl_management.rake index 58cfadd7..b1ba50f8 100644 --- a/rakelib/purl_management.rake +++ b/rakelib/purl_management.rake @@ -7,10 +7,11 @@ namespace :purl do require_relative '../lib/ncbo_cron' config_exists = File.exist?(File.expand_path('../../config/config.rb', __FILE__)) abort('Please create a config/config.rb file using the config/config.rb.sample as a template') unless config_exists - require_relative '../config/config' + desc 'update purl for all ontologies' task :update_all do + require_relative '../config/config' purl_client = LinkedData::Purl::Client.new LinkedData::Models::Ontology.all.each do |ont| ont.bring(:acronym) diff --git a/rakelib/user_management.rake b/rakelib/user_management.rake index 71a7bce4..bf43dc6b 100644 --- a/rakelib/user_management.rake +++ b/rakelib/user_management.rake @@ -8,10 +8,10 @@ namespace :user do require_relative '../lib/ncbo_cron' config_exists = File.exist?(File.expand_path('../../config/config.rb', __FILE__)) abort('Please create a config/config.rb file using the config/config.rb.sample as a template') unless config_exists - require_relative '../config/config' desc 'Add administrator role to the user' task :adminify, [:username] do |t, args| + require_relative '../config/config' username = args.username user = LinkedData::Models::User.find(username).first abort("FAILED: The user #{args.username} does not exist") if user.nil? @@ -33,6 +33,7 @@ namespace :user do desc 'Reset all roles to LIBRARIAN for the user' task :resetroles, [:username] do |t, args| + require_relative '../config/config' username = args.username user = LinkedData::Models::User.find(username).first abort("FAILED: user #{args.username} does not exist") if user.nil? @@ -50,6 +51,7 @@ namespace :user do desc 'Reset password to a random value for the user' task :resetpassword, [:username] do |t, args| + require_relative '../config/config' username = args.username newpassword = SecureRandom.base64(15) user = LinkedData::Models::User.find(username).first @@ -63,6 +65,7 @@ namespace :user do desc 'Create a new user' task :create, [:username, :email, :password] do |t, args| + require_relative '../config/config' args.with_defaults(password: nil) password = args.password args.password.nil? && password = SecureRandom.base64(15) @@ -84,6 +87,7 @@ namespace :user do namespace :apikey do desc 'get APIKEY for the user' task :get, [:username] do |t, args| + require_relative '../config/config' user = LinkedData::Models::User.find(args.username).first abort("FAILED: The user #{args.username} does not exist") if user.nil? user.bring_remaining @@ -91,6 +95,7 @@ namespace :user do end desc 'reset APIKEY for the user to random value or to specified value if API key is provided' task :reset, [:username, :apikey] do |t, args| + require_relative '../config/config' user = LinkedData::Models::User.find(args.username).first abort("FAILED: The user #{args.username} does not exist") if user.nil? user.bring_remaining @@ -110,6 +115,7 @@ namespace :user do desc 'Show all artifacts administrered by the user' task :artifacts, [:username] do |t, args| + require_relative '../config/config' # most of the code is copied from /bin/ncbo_spam_deletion username = args.username diff --git a/test/data/graphdb-repo-config.ttl b/test/data/graphdb-repo-config.ttl new file mode 100644 index 00000000..9200da9a --- /dev/null +++ b/test/data/graphdb-repo-config.ttl @@ -0,0 +1,33 @@ +@prefix rdfs: . +@prefix rep: . +@prefix sail: . +@prefix xsd: . + +<#ontoportal> a rep:Repository; + rep:repositoryID "ontoportal"; + rep:repositoryImpl [ + rep:repositoryType "graphdb:SailRepository"; + [ + "http://example.org/owlim#"; + "false"; + ""; + "true"; + "false"; + "true"; + "true"; + "32"; + "10000000"; + ""; + "true"; + ""; + "0"; + "0"; + "false"; + "file-repository"; + "rdfsplus-optimized"; + "storage"; + "false"; + sail:sailType "owlim:Sail" + ] + ]; + rdfs:label "" . \ No newline at end of file diff --git a/test/data/graphdb-test-load.nt b/test/data/graphdb-test-load.nt new file mode 100644 index 00000000..e69de29b diff --git a/test/test_case.rb b/test/test_case.rb index 75bb0454..3f69aa02 100644 --- a/test/test_case.rb +++ b/test/test_case.rb @@ -60,12 +60,18 @@ def backend_triplestore_delete raise StandardError, 'Too many triples in KB, does not seem right to run tests' unless count_pattern('?s ?p ?o') < 400000 - LinkedData::Models::Ontology.where.include(:acronym).each do |o| - query = "submissionAcronym:#{o.acronym}" - LinkedData::Models::Ontology.unindexByQuery(query) - end + # LinkedData::Models::Ontology.where.include(:acronym).each do |o| + # query = "submissionAcronym:#{o.acronym}" + # LinkedData::Models::Ontology.unindexByQuery(query) + # end + # LinkedData::Models::Ontology.indexCommit - Goo.sparql_update_client.update('DELETE {?s ?p ?o } WHERE { ?s ?p ?o }') + + graphs = Goo.sparql_query_client.query("SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o . } }") + graphs.each_solution do |sol| + Goo.sparql_data_client.delete_graph(sol[:g]) + end + LinkedData::Models::SubmissionStatus.init_enum LinkedData::Models::OntologyFormat.init_enum LinkedData::Models::OntologyType.init_enum diff --git a/test/test_ontology_submission_parser.rb b/test/test_ontology_submission_parser.rb index d9572802..d7329284 100644 --- a/test/test_ontology_submission_parser.rb +++ b/test/test_ontology_submission_parser.rb @@ -40,7 +40,7 @@ def test_queue_submission assert_nil val parser.queue_submission(o1.submissions[0], { - dummy_action: true, index_search: false, metrics: true, + dummy_action: true, index_all_data: false, index_search: false, metrics: true, process_annotator: true, another_dummy_action: true, all: true}) val = @@redis.hget(NcboCron::Models::OntologySubmissionParser::QUEUE_HOLDER, parser.get_prefixed_id(o1.submissions[0].id.to_s)) options = MultiJson.load(val, symbolize_keys: true) @@ -49,11 +49,11 @@ def test_queue_submission o2 = @@ontologies[1] o2.bring(:submissions) if o2.bring?(:submissions) parser.queue_submission(o2.submissions[0], { - :process_rdf => false, :index_search => true, :metrics => true, + :process_rdf => false, :index_search => true, index_all_data: true, :metrics => true, :process_annotator => false}) val = @@redis.hget(NcboCron::Models::OntologySubmissionParser::QUEUE_HOLDER, parser.get_prefixed_id(o2.submissions[0].id.to_s)) options = MultiJson.load(val, symbolize_keys: true) - assert_equal({:process_rdf => false, :index_search => true, :process_annotator => false}, options) + assert_equal({:process_rdf => false, :index_search => true, index_all_data: true, :process_annotator => false}, options) end def test_parse_submissions @@ -76,13 +76,13 @@ def test_parse_submissions o2_sub2.bring(:submissionStatus) options_o1 = { - :dummy_action => true, :process_rdf => true, :index_search => true, :index_properties => true, :diff => true, + :dummy_action => true, :process_rdf => true, :index_all_data => true, :index_search => true, :index_properties => true, :diff => true, :dummy_metrics => false, :run_metrics => false, :process_annotator => false, :another_dummy_action => false, :all => false } options_o2 = { - dummy_action: false, process_rdf: true, index_search: false, index_properties: false, :diff => true, + dummy_action: false, process_rdf: true, index_search: false, :index_all_data => false, index_properties: false, :diff => true, dummy_metrics: true, run_metrics: false, process_annotator: true, another_dummy_action: true, all: false } From 865f00adf94a5bd471eb9b35adc90812a3b854a9 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Fri, 26 Apr 2024 10:56:26 +0200 Subject: [PATCH 5/8] [ontoportal-bot] Gemfile.lock update --- Gemfile.lock | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e8daabbe..00038127 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -137,7 +137,6 @@ GEM google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) - 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) @@ -152,9 +151,6 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.62.0-x86_64-darwin) - google-protobuf (~> 3.25) - googleapis-common-protos-types (~> 1.0) grpc (1.62.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) @@ -281,7 +277,6 @@ GEM macaddr (~> 1.0) PLATFORMS - x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -315,4 +310,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.4.22 + 2.3.15 From 5e56953493f13d941971e1e23fa11d8ef57eaf53 Mon Sep 17 00:00:00 2001 From: OntoPortal Bot Date: Wed, 22 May 2024 23:36:09 +0200 Subject: [PATCH 6/8] [ontoportal-bot] Gemfile.lock update --- Gemfile | 2 +- Gemfile.lock | 48 +++++++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index a11b3d4d..7d616193 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem 'json-ld' gem 'cube-ruby', require: 'cube' gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development' -gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master' +gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development' gem 'ontologies_linked_data', github: 'ontoportal-lirmm/ontologies_linked_data', branch: 'development' gem 'ncbo_annotator', github: 'ontoportal-lirmm/ncbo_annotator', branch: 'development' # Testing diff --git a/Gemfile.lock b/Gemfile.lock index 00038127..ba322adb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/ontoportal-lirmm/goo.git - revision: 0e554fce49713ce4d5a742a06c2fb59a547caf47 + revision: b2a635fb1e8206e6e3010be4dbe033b47eb58481 branch: development specs: goo (0.0.2) @@ -29,7 +29,7 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git - revision: 135b0df0d6394f69162f496674c5b2f2a3dcba4c + revision: 0855adfce5365c6ef7a494e3d3ad9af2611974d9 branch: development specs: ontologies_linked_data (0.0.1) @@ -49,13 +49,12 @@ GIT GIT remote: https://github.com/ontoportal-lirmm/sparql-client.git - revision: 180c818f7715baac64b2699bb452ef5c756f62c5 - branch: master + revision: 59251e59346c9a69a67c88552ba55a1244eec602 + branch: development specs: - sparql-client (1.0.1) - json_pure (>= 1.4) - net-http-persistent (= 2.9.4) - rdf (>= 1.0) + sparql-client (3.2.2) + net-http-persistent (~> 4.0, >= 4.0.2) + rdf (~> 3.2, >= 3.2.11) PATH remote: . @@ -82,7 +81,7 @@ GEM public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.7) + bigdecimal (3.1.8) binding_of_caller (1.0.1) debug_inspector (>= 1.2.0) builder (3.2.4) @@ -121,9 +120,9 @@ GEM google-analytics-data-v1beta (0.12.0) gapic-common (>= 0.21.1, < 2.a) google-cloud-errors (~> 1.0) - google-apis-analytics_v3 (0.15.0) - google-apis-core (>= 0.14.0, < 2.a) - google-apis-core (0.14.1) + google-apis-analytics_v3 (0.16.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-core (0.15.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 1.9) httpclient (>= 2.8.1, < 3.a) @@ -137,6 +136,7 @@ GEM google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) + 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) @@ -151,7 +151,10 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.62.0-x86_64-linux) + grpc (1.63.0-x86_64-darwin) + google-protobuf (~> 3.25) + googleapis-common-protos-types (~> 1.0) + grpc (1.63.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) htmlentities (4.3.4) @@ -170,7 +173,6 @@ GEM multi_json (~> 1.15) rack (>= 2.2, < 4) rdf (~> 3.2, >= 3.2.10) - json_pure (2.7.2) jwt (2.8.1) base64 launchy (2.5.2) @@ -185,13 +187,14 @@ GEM method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0305) + mime-types-data (3.2024.0507) mini_mime (1.1.5) minitest (4.7.5) mlanett-redis-lock (0.2.7) redis multi_json (1.15.0) - net-http-persistent (2.9.4) + net-http-persistent (4.0.2) + connection_pool (~> 2.2) netrc (0.11.0) oj (3.16.3) bigdecimal (>= 3.0) @@ -206,7 +209,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (5.0.5) - rack (3.0.10) + rack (3.0.11) rack-test (2.1.0) rack (>= 1.3) rake (13.2.1) @@ -227,13 +230,13 @@ GEM rexml (~> 3.2) redis (5.2.0) redis-client (>= 0.22.0) - redis-client (0.22.1) + redis-client (0.22.2) connection_pool representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - request_store (1.6.0) + request_store (1.7.0) rack (>= 1.4) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -241,7 +244,8 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retriable (3.1.2) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) @@ -264,6 +268,7 @@ GEM simplecov (~> 0.19) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + strscan (3.1.0) sys-proctable (1.3.0) ffi (~> 1.1) systemu (2.6.5) @@ -277,6 +282,7 @@ GEM macaddr (~> 1.0) PLATFORMS + x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -310,4 +316,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.3.15 + 2.4.22 From e15e2180a0908db94dab2f284845edc60dfdce78 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Tue, 4 Jun 2024 22:09:43 +0200 Subject: [PATCH 7/8] feature: implement NCBO cron docker image build CI --- .github/workflows/docker-image.yml | 28 +++++++++++++++++++++------- Gemfile.lock | 7 ++++++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 6105c1d8..8639cb53 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,12 +1,17 @@ -name: Docker Image CI +name: Docker branch Images build on: + push: + branches: + - master + - development + - stage + - test release: - types: [published] - + types: [ published ] jobs: push_to_registry: - name: Push Docker image to Docker Hub + name: Push Docker branch image to Docker Hub runs-on: ubuntu-latest steps: - name: Check out the repo @@ -19,16 +24,25 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 with: - images: bioportal/ncbo_cron + images: | + agroportal/ncbo_cron + ghcr.io/${{ github.repository }} - name: Build and push Docker image uses: docker/build-push-action@v4 @@ -36,7 +50,7 @@ jobs: context: . platforms: linux/amd64,linux/arm64 build-args: | - RUBY_VERSION=2.7 + RUBY_VERSION=2.7.8 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Gemfile.lock b/Gemfile.lock index c3278c5f..b2fc6928 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,6 +136,7 @@ GEM google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) + 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) @@ -150,6 +151,9 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) + grpc (1.64.0-x86_64-darwin) + google-protobuf (~> 3.25) + googleapis-common-protos-types (~> 1.0) grpc (1.64.0-x86_64-linux) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) @@ -278,6 +282,7 @@ GEM macaddr (~> 1.0) PLATFORMS + x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -311,4 +316,4 @@ DEPENDENCIES test-unit-minitest BUNDLED WITH - 2.3.23 + 2.4.22 From a90b97c35ad2499e90937ec40b248e0aa352725b Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Tue, 4 Jun 2024 22:26:49 +0200 Subject: [PATCH 8/8] fix: ontology importer miss type --- bin/ncbo_ontology_import | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/ncbo_ontology_import b/bin/ncbo_ontology_import index 73fa7fac..9e6bc543 100755 --- a/bin/ncbo_ontology_import +++ b/bin/ncbo_ontology_import @@ -89,7 +89,7 @@ def create_ontology(ont_info) has_domains << category if category end - new_ontology.groups = groups + new_ontology.group = groups new_ontology.hasDomain = has_domains new_ontology end @@ -106,6 +106,10 @@ def upload_submission(sub_info, ontology) sub_info['pullLocation'] = "#{sub_info['ontology']['links']['download']}?apikey=#{SOURCE_APIKEY}" end + if sub_info['URI'].blank? + sub_info['URI'] = "#{sub_info['id']}" + end + # Build the json body # hasOntologyLanguage options: OWL, UMLS, SKOS, OBO # status: alpha, beta, production, retired