From 063383c9aa416b9f5e7897ff801c1a9e60527686 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Tue, 15 Nov 2022 05:47:40 +0100 Subject: [PATCH 1/7] append value to the url if nowhere to replace --- lib/ontologies_api_client/link_explorer.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ontologies_api_client/link_explorer.rb b/lib/ontologies_api_client/link_explorer.rb index ce77780..e3302a7 100644 --- a/lib/ontologies_api_client/link_explorer.rb +++ b/lib/ontologies_api_client/link_explorer.rb @@ -60,9 +60,15 @@ def replace_template_elements(url, values = []) return url if values.nil? || values.empty? values = values.dup values = [values] unless values.is_a?(Array) - return url.gsub(/(\{.*?\})/) do - URI.escape(values.shift, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) + escaped_value = URI.escape(values.shift, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) + if url.match(/(\{.*?\})/) + url.gsub(/(\{.*?\})/) do + escaped_value + end + else + url + '/' + escaped_value end + end def linkable_attributes From 6ec21e8bfa4fb007ab266b87714aa288bedc097e Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Thu, 6 Feb 2025 14:10:10 -0800 Subject: [PATCH 2/7] Remove Ruby 3.0 from the text matrix --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 569b9bd..0650cf0 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.0', '3.1'] + ruby-version: ['3.1'] steps: - uses: actions/checkout@v3 - name: Set up Ruby From 207080b1185a4964ba92f095d8341d8956f62b77 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Thu, 6 Feb 2025 14:26:53 -0800 Subject: [PATCH 3/7] Update license copyright year --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 5774c19..8b0d9e2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2021, The Board of Trustees of Leland Stanford Junior University +Copyright (c) 2025, The Board of Trustees of Leland Stanford Junior University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are From 7e21c9daa0e385fb4effa4d6f5d0bdebfc9dd36b Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Thu, 6 Feb 2025 14:41:23 -0800 Subject: [PATCH 4/7] Simplify licensing text in the README --- README.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/README.md b/README.md index 9bc1f70..4feda27 100644 --- a/README.md +++ b/README.md @@ -153,14 +153,4 @@ For questions please email [support@bioontology.org](support@bioontology.org.) ## License -Copyright (c) 2024, The Board of Trustees of Leland Stanford Junior University All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE BOARD OF TRUSTEES OF LELAND STANFORD JUNIOR UNIVERSITY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL The Board of Trustees of Leland Stanford Junior University OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of The Board of Trustees of Leland Stanford Junior University. +This project is licensed under the [FreeBSD License](LICENSE.txt) © 2025 The Board of Trustees of Leland Stanford Junior University. \ No newline at end of file From 52a968591510e78a3105453f9f069691b6116c97 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Thu, 6 Feb 2025 18:15:12 -0800 Subject: [PATCH 5/7] Add unit tests for pull request 15 --- test/test_link_explorer.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/test_link_explorer.rb diff --git a/test/test_link_explorer.rb b/test/test_link_explorer.rb new file mode 100644 index 0000000..408c2bc --- /dev/null +++ b/test/test_link_explorer.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative 'test_case' + +class LinkExplorerTest < LinkedData::Client::TestCase + def test_explore_ontology_submission_by_id + ont = LinkedData::Client::Models::Ontology.get('FMA') + sub = ont.explore.submissions('29') + refute_nil(sub) + assert_instance_of(LinkedData::Client::Models::OntologySubmission, sub) + assert_equal(29, sub.submissionId) + end + + def test_explore_ontology_class_by_id + ont = LinkedData::Client::Models::Ontology.get('FMA') + cls = ont.explore.classes('http://purl.org/sig/ont/fma/fma70742') + refute_nil(cls) + assert_instance_of(LinkedData::Client::Models::Class, cls) + assert_equal('http://purl.org/sig/ont/fma/fma70742', cls.id) + assert_equal('Set of eyelashes', cls.prefLabel) + end + + def test_explore_ontology_single_class + ont = LinkedData::Client::Models::Ontology.get('FMA') + cls = ont.explore.single_class('http://purl.org/sig/ont/fma/fma322428') + refute_nil(cls) + assert_instance_of(LinkedData::Client::Models::Class, cls) + assert_equal('http://purl.org/sig/ont/fma/fma322428', cls.id) + assert_equal('Set of salivary glands', cls.prefLabel) + end +end From 0b3570a01a43eddfc7836a17b9c7ed8b13a9e129 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Thu, 6 Feb 2025 18:22:14 -0800 Subject: [PATCH 6/7] Update Gemfile.lock --- Gemfile.lock | 78 +++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4cb70a6..38fe053 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,73 +23,75 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) - bigdecimal (3.1.8) + bigdecimal (3.1.9) coderay (1.1.3) - concurrent-ruby (1.3.3) - excon (0.111.0) - faraday (2.10.0) - faraday-net_http (>= 2.0, < 3.2) + concurrent-ruby (1.3.5) + excon (1.2.3) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json logger - faraday-excon (2.1.0) - excon (>= 0.27.4) - faraday (~> 2.0) + faraday-excon (2.3.0) + excon (>= 1.0.0) + faraday (>= 2.11.0, < 3) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-multipart (1.0.4) - multipart-post (~> 2) - faraday-net_http (3.1.0) - net-http - i18n (1.14.5) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.7.2) - language_server-protocol (3.17.0.3) - logger (1.6.0) + json (2.9.1) + language_server-protocol (3.17.0.4) + logger (1.6.5) lz4-ruby (0.3.3) method_source (1.1.0) - minitest (5.25.1) - minitest-hooks (1.5.1) + minitest (5.25.4) + minitest-hooks (1.5.2) minitest (> 5.3) multi_json (1.15.0) multipart-post (2.4.1) - net-http (0.4.1) + net-http (0.6.0) uri - oj (3.16.4) + oj (3.16.9) bigdecimal (>= 3.0) - parallel (1.25.1) - parser (3.3.4.0) + ostruct (>= 0.2) + ostruct (0.6.1) + parallel (1.26.3) + parser (3.3.7.1) ast (~> 2.4.1) racc - pry (0.14.2) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (6.0.0) - racc (1.8.0) + public_suffix (6.0.1) + racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) - rexml (3.3.2) - strscan - rubocop (1.65.0) + regexp_parser (2.10.0) + rubocop (1.71.2) 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 (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - strscan (3.1.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) - uri (0.13.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) PLATFORMS + arm64-darwin-24 ruby x86_64-darwin-16 x86_64-darwin-17 @@ -105,4 +107,4 @@ DEPENDENCIES rubocop (~> 1.43) BUNDLED WITH - 2.4.18 + 2.5.11 From 69386eebe706b2abed706d7ae3573462fbcab632 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 10 Feb 2025 14:51:32 -0800 Subject: [PATCH 7/7] Bump version from 2.4.0 to 2.5.0 --- Gemfile.lock | 2 +- lib/ontologies_api_client/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 38fe053..241d1b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ontologies_api_client (2.4.0) + ontologies_api_client (2.5.0) activesupport (= 7.0.8) addressable (~> 2.8) excon diff --git a/lib/ontologies_api_client/version.rb b/lib/ontologies_api_client/version.rb index ef2e69e..f433cf8 100644 --- a/lib/ontologies_api_client/version.rb +++ b/lib/ontologies_api_client/version.rb @@ -2,6 +2,6 @@ module LinkedData module Client - VERSION = '2.4.0' + VERSION = '2.5.0' end end