Skip to content

Commit

Permalink
Finish 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Sep 1, 2023
2 parents 8e9e46e + fce9c3b commit 30036aa
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 48 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby:
- 2.6
- 2.7
- "3.0"
- 3.1
- ruby-head
- jruby
ruby: ['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:
Expand All @@ -38,8 +32,8 @@ jobs:
- name: Run tests
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
if: "matrix.ruby == '3.0'"
uses: coverallsapp/github-action@v2
if: "matrix.ruby == '3.2'"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
wintests:
Expand All @@ -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:
Expand All @@ -65,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/[email protected]
if: "matrix.ruby == '3.0'"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ 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"
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"
Expand All @@ -23,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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.3.0
14 changes: 8 additions & 6 deletions lib/rdf/tabular/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -366,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
Expand Down Expand Up @@ -437,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)}
Expand Down Expand Up @@ -837,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"
Expand Down Expand Up @@ -1170,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}"
Expand Down Expand Up @@ -1230,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
Expand Down
26 changes: 13 additions & 13 deletions rdf-tabular.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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', '~> 0.3', '>= 0.3.3'
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'
gem.add_runtime_dependency 'json-ld', '~> 3.2'
gem.add_runtime_dependency 'bcp47_spec', '~> 0.2'
gem.add_runtime_dependency 'rdf', '~> 3.3'
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.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-turtle', '~> 3.2'
gem.add_development_dependency 'sparql', '~> 3.2'
gem.add_development_dependency 'webmock', '~> 3.14'
gem.add_development_dependency 'rdf-isomorphic', '~> 3.3'
gem.add_development_dependency 'rdf-spec', '~> 3.3'
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'

gem.post_install_message = nil
Expand Down
3 changes: 1 addition & 2 deletions spec/matchers.rb
Original file line number Diff line number Diff line change
@@ -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|
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion spec/metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
prov:endedAtTime ?end;
prov:qualifiedUsage [
a prov:Usage ;
prov:entity <http://example.org/country-codes-and-names.csv> ;
# prov:entity <http://example.org/country-codes-and-names.csv> ;
prov:hadRole csvw:csvEncodedTabularData
];
]
Expand All @@ -336,11 +336,11 @@
prov:endedAtTime ?end;
prov:qualifiedUsage [
a prov:Usage ;
prov:entity <http://example.org/countries.csv>, <http://example.org/country_slice.csv>;
# prov:entity <http://example.org/countries.csv>, <http://example.org/country_slice.csv>;
prov:hadRole csvw:csvEncodedTabularData
], [
a prov:Usage ;
prov:entity <http://example.org/countries.json> ;
# prov:entity <http://example.org/countries.json> ;
prov:hadRole csvw:tabularMetadata
];
]
Expand Down

0 comments on commit 30036aa

Please sign in to comment.