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 ed3b1c6 + 54b3c16 commit 8ad1069
Show file tree
Hide file tree
Showing 20 changed files with 223 additions and 246 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
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,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
if: "matrix.ruby == '3.0'"
uses: coverallsapp/github-action@v2
if: "matrix.ruby == '3.2'"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .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@v3
- 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
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -17,6 +17,6 @@ group :development, :test do
gem 'rdf-vocab', git: "https://github.com/ruby-rdf/rdf-vocab", branch: "develop"
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
gem "redcarpet", platform: :ruby
gem 'simplecov', '~> 0.21', platforms: :mri
gem 'simplecov', '~> 0.22', platforms: :mri
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
end
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -2,7 +2,7 @@

[TriG][] reader/writer for [RDF.rb][RDF.rb] .

[![Gem Version](https://badge.fury.io/rb/rdf-trig.png)](https://badge.fury.io/rb/rdf-trig)
[![Gem Version](https://badge.fury.io/rb/rdf-trig.svg)](https://badge.fury.io/rb/rdf-trig)
[![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)
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-trig/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-trig?branch=develop)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
Expand All @@ -17,7 +17,7 @@ Install with `gem install rdf-trig`

* 100% free and unencumbered [public domain](https://unlicense.org/) software.
* Implements a complete parser and serializer for [TriG][].
* Compatible with Ruby 2.x, and JRuby 1.7+.
* Compatible with Ruby 3.x, and JRuby 9+.
* Optional streaming writer, to serialize large graphs

## Usage
Expand Down Expand Up @@ -68,9 +68,9 @@ There is a new `:stream` option to {RDF::TriG::Writer} which is more efficient f

## Dependencies

* [Ruby](https://ruby-lang.org/) (>= 2.6)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
* [rdf-turtle](https://rubygems.org/gems/rdf-turtle) (~> 3.2)
* [Ruby](https://ruby-lang.org/) (>= 3.0)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3)
* [rdf-turtle](https://rubygems.org/gems/rdf-turtle) (~> 3.3)

## Installation

Expand Down Expand Up @@ -111,10 +111,10 @@ A copy of the [TriG EBNF][] and derived parser files are included in the reposit
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: https://unlicense.org/#unlicensing-contributions
[RDF.rb]: https://rubydoc.info/github/ruby-rdf/rdf/master/frames
[RDF.rb]: https://ruby-rdf.github.io/rdf/master/frames
[Backports]: https://rubygems.org/gems/backports
[RDF-star]: https://w3c.github.io/rdf-star/rdf-star-cg-spec.html
[TriG]: https://www.w3.org/TR/trig/
[TriG doc]: https://rubydoc.info/github/ruby-rdf/rdf-trig/master/file/README.markdown
[TriG doc]: https://ruby-rdf.github.io/rdf-trig/master/file/README.markdown
[TriG EBNF]: https://dvcs.w3.org/hg/rdf/raw-file/default/trig/trig.bnf
[Turtle doc]: https://rubydoc.info/github/ruby-rdf/rdf-turtle/master/file/README.markdown
[Turtle doc]: https://ruby-rdf.github.io/rdf-turtle/master/file/README.markdown
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.2.0
3.3.0
2 changes: 1 addition & 1 deletion etc/earl-nquads.ttl
Expand Up @@ -919,7 +919,7 @@
[ a earl:Assertion;
earl:assertedBy <http://greggkellogg.net/foaf#me>;
earl:subject <http://rubygems.org/gems/rdf>;
earl:test <http://www.w3.org/2013/N-QuadsTests/manifest.ttl#langtagged_string>;
earl:test <http://www.w3.org/2013/N-QuadsTests/manifest.ttl#LANG_DIRged_string>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
Expand Down
8 changes: 4 additions & 4 deletions etc/earl.ttl
Expand Up @@ -1072,7 +1072,7 @@
[ a earl:Assertion;
earl:assertedBy <http://greggkellogg.net/foaf#me>;
earl:subject <http://rubygems.org/gems/rdf-trig>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#langtagged_non_LONG>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#LANG_DIRged_non_LONG>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
Expand All @@ -1082,7 +1082,7 @@
[ a earl:Assertion;
earl:assertedBy <http://greggkellogg.net/foaf#me>;
earl:subject <http://rubygems.org/gems/rdf-trig>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#langtagged_LONG>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#LANG_DIRged_LONG>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
Expand Down Expand Up @@ -1192,7 +1192,7 @@
[ a earl:Assertion;
earl:assertedBy <http://greggkellogg.net/foaf#me>;
earl:subject <http://rubygems.org/gems/rdf-trig>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#trig-syntax-bad-LITERAL2_with_langtag_and_datatype>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#trig-syntax-bad-LITERAL2_with_LANG_DIR_and_datatype>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
Expand All @@ -1212,7 +1212,7 @@
[ a earl:Assertion;
earl:assertedBy <http://greggkellogg.net/foaf#me>;
earl:subject <http://rubygems.org/gems/rdf-trig>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#langtagged_LONG_with_subtag>;
earl:test <http://www.w3.org/2013/TriGTests/manifest.ttl#LANG_DIRged_LONG_with_subtag>;
earl:result [
a earl:TestResult;
earl:outcome earl:passed;
Expand Down
188 changes: 94 additions & 94 deletions etc/trig.bnf
@@ -1,97 +1,97 @@
[1g] trigDoc ::= ( directive | block )*
[2g] block ::= triplesOrGraph
| wrappedGraph
| triples2
| GRAPH labelOrSubject wrappedGraph
[3g] triplesOrGraph ::= labelOrSubject ( wrappedGraph | predicateObjectList '.' )
| quotedTriple predicateObjectList '.'
[4g] triples2 ::= blankNodePropertyList predicateObjectList? '.'
| collection predicateObjectList '.'
[5g] wrappedGraph ::= '{' triplesBlock? '}'
[6g] triplesBlock ::= triples ( '.' triplesBlock? )?
[7g] labelOrSubject ::= ( iri | BlankNode )
[3] directive ::= prefixID | base | sparqlPrefix | sparqlBase
[4] prefixID ::= PREFIX PNAME_NS IRIREF "."?
[5] base ::= BASE IRIREF "."?
[5s] sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF
[6s] sparqlBase ::= "BASE" IRIREF
[6] triples ::= subject predicateObjectList
| blankNodePropertyList predicateObjectList?
[7] predicateObjectList ::= verb objectList (';' (verb objectList)? )*
[8] objectList ::= object annotation? ( "," object annotation? )*
[9] verb ::= predicate | "a"
[10] subject ::= iri | blank | quotedTriple
[11] predicate ::= iri
[12] object ::= iri | blank | blankNodePropertyList | literal | quotedTriple
[13] literal ::= RDFLiteral | NumericLiteral | BooleanLiteral
[14] blank ::= BlankNode | collection
[15] blankNodePropertyList ::= "[" predicateObjectList "]"
[16] collection ::= "(" object* ")"
[17] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE
[128s] RDFLiteral ::= String ( LANGTAG | ( "^^" iri ) )?
[133s] BooleanLiteral ::= "true" | "false"
[18] String ::= STRING_LITERAL_QUOTE
| STRING_LITERAL_SINGLE_QUOTE
| STRING_LITERAL_LONG_SINGLE_QUOTE
| STRING_LITERAL_LONG_QUOTE
[135s] iri ::= IRIREF | PrefixedName
[136s] PrefixedName ::= PNAME_LN | PNAME_NS
[137s] BlankNode ::= BLANK_NODE_LABEL | ANON
[27] quotedTriple ::= "<<" qtSubject predicate qtObject ">>"
[28] qtSubject ::= iri | BlankNode | quotedTriple
[29] qtObject ::= iri | BlankNode | literal | quotedTriple
[30] annotation ::= '{|' predicateObjectList '|}'
trigDoc ::= ( directive | block )*
block ::= triplesOrGraph
| wrappedGraph
| triples2
| GRAPH labelOrSubject wrappedGraph
triplesOrGraph ::= labelOrSubject ( wrappedGraph | predicateObjectList '.' )
| quotedTriple predicateObjectList '.'
triples2 ::= blankNodePropertyList predicateObjectList? '.'
| collection predicateObjectList '.'
wrappedGraph ::= '{' triplesBlock? '}'
triplesBlock ::= triples ( '.' triplesBlock? )?
labelOrSubject ::= ( iri | BlankNode )
directive ::= prefixID | base | sparqlPrefix | sparqlBase
prefixID ::= PREFIX PNAME_NS IRIREF "."?
base ::= BASE IRIREF "."?
sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF
sparqlBase ::= "BASE" IRIREF
triples ::= subject predicateObjectList
| blankNodePropertyList predicateObjectList?
predicateObjectList ::= verb objectList (';' (verb objectList)? )*
objectList ::= object annotation? ( "," object annotation? )*
verb ::= predicate | "a"
subject ::= iri | blank | quotedTriple
predicate ::= iri
object ::= iri | blank | blankNodePropertyList | literal | quotedTriple
literal ::= RDFLiteral | NumericLiteral | BooleanLiteral
blank ::= BlankNode | collection
blankNodePropertyList ::= "[" predicateObjectList "]"
collection ::= "(" object* ")"
NumericLiteral ::= INTEGER | DECIMAL | DOUBLE
RDFLiteral ::= String ( LANG_DIR | ( "^^" iri ) )?
BooleanLiteral ::= "true" | "false"
String ::= STRING_LITERAL_QUOTE
| STRING_LITERAL_SINGLE_QUOTE
| STRING_LITERAL_LONG_SINGLE_QUOTE
| STRING_LITERAL_LONG_QUOTE
iri ::= IRIREF | PrefixedName
PrefixedName ::= PNAME_LN | PNAME_NS
BlankNode ::= BLANK_NODE_LABEL | ANON
quotedTriple ::= "<<" qtSubject predicate qtObject ">>"
qtSubject ::= iri | BlankNode | quotedTriple
qtObject ::= iri | BlankNode | literal | quotedTriple
annotation ::= '{|' predicateObjectList '|}'

@terminals

[1t] GRAPH ::= [Gg][Rr][Aa][Pp][Hh]
[19] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'
[139s] PNAME_NS ::= PN_PREFIX? ":"
[140s] PNAME_LN ::= PNAME_NS PN_LOCAL
[141s] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
[144s] LANGTAG ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )*
[20] INTEGER ::= [+-]? [0-9]+
[21] DECIMAL ::= [+-]? ( ([0-9])* '.' ([0-9])+ )
[22] DOUBLE ::= [+-]? ( [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ EXPONENT )
[154s] EXPONENT ::= [eE] [+-]? [0-9]+
[23] STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"'
[24] STRING_LITERAL_SINGLE_QUOTE ::= "'" ( [^#x27#x5C#xA#xD] | ECHAR | UCHAR )* "'"
[25] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR | UCHAR ) )* "'''"
[26] STRING_LITERAL_LONG_QUOTE ::= '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR | UCHAR ) )* '"""'
[27] UCHAR ::= ( "\u" HEX HEX HEX HEX )
| ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX )
[159s] ECHAR ::= "\" [tbnrf\"']
[160s] NIL ::= "(" WS* ")"
[161s] WS ::= #x20 | #x9 | #xD | #xA
[162s] ANON ::= "[" WS* "]"
[163s] PN_CHARS_BASE ::= [A-Z]
| [a-z]
| [#x00C0-#x00D6]
| [#x00D8-#x00F6]
| [#x00F8-#x02FF]
| [#x0370-#x037D]
| [#x037F-#x1FFF]
| [#x200C-#x200D]
| [#x2070-#x218F]
| [#x2C00-#x2FEF]
| [#x3001-#xD7FF]
| [#xF900-#xFDCF]
| [#xFDF0-#xFFFD]
| [#x10000-#xEFFFF]
[164s] PN_CHARS_U ::= PN_CHARS_BASE
| '_'
[166s] PN_CHARS ::= PN_CHARS_U
| "-"
| [0-9]
| #x00B7
| [#x0300-#x036F]
| [#x203F-#x2040]
[167s] PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )?
[168s] PN_LOCAL ::= ( PN_CHARS_U | ':' | [0-9] | PLX ) ( ( PN_CHARS | '.' | ':' | PLX )* ( PN_CHARS | ':' | PLX ) ) ?
[169s] PLX ::= PERCENT
| PN_LOCAL_ESC
[170s] PERCENT ::= '%' HEX HEX
[171s] HEX ::= [0-9] | [A-F] | [a-f]
[172s] PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )
[28t] PREFIX ::= "@"?[Pp][Rr][Ee][Ff][Ii][Xx]
[29t] BASE ::= "@"?[Bb][Aa][Ss][Ee]
RAPH ::= [Gg][Rr][Aa][Pp][Hh]
RIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'
PNAME_NS ::= PN_PREFIX? ":"
PNAME_LN ::= PNAME_NS PN_LOCAL
BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
LANG_DIR ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* ('--' [a-zA-Z]+)?`
INTEGER ::= [+-]? [0-9]+
DECIMAL ::= [+-]? ( ([0-9])* '.' ([0-9])+ )
DOUBLE ::= [+-]? ( [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ EXPONENT )
EXPONENT ::= [eE] [+-]? [0-9]+
STRING_LITERAL_QUOTE ::= '"' ( [^#x22#x5C#xA#xD] | ECHAR | UCHAR )* '"'
STRING_LITERAL_SINGLE_QUOTE ::= "'" ( [^#x27#x5C#xA#xD] | ECHAR | UCHAR )* "'"
STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR | UCHAR ) )* "'''"
STRING_LITERAL_LONG_QUOTE ::= '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR | UCHAR ) )* '"""'
UCHAR ::= ( "\u" HEX HEX HEX HEX )
| ( "\U" HEX HEX HEX HEX HEX HEX HEX HEX )
ECHAR ::= "\" [tbnrf\"']
NIL ::= "(" WS* ")"
WS ::= #x20 | #x9 | #xD | #xA
ANON ::= "[" WS* "]"
PN_CHARS_BASE ::= [A-Z]
| [a-z]
| [#x00C0-#x00D6]
| [#x00D8-#x00F6]
| [#x00F8-#x02FF]
| [#x0370-#x037D]
| [#x037F-#x1FFF]
| [#x200C-#x200D]
| [#x2070-#x218F]
| [#x2C00-#x2FEF]
| [#x3001-#xD7FF]
| [#xF900-#xFDCF]
| [#xFDF0-#xFFFD]
| [#x10000-#xEFFFF]
PN_CHARS_U ::= PN_CHARS_BASE
| '_'
PN_CHARS ::= PN_CHARS_U
| "-"
| [0-9]
| #x00B7
| [#x0300-#x036F]
| [#x203F-#x2040]
PN_PREFIX ::= PN_CHARS_BASE ( ( PN_CHARS | "." )* PN_CHARS )?
PN_LOCAL ::= ( PN_CHARS_U | ':' | [0-9] | PLX ) ( ( PN_CHARS | '.' | ':' | PLX )* ( PN_CHARS | ':' | PLX ) ) ?
PLX ::= PERCENT
| PN_LOCAL_ESC
PERCENT ::= '%' HEX HEX
HEX ::= [0-9] | [A-F] | [a-f]
PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )
PREFIX ::= "@"?[Pp][Rr][Ee][Ff][Ii][Xx]
BASE ::= "@"?[Bb][Aa][Ss][Ee]
4 changes: 2 additions & 2 deletions lib/rdf/trig.rb
Expand Up @@ -15,8 +15,8 @@ module RDF
# end
# end
#
# @see https://rubydoc.info/github/ruby-rdf/rdf-turtle/
# @see https://rubydoc.info/github/ruby-rdf/rdf/master/
# @see https://ruby-rdf.github.io/rdf-turtle/
# @see https://ruby-rdf.github.io/rdf/master/
# @see https://www.w3.org/TR/trig/
#
# @author [Gregg Kellogg](https://greggkellogg.net/)
Expand Down
5 changes: 4 additions & 1 deletion lib/rdf/trig/format.rb
Expand Up @@ -16,7 +16,10 @@ module RDF::TriG
#
# @see https://www.w3.org/TR/rdf-testcases/#ntriples
class Format < RDF::Format
content_type 'application/trig', extension: :trig, alias: 'application/x-trig;q=0.2'
content_type 'application/trig',
extension: :trig,
uri: 'http://www.w3.org/ns/formats/TriG',
alias: 'application/x-trig;q=0.2'
content_encoding 'utf-8'

reader { RDF::TriG::Reader }
Expand Down
2 changes: 1 addition & 1 deletion lib/rdf/trig/reader.rb
Expand Up @@ -36,7 +36,7 @@ class Reader < RDF::Turtle::Reader
terminal(:GRAPH, /graph/i)
terminal(:PREFIX, PREFIX)
terminal(:BASE, BASE)
terminal(:LANGTAG, LANGTAG)
terminal(:LANG_DIR, LANG_DIR)

##
# Iterates the given block for each RDF statement in the input.
Expand Down

0 comments on commit 8ad1069

Please sign in to comment.