From a406952cba16a3cac17d8abb4b72780334c0cf68 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 29 Aug 2025 13:30:43 -0700 Subject: [PATCH 1/2] add url datatype for attributes that should be restricted to HTTP/HTTPS :homepage, :documentation, :pullLocation --- Gemfile | 4 ++-- Gemfile.lock | 11 +++++++---- .../models/ontology_submission.rb | 12 ++++-------- lib/ontologies_linked_data/models/project.rb | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 92a44656..95414ea2 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem 'request_store' gem 'rest-client' gem 'rsolr' gem 'thin', '~> 1.0' # compatibility version pin. thin should be replaced with webmoc - +gem "down", "~> 5.0" # Testing group :test do @@ -37,7 +37,7 @@ group :development do gem 'rubocop', require: false end # NCBO gems (can be from a local dev path or from rubygems/git) -gem 'goo', github: 'ncbo/goo', branch: 'master' +gem 'goo', github: 'ncbo/goo', branch: 'develop' gem 'sparql-client', github: 'ncbo/sparql-client', tag: 'v6.3.0' gem 'public_suffix', '~> 5.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index a9b77aa7..815b5cbf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 26c0a69e67ac59778a46caf51202ebd38ccac767 - branch: master + revision: ca5f9d858eef89923903236fe6f76c78271e538d + branch: develop specs: goo (0.0.2) addressable (~> 2.8) @@ -69,6 +69,8 @@ GEM date (3.4.1) docile (1.4.1) domain_name (0.6.20240107) + down (5.4.2) + addressable (~> 2.8) email_spec (2.3.0) htmlentities (~> 4.3.3) launchy (>= 2.1, < 4.0) @@ -111,7 +113,7 @@ GEM mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2025.0819) + mime-types-data (3.2025.0826) mini_mime (1.1.5) minitest (4.7.5) minitest-reporters (0.14.24) @@ -199,7 +201,7 @@ GEM prism (~> 1.4) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - rubyzip (3.0.1) + rubyzip (3.0.2) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -238,6 +240,7 @@ DEPENDENCIES addressable (~> 2.8) bcrypt (~> 3.0) cube-ruby + down (~> 5.0) email_spec ffi goo! diff --git a/lib/ontologies_linked_data/models/ontology_submission.rb b/lib/ontologies_linked_data/models/ontology_submission.rb index 2687470f..83810a2a 100644 --- a/lib/ontologies_linked_data/models/ontology_submission.rb +++ b/lib/ontologies_linked_data/models/ontology_submission.rb @@ -3,7 +3,7 @@ require 'uri' require 'open-uri' require 'cgi' -require 'benchmark' +# require 'benchmark' require 'csv' require 'fileutils' @@ -59,12 +59,8 @@ class OntologySubmission < LinkedData::Models::Base # Description metadata attribute :description, namespace: :omv, enforce: %i[concatenate], fuzzy_search: true - # attribute :homepage - # attribute :documentation, namespace: :omv - # attribute :publication - # attribute :uri, namespace: :omv - attribute :homepage, namespace: :foaf, type: :uri - attribute :documentation, namespace: :omv, type: :uri + attribute :homepage, namespace: :foaf, type: :url + attribute :documentation, namespace: :omv, type: :url attribute :publication, type: %i[uri list] attribute :uri, namespace: :omv, type: :uri, enforce: %i[distinct_of_identifier], fuzzy_search: true @@ -124,7 +120,7 @@ class OntologySubmission < LinkedData::Models::Base attribute :wasInvalidatedBy, namespace: :prov, type: :list # Links - attribute :pullLocation, type: :uri # URI for pulling ontology + attribute :pullLocation, type: :url # URL for pulling ontology attribute :isFormatOf, namespace: :dct, type: :uri attribute :hasFormat, namespace: :dct, type: %i[uri list] attribute :dataDump, namespace: :void, type: :uri, default: -> (s) { data_dump_default(s) } diff --git a/lib/ontologies_linked_data/models/project.rb b/lib/ontologies_linked_data/models/project.rb index 9faea774..a32a8265 100644 --- a/lib/ontologies_linked_data/models/project.rb +++ b/lib/ontologies_linked_data/models/project.rb @@ -7,7 +7,7 @@ class Project < LinkedData::Models::Base attribute :created, enforce: [:date_time], :default => lambda {|x| DateTime.now } attribute :updated, enforce: [:date_time], :default => lambda {|x| DateTime.now } attribute :name, enforce: [:existence, :safe_text_256] - attribute :homePage, enforce: [:uri, :existence] + attribute :homePage, enforce: [:url, :existence] attribute :description, enforce: [:existence, :safe_text] attribute :contacts, enforce: [:safe_text_256] attribute :institution, enforce: [:safe_text_256] From 1a6d42628cfcf1704b96de45e27e81392333e343 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Mon, 27 Oct 2025 13:18:12 -0700 Subject: [PATCH 2/2] reset branch specifier to master --- Gemfile | 2 +- Gemfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 95414ea2..93c91f25 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ group :development do gem 'rubocop', require: false end # NCBO gems (can be from a local dev path or from rubygems/git) -gem 'goo', github: 'ncbo/goo', branch: 'develop' +gem 'goo', github: 'ncbo/goo', branch: 'master' gem 'sparql-client', github: 'ncbo/sparql-client', tag: 'v6.3.0' gem 'public_suffix', '~> 5.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 815b5cbf..5727a79e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/ncbo/goo.git - revision: ca5f9d858eef89923903236fe6f76c78271e538d - branch: develop + revision: 5cac44e06a6bf0c093563dad66240ab07fec4d9c + branch: master specs: goo (0.0.2) addressable (~> 2.8) @@ -63,7 +63,7 @@ GEM logger (~> 1.5) coderay (1.1.3) concurrent-ruby (1.3.5) - connection_pool (2.5.3) + connection_pool (2.5.4) cube-ruby (0.0.3) daemons (1.4.1) date (3.4.1) @@ -76,7 +76,7 @@ GEM launchy (>= 2.1, < 4.0) mail (~> 2.7) eventmachine (1.2.7) - faraday (2.13.4) + faraday (2.14.0) faraday-net_http (>= 2.0, < 3.5) json logger @@ -88,11 +88,11 @@ GEM hashie (5.0.0) htmlentities (4.3.4) http-accept (1.7.0) - http-cookie (1.0.8) + http-cookie (1.1.0) domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.13.2) + json (2.15.2) json_pure (2.8.1) language_server-protocol (3.17.0.5) launchy (3.1.1) @@ -113,7 +113,7 @@ GEM mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2025.0826) + mime-types-data (3.2025.0924) mini_mime (1.1.5) minitest (4.7.5) minitest-reporters (0.14.24) @@ -162,7 +162,7 @@ GEM method_source (~> 1.0) public_suffix (5.1.1) racc (1.8.1) - rack (2.2.17) + rack (2.2.20) rack-test (0.8.3) rack (>= 1.0, < 3) rainbow (3.1.1) @@ -171,7 +171,7 @@ GEM addressable (>= 2.2) redis (5.4.1) redis-client (>= 0.22.0) - redis-client (0.25.2) + redis-client (0.26.1) connection_pool regexp_parser (2.11.2) request_store (1.7.0) @@ -224,7 +224,7 @@ GEM unicode-display_width (3.1.5) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - uri (1.0.3) + uri (1.0.4) uuid (2.3.9) macaddr (~> 1.0)