From 1f597b59de53274f03edd8c780f51a8a67669ffe Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 28 Jan 2022 11:48:41 -0800 Subject: [PATCH 1/5] Update documentation links to use gh-pages, and add action to publish gh-pages from Yard docs. --- .github/workflows/ci.yml | 2 +- .github/workflows/generate-docs.yml | 27 +++++++++++++++++++++++++++ README.md | 4 ++-- etc/doap.csv | 2 +- etc/doap.ttl | 2 +- etc/earl.html | 4 ++-- etc/earl.jsonld | 2 +- etc/earl.ttl | 2 +- lib/rdf/tabular/reader.rb | 2 +- rdf-tabular.gemspec | 7 +++++++ 10 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/generate-docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9827680..1da320a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: ruby: - 2.6 - 2.7 - - 3.0 + - "3.0" - 3.1 - ruby-head - jruby diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 0000000..b8d16ed --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -0,0 +1,27 @@ +name: Build & deploy documentation +on: + push: + branches: + - master + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + name: Update gh-pages with docs + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + - name: Install required gem dependencies + run: gem install yard --no-document + - name: Build YARD Ruby Documentation + run: yardoc + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/yard + publish_branch: gh-pages diff --git a/README.md b/README.md index 4e34ff0..2ebdad3 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ This results in the following Turtle: doap:developer ; doap:documenter ; doap:download-page ; - doap:homepage ; + doap:homepage ; doap:implements , , , @@ -165,7 +165,7 @@ It can also generate JSON output (not complete JSON-LD, but compatible with it), "@id": "https://rubygems.org/gems/rdf-tabular", "http://usefulinc.com/ns/doap#name": "RDF::Tabular", "@type": "http://usefulinc.com/ns/doap#Project", - "http://usefulinc.com/ns/doap#homepage": "http://ruby-rdf.github.com/rdf-tabular", + "http://usefulinc.com/ns/doap#homepage": "https://ruby-rdf.github.io/rdf-tabular", "http://usefulinc.com/ns/doap#license": "https://unlicense.org/1.0/", "http://usefulinc.com/ns/doap#shortdesc": "Tabular Data RDF Reader and JSON serializer.", "http://usefulinc.com/ns/doap#description": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", diff --git a/etc/doap.csv b/etc/doap.csv index b102fd8..b2c12f4 100644 --- a/etc/doap.csv +++ b/etc/doap.csv @@ -1,5 +1,5 @@ name,type,homepage,license,shortdesc,description,created,programming_language,implements,category,download_page,mailing_list,bug_database,blog,developer,maintainer,documenter,maker,dc_title,dc_description,dc_date,dc_creator,isPartOf -RDF::Tabular,http://usefulinc.com/ns/doap#Project,http://ruby-rdf.github.com/rdf-tabular,https://unlicense.org/1.0/,Tabular Data RDF Reader and JSON serializer.,RDF::Tabular processes tabular data with metadata creating RDF or JSON output.,1/5/2015,Ruby,http://www.w3.org/TR/tabular-data-model/,http://dbpedia.org/resource/Resource_Description_Framework,https://rubygems.org/gems/rdf-tabular,http://lists.w3.org/Archives/Public/public-rdf-ruby/,https://github.com/ruby-rdf/rdf-tabular/issues,http://greggkellogg.net/,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,RDF::Tabular,RDF::Tabular processes tabular data with metadata creating RDF or JSON output.,1/5/2015,http://greggkellogg.net/foaf#me,https://rubygems.org/gems/rdf +RDF::Tabular,http://usefulinc.com/ns/doap#Project,https://ruby-rdf.github.io/rdf-tabular,https://unlicense.org/1.0/,Tabular Data RDF Reader and JSON serializer.,RDF::Tabular processes tabular data with metadata creating RDF or JSON output.,1/5/2015,Ruby,http://www.w3.org/TR/tabular-data-model/,http://dbpedia.org/resource/Resource_Description_Framework,https://rubygems.org/gems/rdf-tabular,http://lists.w3.org/Archives/Public/public-rdf-ruby/,https://github.com/ruby-rdf/rdf-tabular/issues,http://greggkellogg.net/,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,http://greggkellogg.net/foaf#me,RDF::Tabular,RDF::Tabular processes tabular data with metadata creating RDF or JSON output.,1/5/2015,http://greggkellogg.net/foaf#me,https://rubygems.org/gems/rdf ,http://www.w3.org/ns/earl#TestSubject,,,,,,,http://www.w3.org/TR/tabular-metadata/,http://dbpedia.org/resource/Ruby_(programming_language),,,,,,,,,,,,, ,http://www.w3.org/ns/earl#Software,,,,,,,http://www.w3.org/TR/csv2rdf/,,,,,,,,,,,,,, ,,,,,,,,http://www.w3.org/TR/csv2json/,,,,,,,,,,,,,, \ No newline at end of file diff --git a/etc/doap.ttl b/etc/doap.ttl index 613c963..6764578 100644 --- a/etc/doap.ttl +++ b/etc/doap.ttl @@ -9,7 +9,7 @@ <> a doap:Project, earl:TestSubject, earl:Software ; doap:name "RDF::Tabular" ; - doap:homepage ; + doap:homepage ; doap:license ; doap:shortdesc "Tabular Data RDF Reader and JSON serializer for RDF.rb."@en ; doap:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output for the RDF.rb library suite."@en ; diff --git a/etc/earl.html b/etc/earl.html index c848b66..04eeef3 100644 --- a/etc/earl.html +++ b/etc/earl.html @@ -100,8 +100,8 @@

