Skip to content

Commit 9e563ea

Browse files
committed
Finish 3.1.2
2 parents f6afa23 + 02ae27b commit 9e563ea

File tree

14 files changed

+203
-73
lines changed

14 files changed

+203
-73
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repo_token: T4Cj59vkwBh79F3pGpO8GAJ9pdMACx9b9

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.
2+
3+
name: CI
4+
on:
5+
push:
6+
branches: [ '**' ]
7+
pull_request:
8+
branches: [ develop ]
9+
workflow_dispatch:
10+
11+
jobs:
12+
tests:
13+
name: Ruby ${{ matrix.ruby }}
14+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
15+
runs-on: ubuntu-latest
16+
env:
17+
CI: true
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
ruby:
22+
- 2.4
23+
- 2.5
24+
- 2.6
25+
- 2.7
26+
- 3.0
27+
- ruby-head
28+
- jruby
29+
steps:
30+
- name: Clone repository
31+
uses: actions/checkout@v2
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.ruby }}
36+
- name: Install dependencies
37+
run: bundle install --jobs 4 --retry 3
38+
- name: Run tests
39+
run: bundle exec rspec spec
40+

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
2828
enough, be assured we will eventually add you in there.
2929
* Do note that in order for us to merge any non-trivial changes (as a rule
3030
of thumb, additions larger than about 15 lines of code), we need an
31-
explicit [public domain dedication][PDD] on record from you.
31+
explicit [public domain dedication][PDD] on record from you,
32+
which you will be asked to agree to on the first commit to a repo within the organization.
33+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
3234

3335
[YARD]: https://yardoc.org/
3436
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
35-
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
36-
[pr]: https://github.com/ruby-rdf/rdf-trig/compare/
37+
[PDD]: https://unlicense.org/#unlicensing-contributions
38+
[pr]: https://github.com/ruby-rdf/rdf/compare/

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "devel
88

99
group :development do
1010
gem "byebug", platforms: :mri
11-
gem 'psych', platforms: [:mri, :rbx]
1211
end
1312

1413
group :development, :test do

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
[TriG][] reader/writer for [RDF.rb][RDF.rb] .
44

