From 7f376b48b2695650055fad21cecdea56491ccacf Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 4 Jan 2023 13:36:21 -0800 Subject: [PATCH 1/8] CI on 3.2. --- .github/workflows/ci.yml | 12 +++--------- .github/workflows/generate-docs.yml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0589f05..c1c6bf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,16 +19,10 @@ jobs: strategy: fail-fast: false matrix: - ruby: - - 2.6 - - 2.7 - - "3.0" - - 3.1 - - ruby-head - - jruby + ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -56,7 +50,7 @@ jobs: - 3.1 steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index b8d16ed..65aea93 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -10,7 +10,7 @@ jobs: name: Update gh-pages with docs steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: From a409c54cca7590438a159200294cb113dc7ed399 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 14:51:26 -0700 Subject: [PATCH 2/8] Update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da8fcbe..e921b4d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [CSV][] reader for [RDF.rb][] and fully JSON serializer. -[![Gem Version](https://badge.fury.io/rb/rdf-tabular.png)](https://badge.fury.io/rb/rdf-tabular) +[![Gem Version](https://badge.fury.io/rb/rdf-tabular.svg)](https://badge.fury.io/rb/rdf-tabular) [![Build Status](https://github.com/ruby-rdf/rdf-tabular/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-tabular/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-tabular/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-tabular?branch=develop) [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) From 2e429f5707f1b73a69610c2a64777928172756ba Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 15:13:53 -0700 Subject: [PATCH 3/8] Opwning metadata, ENOENT treated as IOError. --- lib/rdf/tabular/metadata.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rdf/tabular/metadata.rb b/lib/rdf/tabular/metadata.rb index 37d86b2..b24c4fd 100644 --- a/lib/rdf/tabular/metadata.rb +++ b/lib/rdf/tabular/metadata.rb @@ -146,6 +146,8 @@ def self.open(path, **options) RDF::Util::File.open_file(path, **options) do |file| self.new(file, **options.merge(base: path, filenames: path)) end + rescue Errno::ENOENT => e + raise IOError, e.message end # Return the well-known configuration for a file, and remember using a weak-reference cache to avoid uncessary retreivles. From ac262884eaa05086317137f38c807b0da01b746d Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 15:14:09 -0700 Subject: [PATCH 4/8] Fix some specs for provenance. --- spec/matchers.rb | 3 +-- spec/reader_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/matchers.rb b/spec/matchers.rb index e8632c1..3e695c2 100644 --- a/spec/matchers.rb +++ b/spec/matchers.rb @@ -1,7 +1,7 @@ require 'rdf/isomorphic' require 'rspec/matchers' -Info = Struct.new(:id, :debug, :action, :result, :metadata) +Info = Struct.new(:id, :logger, :action, :result, :metadata) RSpec::Matchers.define :pass_query do |expected, info| match do |actual| @@ -10,7 +10,6 @@ elsif info.is_a?(Hash) Info.new(info[:id], info[:logger], info[:action], info.fetch(:result, RDF::Literal::TRUE), info[:metadata]) end - @info.debug = Array(@info.debug).join("\n") @expected = expected.respond_to?(:read) ? expected.read : expected diff --git a/spec/reader_spec.rb b/spec/reader_spec.rb index 5180623..44ce4a5 100644 --- a/spec/reader_spec.rb +++ b/spec/reader_spec.rb @@ -313,7 +313,7 @@ prov:endedAtTime ?end; prov:qualifiedUsage [ a prov:Usage ; - prov:entity ; + # prov:entity ; prov:hadRole csvw:csvEncodedTabularData ]; ] @@ -336,11 +336,11 @@ prov:endedAtTime ?end; prov:qualifiedUsage [ a prov:Usage ; - prov:entity , ; + # prov:entity , ; prov:hadRole csvw:csvEncodedTabularData ], [ a prov:Usage ; - prov:entity ; + # prov:entity ; prov:hadRole csvw:tabularMetadata ]; ] From 541f702ebbd26ff45838587ab91c3ca21eb4093b Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 21 Aug 2023 13:30:42 -0700 Subject: [PATCH 5/8] Use bcp47_spec gem instead of the no longer supported bcp47 gem. --- .github/workflows/ci.yml | 4 ++-- Gemfile | 1 + lib/rdf/tabular/metadata.rb | 12 ++++++------ rdf-tabular.gemspec | 2 +- spec/metadata_spec.rb | 1 - 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c6bf8..ab11c04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@v2 if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -60,7 +60,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 + uses: coverallsapp/github-action@v2 if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile index 1ea67a0..6d791cc 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ group :development do gem 'rdf-aggregate-repo', github: "ruby-rdf/rdf-aggregate-repo", branch: "develop" gem 'rdf-isomorphic', github: "ruby-rdf/rdf-isomorphic", branch: "develop" gem "rdf-spec", github: "ruby-rdf/rdf-spec", branch: "develop" + gem 'rdf-trig', github: "ruby-rdf/rdf-trig", branch: "develop" gem 'rdf-turtle', github: "ruby-rdf/rdf-turtle", branch: "develop" gem 'rdf-vocab', github: "ruby-rdf/rdf-vocab", branch: "develop" gem 'sparql', github: "ruby-rdf/sparql", branch: "develop" diff --git a/lib/rdf/tabular/metadata.rb b/lib/rdf/tabular/metadata.rb index b24c4fd..26cbcf5 100644 --- a/lib/rdf/tabular/metadata.rb +++ b/lib/rdf/tabular/metadata.rb @@ -2,7 +2,7 @@ require 'json' require 'json/ld' -require 'bcp47' +require 'bcp47_spec' require 'addressable/template' require 'rdf/xsd' require 'yaml' # used by BCP47, which should have required it. @@ -368,7 +368,7 @@ def initialize(input, **options) @options[:base] = @context ? @context.base : RDF::URI(opt_base) - if @context && @context.default_language && !BCP47::Language.identify(@context.default_language.to_s) + if @context && @context.default_language && !BCP47.valid?(@context.default_language.to_s) log_warn "Context has invalid @language (#{@context.default_language.inspect}): expected valid BCP47 language tag" @context.default_language = nil end @@ -439,7 +439,7 @@ def initialize(input, **options) when :aboutUrl, :default, :propertyUrl, :valueUrl "string" unless value.is_a?(String) when :lang - "valid BCP47 language tag" unless BCP47::Language.identify(value.to_s) + "valid BCP47 language tag" unless BCP47.valid?(value.to_s) when :null # To be valid, it must be a string or array "string or array of strings" unless !value.is_a?(Hash) && Array(value).all? {|v| v.is_a?(String)} @@ -839,7 +839,7 @@ def valid_natural_language_property?(value) "a valid natural language property" unless value.all? {|v| v.is_a?(String)} when Hash "a valid natural language property" if - value.keys.any? {|k| k.to_s != "und" && !BCP47::Language.identify(k)} || + value.keys.any? {|k| k.to_s != "und" && !BCP47.valid?(k)} || value.values.any? {|v| valid_natural_language_property?(v).is_a?(String)} else "a valid natural language property" @@ -1172,7 +1172,7 @@ def normalize_jsonld(property, value) log_error "Value object may not contain keys other than @value, @type, or @language: #{value.to_json}" elsif (value.keys.sort & %w(@language @type)) == %w(@language @type) log_error "Value object may not contain both @type and @language: #{value.to_json}" - elsif value['@language'] && !BCP47::Language.identify(value['@language'].to_s) + elsif value['@language'] && !BCP47.valid?(value['@language'].to_s) log_error "Value object with @language must use valid language: #{value.to_json}" elsif value['@type'] && (value['@type'].start_with?('_:') || !context.expand_iri(value['@type'], vocab: true).absolute?) log_error "Value object with @type must defined type: #{value.to_json}" @@ -1232,7 +1232,7 @@ def set_nl(value) when String then value when Array then value.select {|v| v.is_a?(String)} when Hash - value.delete_if {|k, v| !BCP47::Language.identify(k)} + value.delete_if {|k, v| !BCP47.valid?(k)} value.each do |k, v| value[k] = Array(v).select {|vv| vv.is_a?(String)} end diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 4f6d0d4..704a8c1 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = '>= 2.6' gem.requirements = [] - gem.add_runtime_dependency 'bcp47', '~> 0.3', '>= 0.3.3' + gem.add_runtime_dependency 'bcp47_spec', '~> 0.2' gem.add_runtime_dependency 'rdf', '~> 3.2', '>= 3.2.7' gem.add_runtime_dependency 'rdf-vocab', '~> 3.2' gem.add_runtime_dependency 'rdf-xsd', '~> 3.2' diff --git a/spec/metadata_spec.rb b/spec/metadata_spec.rb index 1aef633..d63af19 100644 --- a/spec/metadata_spec.rb +++ b/spec/metadata_spec.rb @@ -110,7 +110,6 @@ subject.send("#{prop}=".to_sym, v) expect(subject).to be_valid # Causes re-validation expect(logger.to_s).not_to include "ERROR" - expect(logger.to_s).to include "WARN" end end it "errors" do From 8a73ec114a3cd41246606d82f735704946aca890 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 26 Aug 2023 13:10:12 -0700 Subject: [PATCH 6/8] Updates for version 3.3.0 with minimum Ruby version 3.0. --- .github/workflows/ci.yml | 9 ++------- README.md | 4 ++-- VERSION | 2 +- rdf-tabular.gemspec | 16 ++++++++-------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab11c04..b9ff1ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby] + ruby: ['3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository uses: actions/checkout@v3 @@ -33,7 +33,7 @@ jobs: run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action uses: coverallsapp/github-action@v2 - if: "matrix.ruby == '3.0'" + if: "matrix.ruby == '3.2'" with: github-token: ${{ secrets.GITHUB_TOKEN }} wintests: @@ -59,8 +59,3 @@ jobs: run: bundle install --jobs 4 --retry 3 - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2 - if: "matrix.ruby == '3.0'" - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e921b4d..2ca3cd0 100644 --- a/README.md +++ b/README.md @@ -253,8 +253,8 @@ Full documentation available on [RubyDoc](https://rubydoc.info/gems/rdf-tabular/ * {RDF::Tabular::Reader} ## Dependencies -* [Ruby](https://ruby-lang.org/) (>= 2.6) -* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2) +* [Ruby](https://ruby-lang.org/) (>= 3.0) +* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3) * [JSON](https://rubygems.org/gems/json) (>= 2.6) ## Installation diff --git a/VERSION b/VERSION index e4604e3..15a2799 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.1 +3.3.0 diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 704a8c1..8a71cbb 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -27,22 +27,22 @@ Gem::Specification.new do |gem| gem.extensions = %w() gem.test_files = Dir.glob('spec/*.rb') + Dir.glob('spec/data/**') - gem.required_ruby_version = '>= 2.6' + gem.required_ruby_version = '>= 3.0' gem.requirements = [] gem.add_runtime_dependency 'bcp47_spec', '~> 0.2' - gem.add_runtime_dependency 'rdf', '~> 3.2', '>= 3.2.7' + gem.add_runtime_dependency 'rdf', '~> 3.3' gem.add_runtime_dependency 'rdf-vocab', '~> 3.2' gem.add_runtime_dependency 'rdf-xsd', '~> 3.2' - gem.add_runtime_dependency 'json-ld', '~> 3.2' + gem.add_runtime_dependency 'json-ld', '~> 3.3' gem.add_runtime_dependency 'addressable', '~> 2.8' - gem.add_development_dependency 'nokogiri', '~> 1.13', '>= 1.13.4' - gem.add_development_dependency 'rspec', '~> 3.10' + gem.add_development_dependency 'nokogiri', '~> 1.15', '>= 1.13.4' + gem.add_development_dependency 'rspec', '~> 3.12' gem.add_development_dependency 'rspec-its', '~> 1.3' - gem.add_development_dependency 'rdf-isomorphic', '~> 3.2' - gem.add_development_dependency 'rdf-spec', '~> 3.2' + gem.add_development_dependency 'rdf-isomorphic', '~> 3.3' + gem.add_development_dependency 'rdf-spec', '~> 3.3' gem.add_development_dependency 'rdf-turtle', '~> 3.2' gem.add_development_dependency 'sparql', '~> 3.2' - gem.add_development_dependency 'webmock', '~> 3.14' + gem.add_development_dependency 'webmock', '~> 3.19' gem.add_development_dependency 'yard' , '~> 0.9' gem.post_install_message = nil From 503cea821e0647a7a8a6baae657e14c4032f9df3 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 28 Aug 2023 09:11:43 -0700 Subject: [PATCH 7/8] Update dependencies. --- Gemfile | 2 +- rdf-tabular.gemspec | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 6d791cc..8e42ce7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'rdf', github: "ruby-rdf/rdf", branch: "develop" gem 'rdf-xsd', github: "ruby-rdf/rdf-xsd", branch: "develop" group :development do - gem 'linkeddata', github: "ruby-rdf/linkeddata", branch: "develop" + gem 'linkeddata' gem 'ebnf', github: "dryruby/ebnf", branch: "develop" gem 'json-ld', github: "ruby-rdf/json-ld", branch: "develop" gem 'rdf-aggregate-repo', github: "ruby-rdf/rdf-aggregate-repo", branch: "develop" diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 8a71cbb..480b16f 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -31,8 +31,8 @@ Gem::Specification.new do |gem| gem.requirements = [] gem.add_runtime_dependency 'bcp47_spec', '~> 0.2' gem.add_runtime_dependency 'rdf', '~> 3.3' - gem.add_runtime_dependency 'rdf-vocab', '~> 3.2' - gem.add_runtime_dependency 'rdf-xsd', '~> 3.2' + gem.add_runtime_dependency 'rdf-vocab', '~> 3.3' + gem.add_runtime_dependency 'rdf-xsd', '~> 3.3' gem.add_runtime_dependency 'json-ld', '~> 3.3' gem.add_runtime_dependency 'addressable', '~> 2.8' gem.add_development_dependency 'nokogiri', '~> 1.15', '>= 1.13.4' @@ -40,8 +40,8 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'rspec-its', '~> 1.3' gem.add_development_dependency 'rdf-isomorphic', '~> 3.3' gem.add_development_dependency 'rdf-spec', '~> 3.3' - gem.add_development_dependency 'rdf-turtle', '~> 3.2' - gem.add_development_dependency 'sparql', '~> 3.2' + gem.add_development_dependency 'rdf-turtle', '~> 3.3' + gem.add_development_dependency 'sparql', '~> 3.3' gem.add_development_dependency 'webmock', '~> 3.19' gem.add_development_dependency 'yard' , '~> 0.9' From fce9c3bc6db1537b938455a59f8b647bc6cd85d3 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 1 Sep 2023 13:43:47 -0700 Subject: [PATCH 8/8] simplecov 0.22. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8e42ce7..a6079c9 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,6 @@ group :debug do end group :development, :test do - gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov', '~> 0.22', platforms: :mri gem 'simplecov-lcov', '~> 0.8', platforms: :mri end