Ruby
Home Page
- - http://ruby-rdf.github.com/rdf-tabular + + https://ruby-rdf.github.io/rdf-tabular
Developer
diff --git a/etc/earl.jsonld b/etc/earl.jsonld index 1610448..7bcb041 100644 --- a/etc/earl.jsonld +++ b/etc/earl.jsonld @@ -152,7 +152,7 @@ } ], "doapDesc": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", - "homepage": "http://ruby-rdf.github.com/rdf-tabular", + "homepage": "https://ruby-rdf.github.io/rdf-tabular", "language": "Ruby" } ], diff --git a/etc/earl.ttl b/etc/earl.ttl index f7592f1..b65300b 100644 --- a/etc/earl.ttl +++ b/etc/earl.ttl @@ -8,7 +8,7 @@ a doap:Project, earl:TestSubject, earl:Software ; doap:name "RDF::Tabular" ; - doap:homepage ; + doap:homepage ; doap:license ; doap:shortdesc "Tabular Data RDF Reader and JSON serializer."@en ; doap:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output."@en ; diff --git a/lib/rdf/tabular/reader.rb b/lib/rdf/tabular/reader.rb index 5532dc6..c29cafc 100644 --- a/lib/rdf/tabular/reader.rb +++ b/lib/rdf/tabular/reader.rb @@ -22,7 +22,7 @@ class Reader < RDF::Reader ## # Writer options - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Writer#options-class_method + # @see https://ruby-rdf.github.io/rdf/RDF/Writer#options-class_method def self.options super + [ RDF::CLI::Option.new( diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 5605071..493956d 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -10,6 +10,13 @@ Gem::Specification.new do |gem| gem.license = 'Unlicense' gem.summary = "Tabular Data RDF Reader and JSON serializer." gem.description = "RDF::Tabular processes tabular data with metadata creating RDF or JSON output." + gem.metadata = { + "documentation_uri" => "https://ruby-rdf.github.io/rdf-tabular", + "bug_tracker_uri" => "https://github.com/ruby-rdf/rdf-tabular/issues", + "homepage_uri" => "https://github.com/ruby-rdf/rdf-tabular", + "mailing_list_uri" => "https://lists.w3.org/Archives/Public/public-rdf-ruby/", + "source_code_uri" => "https://github.com/ruby-rdf/rdf-tabular", + } gem.authors = ['Gregg Kellogg'] gem.email = 'public-rdf-ruby@w3.org' From 32d68a9a8c6fbd66bc93c74eec1cfd99c7b38ebf Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 20 Apr 2022 10:47:10 -0700 Subject: [PATCH 2/5] Update nokogiri dependency. --- rdf-tabular.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 493956d..0e48785 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'rdf-xsd', '~> 3.2' gem.add_runtime_dependency 'json-ld', '~> 3.2' gem.add_runtime_dependency 'addressable', '~> 2.8' - gem.add_development_dependency 'nokogiri', '~> 1.12' + gem.add_development_dependency 'nokogiri', '~> 1.13', '>= 1.13.4' gem.add_development_dependency 'rspec', '~> 3.10' gem.add_development_dependency 'rspec-its', '~> 1.3' gem.add_development_dependency 'rdf-isomorphic', '~> 3.2' From 687a7f54b24a2bd50a299c8269c1048c85ded34a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 20 Apr 2022 10:47:23 -0700 Subject: [PATCH 3/5] Add windows CI. --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1da320a..e816df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,3 +42,31 @@ jobs: if: "matrix.ruby == '3.0'" with: github-token: ${{ secrets.GITHUB_TOKEN }} + wintests: + name: Ruby ${{ matrix.ruby }} + if: "contains(github.event.commits[0].message, '[ci skip]') == false" + runs-on: windows-latest + env: + CI: true + ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }} + strategy: + fail-fast: false + matrix: + ruby: + - 3.1 + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + 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@v1.1.2 + if: "matrix.ruby == '3.0'" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} From ecda159be46767d0e1819de0d312c0a75ae13228 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 22 Apr 2022 16:01:37 -0700 Subject: [PATCH 4/5] * Fix README examples. * Improve check for absolute base URI, and creation of `file` scheme URIs for local resources. This improves accessing local files on the Windows platform. --- .github/workflows/ci.yml | 2 +- README.md | 214 +++++++++++++++++------------------- lib/rdf/tabular/metadata.rb | 2 +- lib/rdf/tabular/reader.rb | 3 +- rdf-tabular.gemspec | 2 +- 5 files changed, 105 insertions(+), 118 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e816df2..0589f05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} wintests: - name: Ruby ${{ matrix.ruby }} + name: Win64 Ruby ${{ matrix.ruby }} if: "contains(github.event.commits[0].message, '[ci skip]') == false" runs-on: windows-latest env: diff --git a/README.md b/README.md index 2ebdad3..da8fcbe 100644 --- a/README.md +++ b/README.md @@ -69,40 +69,41 @@ This results in the following Turtle: @prefix csvw: . @prefix dc: . @prefix doap: . + @prefix earl: . @prefix foaf: . @prefix prov: . @prefix rdf: . @prefix xsd: . a doap:Project, - , - ; - dc:title "RDF::Tabular"; - dc:creator ; - dc:date "2015-01-05"^^xsd:date; - dc:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output."@en; - dc:isPartOf ; - doap:blog ; - doap:bug-database ; - doap:category , - ; - doap:created "2015-01-05"^^xsd:date; - doap:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output."@en; - doap:developer ; - doap:documenter ; - doap:download-page ; - doap:homepage ; - doap:implements , - , - , - ; - doap:license ; - doap:mailing-list ; - doap:maintainer ; - doap:name "RDF::Tabular"; - doap:programming-language "Ruby"; - doap:shortdesc "Tabular Data RDF Reader and JSON serializer."@en; - foaf:maker . + earl:TestSubject, + earl:Software; + dc:title "RDF::Tabular"; + dc:creator ; + dc:date "2015-01-05"^^xsd:date; + dc:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output."@en; + dc:isPartOf ; + doap:blog ; + doap:bug-database ; + doap:category , + ; + doap:created "2015-01-05"^^xsd:date; + doap:description "RDF::Tabular processes tabular data with metadata creating RDF or JSON output."@en; + doap:developer ; + doap:documenter ; + doap:download-page ; + doap:homepage ; + doap:implements , + , + , + ; + doap:license ; + doap:mailing-list ; + doap:maintainer ; + doap:name "RDF::Tabular"; + doap:programming-language "Ruby"; + doap:shortdesc "Tabular Data RDF Reader and JSON serializer."@en; + foaf:maker . [ a csvw:TableGroup; @@ -112,119 +113,104 @@ This results in the following Turtle: a csvw:Row; csvw:describes ; csvw:rownum 1; - csvw:url - ], [ + csvw:url + ], [ a csvw:Row; csvw:describes ; csvw:rownum 2; - csvw:url - ], [ + csvw:url + ], [ a csvw:Row; csvw:describes ; csvw:rownum 3; - csvw:url - ], [ + csvw:url + ], [ a csvw:Row; csvw:describes ; csvw:rownum 4; - csvw:url + csvw:url ]; - csvw:url + csvw:url ]; prov:wasGeneratedBy [ a prov:Activity; - prov:endedAtTime "2015-04-11T12:33:26Z"^^xsd:dateTime; + prov:endedAtTime "2022-04-20T12:45:20.616-07:00"^^xsd:dateTime; prov:qualifiedUsage [ a prov:Usage; - prov:entity ; + prov:entity ; prov:hadRole csvw:csvEncodedTabularData - ], [ + ], [ a prov:Usage; - prov:entity ; + prov:entity ; prov:hadRole csvw:tabularMetadata ]; - prov:startedAtTime "2015-04-11T12:33:25Z"^^xsd:dateTime; + prov:startedAtTime "2022-04-20T12:45:20.351-07:00"^^xsd:dateTime; prov:wasAssociatedWith ] - ] . + ] . The provenance on table-source information can be excluded by using the `:minimal` option to the reader. It can also generate JSON output (not complete JSON-LD, but compatible with it), using the {RDF::Tabular::Reader#to_json} method: { - "table": [ - { - "url": "file://users/gregg/Projects/rdf-tabular/etc/doap.csv", - "row": [ - { - "url": "file://users/gregg/Projects/rdf-tabular/etc/doap.csv#row=2", - "rownum": 1, - "describes": [ - { - "@id": "https://rubygems.org/gems/rdf-tabular", - "http://usefulinc.com/ns/doap#name": "RDF::Tabular", - "@type": "http://usefulinc.com/ns/doap#Project", - "http://usefulinc.com/ns/doap#homepage": "https://ruby-rdf.github.io/rdf-tabular", - "http://usefulinc.com/ns/doap#license": "https://unlicense.org/1.0/", - "http://usefulinc.com/ns/doap#shortdesc": "Tabular Data RDF Reader and JSON serializer.", - "http://usefulinc.com/ns/doap#description": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", - "http://usefulinc.com/ns/doap#created": "2015-01-05", - "http://usefulinc.com/ns/doap#programming-language": "Ruby", - "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/tabular-data-model/", - "http://usefulinc.com/ns/doap#category": "http://dbpedia.org/resource/Resource_Description_Framework", - "http://usefulinc.com/ns/doap#download-page": "https://rubygems.org/gems/rdf-tabular", - "http://usefulinc.com/ns/doap#mailing-list": "http://lists.w3.org/Archives/Public/public-rdf-ruby/", - "http://usefulinc.com/ns/doap#bug-database": "https://github.com/ruby-rdf/rdf-tabular/issues", - "http://usefulinc.com/ns/doap#blog": "http://greggkellogg.net/", - "http://usefulinc.com/ns/doap#developer": "http://greggkellogg.net/foaf#me", - "http://usefulinc.com/ns/doap#maintainer": "http://greggkellogg.net/foaf#me", - "http://usefulinc.com/ns/doap#documenter": "http://greggkellogg.net/foaf#me", - "foaf:maker": "http://greggkellogg.net/foaf#me", - "dc:title": "RDF::Tabular", - "dc:description": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", - "dc:date": "2015-01-05", - "dc:creator": "http://greggkellogg.net/foaf#me", - "dc:isPartOf": "https://rubygems.org/gems/rdf" - } - ] - }, - { - "url": "file://users/gregg/Projects/rdf-tabular/etc/doap.csv#row=3", - "rownum": 2, - "describes": [ - { - "@id": "https://rubygems.org/gems/rdf-tabular", - "@type": "http://www.w3.org/ns/earl#TestSubject", - "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/tabular-metadata/", - "http://usefulinc.com/ns/doap#category": "http://dbpedia.org/resource/Ruby_(programming_language)" - } - ] - }, - { - "url": "file://users/gregg/Projects/rdf-tabular/etc/doap.csv#row=4", - "rownum": 3, - "describes": [ - { - "@id": "https://rubygems.org/gems/rdf-tabular", - "@type": "http://www.w3.org/ns/earl#Software", - "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/csv2rdf/" - } - ] - }, - { - "url": "file://users/gregg/Projects/rdf-tabular/etc/doap.csv#row=5", - "rownum": 4, - "describes": [ - { - "@id": "https://rubygems.org/gems/rdf-tabular", - "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/csv2json/" - } - ] - } - ] - } - ] + "tables": [{ + "url": "https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv", + "row": [{ + "url": "https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv#row=2", + "rownum": 1, + "describes": [{ + "@id": "https://rubygems.org/gems/rdf-tabular", + "http://usefulinc.com/ns/doap#name": "RDF::Tabular", + "@type": "http://usefulinc.com/ns/doap#Project", + "http://usefulinc.com/ns/doap#homepage": "https://ruby-rdf.github.io/rdf-tabular", + "http://usefulinc.com/ns/doap#license": "https://unlicense.org/1.0/", + "http://usefulinc.com/ns/doap#shortdesc": "Tabular Data RDF Reader and JSON serializer.", + "http://usefulinc.com/ns/doap#description": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", + "http://usefulinc.com/ns/doap#created": "2015-01-05", + "http://usefulinc.com/ns/doap#programming-language": "Ruby", + "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/tabular-data-model/", + "http://usefulinc.com/ns/doap#category": "http://dbpedia.org/resource/Resource_Description_Framework", + "http://usefulinc.com/ns/doap#download-page": "https://rubygems.org/gems/rdf-tabular", + "http://usefulinc.com/ns/doap#mailing-list": "http://lists.w3.org/Archives/Public/public-rdf-ruby/", + "http://usefulinc.com/ns/doap#bug-database": "https://github.com/ruby-rdf/rdf-tabular/issues", + "http://usefulinc.com/ns/doap#blog": "http://greggkellogg.net/", + "http://usefulinc.com/ns/doap#developer": "http://greggkellogg.net/foaf#me", + "http://usefulinc.com/ns/doap#maintainer": "http://greggkellogg.net/foaf#me", + "http://usefulinc.com/ns/doap#documenter": "http://greggkellogg.net/foaf#me", + "foaf:maker": "http://greggkellogg.net/foaf#me", + "dc:title": "RDF::Tabular", + "dc:description": "RDF::Tabular processes tabular data with metadata creating RDF or JSON output.", + "dc:date": "2015-01-05", + "dc:creator": "http://greggkellogg.net/foaf#me", + "dc:isPartOf": "https://rubygems.org/gems/rdf" + }] + }, { + "url": "https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv#row=3", + "rownum": 2, + "describes": [{ + "@id": "https://rubygems.org/gems/rdf-tabular", + "@type": "http://www.w3.org/ns/earl#TestSubject", + "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/tabular-metadata/", + "http://usefulinc.com/ns/doap#category": "http://dbpedia.org/resource/Ruby_(programming_language)" + }] + }, { + "url": "https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv#row=4", + "rownum": 3, + "describes": [{ + "@id": "https://rubygems.org/gems/rdf-tabular", + "@type": "http://www.w3.org/ns/earl#Software", + "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/csv2rdf/" + }] + }, { + "url": "https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv#row=5", + "rownum": 4, + "describes": [{ + "@id": "https://rubygems.org/gems/rdf-tabular", + "http://usefulinc.com/ns/doap#implements": "http://www.w3.org/TR/csv2json/" + }] + }] + }] } ## Tutorials diff --git a/lib/rdf/tabular/metadata.rb b/lib/rdf/tabular/metadata.rb index b4f8a04..37d86b2 100644 --- a/lib/rdf/tabular/metadata.rb +++ b/lib/rdf/tabular/metadata.rb @@ -142,7 +142,7 @@ def self.open(path, **options) 'Accept' => 'application/ld+json, application/json' } ) - path = "file:" + path unless path =~ /^\w+:/ + path = "file:#{path}" if RDF::URI(path).relative? RDF::Util::File.open_file(path, **options) do |file| self.new(file, **options.merge(base: path, filenames: path)) end diff --git a/lib/rdf/tabular/reader.rb b/lib/rdf/tabular/reader.rb index c29cafc..34a4377 100644 --- a/lib/rdf/tabular/reader.rb +++ b/lib/rdf/tabular/reader.rb @@ -80,7 +80,8 @@ def initialize(input = $stdin, **options, &block) @options[:base] ||= input.path if input.respond_to?(:path) @options[:base] ||= input.filename if input.respond_to?(:filename) if RDF::URI(@options[:base]).relative? && File.exist?(@options[:base].to_s) - @options[:base] = RDF::URI("file:/#{File.expand_path(@options[:base])}").normalize + file_uri = "file:" + File.expand_path(@options[:base]) + @options[:base] = RDF::URI(file_uri.to_s).normalize end log_debug("Reader#initialize") {"input: #{input.inspect}, base: #{@options[:base]}"} diff --git a/rdf-tabular.gemspec b/rdf-tabular.gemspec index 0e48785..4f6d0d4 100755 --- a/rdf-tabular.gemspec +++ b/rdf-tabular.gemspec @@ -30,7 +30,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 'rdf', '~> 3.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' gem.add_runtime_dependency 'json-ld', '~> 3.2' From 8221fb358b98a671ae877192565b6f407f9d5858 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 26 Apr 2022 08:50:18 -0700 Subject: [PATCH 5/5] Version 3.2.1. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 944880f..e4604e3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.2.1