55
[![Gem Version](https://badge.fury.io/rb/rdf-trig.png)](https://badge.fury.io/rb/rdf-trig)
6-
[![Build Status](https://travis-ci.org/ruby-rdf/rdf-trig.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-trig)
7-
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-trig/badge.svg)](https://coveralls.io/r/ruby-rdf/rdf-trig)
6+
[![Build Status](https://github.com/ruby-rdf/rdf-trig/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-trig/actions?query=workflow%3ACI)
7+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-trig/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-trig?branch=develop)
8+
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
89

910
## Description
1011
This is a [Ruby][] implementation of a [TriG][] reader and writer for [RDF.rb][].
@@ -85,7 +86,9 @@ To install the latest official release of the `RDF::TriG` gem, do:
8586
list in the the `README`. Alphabetical order applies.
8687
* Do note that in order for us to merge any non-trivial changes (as a rule
8788
of thumb, additions larger than about 15 lines of code), we need an
88-
explicit [public domain dedication][PDD] on record from you.
89+
explicit [public domain dedication][PDD] on record from you,
90+
which you will be asked to agree to on the first commit to a repo within the organization.
91+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
8992

9093
## License
9194
This is free and unencumbered public domain software. For more information,
@@ -97,7 +100,7 @@ A copy of the [TriG EBNF][] and derived parser files are included in the reposit
97100
[RDF]: https://www.w3.org/RDF/
98101
[YARD]: https://yardoc.org/
99102
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
100-
[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
103+
[PDD]: https://unlicense.org/#unlicensing-contributions
101104
[RDF.rb]: https://rubydoc.info/github/ruby-rdf/rdf/master/frames
102105
[Backports]: https://rubygems.org/gems/backports
103106
[TriG]: https://www.w3.org/TR/trig/

Rakefile

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,3 @@ namespace :gem do
1313
sh "gem push pkg/rdf-trig-#{File.read('VERSION').chomp}.gem"
1414
end
1515
end
16-
17-
desc 'Default: run specs.'
18-
task :default => :spec
19-
task :specs => :spec
20-
21-
require 'rspec/core/rake_task'
22-
desc 'Run specifications'
23-
RSpec::Core::RakeTask.new do |spec|
24-
spec.rspec_opts = %w(--options spec/spec.opts) if File.exists?('spec/spec.opts')
25-
end
26-
27-
desc "Run specs through RCov"
28-
RSpec::Core::RakeTask.new("spec:rcov") do |spec|
29-
spec.rcov = true
30-
spec.rcov_opts = %q[--exclude "spec"]
31-
end
32-
33-
desc "Generate HTML report specs"
34-
RSpec::Core::RakeTask.new("doc:spec") do |spec|
35-
spec.rspec_opts = ["--format", "html", "-o", "doc/spec.html"]
36-
end
37-
38-
require 'yard'
39-
namespace :doc do
40-
YARD::Rake::YardocTask.new
41-
end

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.1.2

etc/doap.ttl

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,38 @@
77
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
88

99
<https://github.com/ruby-rdf/rdf-trig> a doap:GitRepository;
10-
dc:title "RDF::TriG";
11-
doap:browse <https://github.com/ruby-rdf/rdf-trig> .
10+
dc:title "RDF::TriG";
11+
doap:browse <https://github.com/ruby-rdf/rdf-trig> .
1212

13-
<> a doap:Project, earl:TestSubject, earl:Software;
14-
doap:blog <https://greggkellogg.net/> ;
15-
doap:developer <https://greggkellogg.net/foaf#me>;
16-
doap:documenter <https://greggkellogg.net/foaf#me>;
17-
doap:maintainer <https://greggkellogg.net/foaf#me>;
18-
doap:bug-database <https://github.com/ruby-rdf/rdf-trig/issues>;
19-
doap:description "TriG reader/writer for RDF.rb";
20-
doap:name "RDF::TriG";
21-
doap:shortdesc "TriG reader/writer for Ruby."@en;
22-
doap:programming-language "Ruby";
23-
doap:repository <https://github.com/ruby-rdf/rdf-trig>;
24-
doap:mailing-list <https://lists.w3.org/Archives/Public/public-rdf-ruby/>;
25-
doap:implements <https://www.w3.org/TR/trig/> ;
26-
doap:category <http://dbpedia.org/resource/Resource_Description_Framework>,
27-
<http://dbpedia.org/resource/Ruby_(programming_language)>;
28-
doap:homepage <https://github.com/ruby-rdf/rdf-trig>;
29-
doap:license <https://unlicense.org/1.0/>;
30-
foaf:maker <https://greggkellogg.net/foaf#me> ;
31-
dc:date "2011-12-22"^^xsd:date;
32-
dc:creator <https://greggkellogg.net/foaf#me>;
33-
dc:description "TriG reader/writer for RDF.rb";
34-
dc:isPartOf <https://rubygems.org/gems/rdf> .
13+
<> a doap:Project, earl:TestSubject, earl:Software;
14+
doap:name "RDF::TriG";
15+
doap:shortdesc "TriG reader/writer for the RDF.rb library suite"@en;
16+
doap:description "TriG reader/writer for RDF.rb";
17+
doap:created "2011-12-22"^^xsd:date;
18+
doap:blog <https://greggkellogg.net/> ;
19+
doap:developer <https://greggkellogg.net/foaf#me>;
20+
doap:documenter <https://greggkellogg.net/foaf#me>;
21+
doap:maintainer <https://greggkellogg.net/foaf#me>;
22+
doap:bug-database <https://github.com/ruby-rdf/rdf-trig/issues>;
23+
doap:programming-language "Ruby";
24+
doap:repository <https://github.com/ruby-rdf/rdf-trig>;
25+
doap:mailing-list <https://lists.w3.org/Archives/Public/public-rdf-ruby/>;
26+
doap:implements <https://www.w3.org/TR/trig/> ;
27+
doap:category <http://dbpedia.org/resource/Resource_Description_Framework>,
28+
<http://dbpedia.org/resource/Ruby_(programming_language)>;
29+
doap:homepage <https://github.com/ruby-rdf/rdf-trig>;
30+
doap:license <https://unlicense.org/1.0/>;
31+
foaf:maker <https://greggkellogg.net/foaf#me> ;
32+
dc:creator <https://greggkellogg.net/foaf#me>;
33+
dc:isPartOf <https://rubygems.org/gems/rdf> .
3534

3635
<https://github.com/gkellogg> a foaf:OnlineAccount;
37-
dc:created "2009-01-13T08:58:46-08:00"^^xsd:dateTime;
38-
doap:homepage <https://greggkellogg.net/>;
39-
foaf:accountName "gkellogg";
40-
foaf:accountServiceHomepage <https://github.com/gkellogg>;
41-
foaf:name "GitHub";
42-
foaf:page <https://github.com/gkellogg> .
36+
dc:created "2009-01-13T08:58:46-08:00"^^xsd:dateTime;
37+
doap:homepage <https://greggkellogg.net/>;
38+
foaf:accountName "gkellogg";
39+
foaf:accountServiceHomepage <https://github.com/gkellogg>;
40+
foaf:name "GitHub";
41+
foaf:page <https://github.com/gkellogg> .
4342

4443
<https://greggkellogg.net/foaf#me> a foaf:Person;
4544
foaf:mbox <mailto:[email protected]>;

lib/rdf/trig/reader.rb

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ class Reader < RDF::Turtle::Reader
2323
terminal(:STRING_LITERAL_SINGLE_QUOTE, STRING_LITERAL_SINGLE_QUOTE, unescape: true)
2424

2525
# String terminals
26-
terminal(nil, %r([\{\}\(\),.;\[\]a]|\^\^|true|false))
26+
terminal(nil, %r(
27+
[\(\),.;\[\]Aa]
28+
| \^\^
29+
| \{\|
30+
| \|\}
31+
| [\{\}]
32+
| true|false
33+
| <<|>>
34+
)x)
2735

2836
terminal(:GRAPH, /graph/i)
2937
terminal(:PREFIX, PREFIX)
@@ -112,7 +120,7 @@ def read_block
112120
read_triplesOrGraph || error("Expected triplesOrGraph", production: :block, token: @lexer.first)
113121
when '{'
114122
read_wrappedGraph || error("Expected wrappedGraph", production: :block, token: @lexer.first)
115-
when '(', '['
123+
when '(', '[', '<<'
116124
read_triples2 || error("Expected collection or blankNodePropertyList", production: :block, token: @lexer.first)
117125
when nil
118126
# End of input
@@ -183,6 +191,23 @@ def read_triples2
183191
end
184192
true
185193
end
194+
when '<<'
195+
prod(:triples2) do
196+
subject = read_embTriple || error("Failed to parse embedded triple", production: :triples2, token: @lexer.first)
197+
token = @lexer.first
198+
case token && (token.type || token.value)
199+
when 'a', :IRIREF, :PNAME_LN, :PNAME_NS then read_predicateObjectList(subject)
200+
else error("Expected predicateObjectList after collection subject", production: :triples2, token: token)
201+
end
202+
if !@recovering || @lexer.first === '.'
203+
# If recovering, we will have eaten the closing '.'
204+
token = @lexer.shift
205+
unless token && token.value == '.'
206+
error("Expected '.' following triple", production: :triples2, token: token)
207+
end
208+
end
209+
true
210+
end
186211
end
187212
end
188213

rdf-trig.gemspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ Gem::Specification.new do |gem|
2121
gem.required_ruby_version = '>= 2.4'
2222
gem.requirements = []
2323
gem.add_runtime_dependency 'rdf', '~> 3.1'
24-
gem.add_runtime_dependency 'ebnf', '~> 2.0'
24+
gem.add_runtime_dependency 'ebnf', '~> 2.1'
2525
gem.add_runtime_dependency 'rdf-turtle', '~> 3.1'
2626
gem.add_development_dependency 'json-ld', '~> 3.1'
27-
gem.add_development_dependency 'rspec', '~> 3.9'
27+
gem.add_development_dependency 'rspec', '~> 3.10'
2828
gem.add_development_dependency 'rspec-its', '~> 1.3'
2929
gem.add_development_dependency 'rdf-isomorphic', '~> 3.1'
30-
gem.add_development_dependency 'yard' , '~> 0.9.20'
30+
gem.add_development_dependency 'yard' , '~> 0.9'
3131
gem.add_development_dependency 'rdf-spec', '~> 3.1'
32-
gem.add_development_dependency 'rake', '~> 13.0'
3332

3433
gem.post_install_message = nil
3534
end

0 commit comments

Comments
 (0)