Skip to content

Commit

Permalink
Finish 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Apr 10, 2021
2 parents ece596a + d3474c8 commit 497731c
Show file tree
Hide file tree
Showing 27 changed files with 1,180 additions and 272 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: jbAeDjB6ZRytcnGAw1TRPcEjzGiUq0zNx
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.

name: CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
tests:
name: Ruby ${{ matrix.ruby }}
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
runs-on: ubuntu-latest
env:
CI: true
strategy:
fail-fast: false
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head
#- jruby
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: bundle exec rspec spec

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Gemfile.lock
/doc/
/pkg/
/.byebug_history
coverage
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Arto Bendiken <arto@bendiken.net>
* Gregg Kellogg <gregg@greggkellogg.net>
14 changes: 8 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Community contributions are essential for keeping Ruby RDF great. We want to kee

This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.

* create or respond to an issue on the [Github Repository](http://github.com/ruby-rdf/rdf-trix/issues)
* create or respond to an issue on the [Github Repository](https://github.com/ruby-rdf/rdf-trix/issues)
* Fork and clone the repo:
`git clone git@github.com:your-username/rdf-trix.git`
* Install bundle:
Expand All @@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
enough, be assured we will eventually add you in there.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
explicit [public domain dedication][PDD] on record from you.
explicit [public domain dedication][PDD] on record from you,
which you will be asked to agree to on the first commit to a repo within the organization.
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.

[YARD]: http://yardoc.org/
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
[pr]: https://github.com/ruby-rdf/rdf-trix/compare/
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
[PDD]: https://unlicense.org/#unlicensing-contributions
[pr]: https://github.com/ruby-rdf/rdf/compare/
18 changes: 12 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ gem 'rdf', git: "https://github.com/ruby-rdf/rdf", branch: "develop"
gem "nokogiri"

group :development do
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
gem 'json-ld', git: "https://github.com/ruby-rdf/json-ld", branch: "develop"
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
gem 'rdf-turtle', git: "https://github.com/ruby-rdf/rdf-turtle", branch: "develop"
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
gem 'json-ld', git: "https://github.com/ruby-rdf/json-ld", branch: "develop"
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
gem 'rdf-turtle', git: "https://github.com/ruby-rdf/rdf-turtle", branch: "develop"
gem 'rdf-ordered-repo', git: "https://github.com/ruby-rdf/rdf-ordered-repo", branch: "develop"
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
gem "syntax"
gem "byebug", platform: :mri
end

group :test do
gem 'simplecov', platforms: :mri
gem 'coveralls', '~> 0.8', platforms: :mri
end
149 changes: 116 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,121 @@
TriX Support for RDF.rb
=======================
# TriX Support for RDF.rb

This is an [RDF.rb][] extension that adds support for parsing/serializing
[TriX][], an XML-based RDF serialization format developed by HP Labs and
Nokia.
[TriX][] reader/writer for [RDF.rb][RDF.rb] .

* <http://github.com/ruby-rdf/rdf-trix>
* <http://blog.datagraph.org/2010/04/parsing-rdf-with-ruby>
[![Gem Version](https://badge.fury.io/rb/rdf-trix.png)](https://badge.fury.io/rb/rdf-trix)
[![Build Status](https://github.com/ruby-rdf/rdf-trix/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-trix/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-trix/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-trix?branch=develop)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)

[![Gem Version](https://badge.fury.io/rb/rdf-trix.png)](http://badge.fury.io/rb/rdf-trix)
[![Build Status](https://travis-ci.org/ruby-rdf/rdf-trix.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-trix)
## Description
This is a [Ruby][] implementation of a [TriX][] reader and writer for [RDF.rb][]. TriX is an XML-based RDF serialization format developed by HP Labs and Nokia.

Documentation
-------------
## Features
RDF::TriX parses [TriX][] into statements or quads. It also serializes to TriX.

Install with `gem install rdf-trix`

* 100% free and unencumbered [public domain](https://unlicense.org/) software.
* Implements a complete parser and serializer for [TriX][].
* Compatible with Ruby >= 2.4, and JRuby 1.7+.

### Support for xml:base

The TriX reader natively supports `xml:base` in the top-level element without the need for an XSLT. This allows values of a `uri` element to be relative URIs and resolved against that base. The base can also be specified as an option to the reader.

For example:

<TriX xmlns="http://www.w3.org/2004/03/trix/trix-1/"
xml:base="http://example.org/">
<graph>
<uri>graph1</uri>
<triple>
<uri>Bob</uri>
<uri>wife</uri>
<uri>Mary</uri>
</triple>
<triple>
<uri>Bob</uri>
<uri>name</uri>
<plainLiteral>Bob</plainLiteral>
</triple>
<triple>
<uri>Mary</uri>
<uri>age</uri>
<typedLiteral datatype="http://www.w3.org/2001/XMLSchema#integer">32</typedLiteral>
</triple>
</graph>
</TriX>

### RDF-star

Both reader and writer include provisional support for [RDF-star][].

Internally, an `RDF::Statement` is treated as another resource, along with `RDF::URI` and `RDF::Node`, which allows an `RDF::Statement` to have a `#subject` or `#object` which is also an `RDF::Statement`.

RDF-star is supported by allowing a `triple` element to contain another `triple` as either or both the _subject_ or _object_.

Note that this requires the `rdfstar` option to be se.

**Note: This feature is subject to change or elimination as the standards process progresses.**

For example:

<TriX xmlns="http://www.w3.org/2004/03/trix/trix-1/">
<graph>
<triple>
<triple>
<uri>http://example/s1</uri>
<uri>http://example/p1</uri>
<uri>http://example/o1</uri>
</triple>
<uri>http://example/p</uri>
<uri>http://example/o</uri>
</triple>
</graph>
</TriX>

## Usage
Instantiate a reader from a local file:

repo = RDF::Repository.load("etc/doap.trix", :format => :trix)

Define `@base` and `@prefix` definitions, and use for serialization using `:base_uri` an `:prefixes` options.

Canonicalize and validate using `:canonicalize` and `:validate` options.

Write a repository to a file:

RDF::TriX::Writer.open("etc/test.trix") do |writer|
writer << repo
end

## Dependencies
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
* Soft dependency on [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)
* Soft dependency on [Libxml-Ruby](https://rubygems.org/gems/libxml-ruby) (>= 3.0)

## Documentation

* {RDF::TriX}
* {RDF::TriX::Format}
* {RDF::TriX::Reader}
* {RDF::TriX::Writer}

Dependencies
------------
## Dependencies

* [RDF.rb](http://rubygems.org/gems/rdf) (~> 3.1)
[Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.10.0)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
[Nokogiri](https://rubygems.org/gems/nokogiri) (~> 1.10)
[LibXML](https://rubygems.org/gems/libxml) (>= 3.0)

Installation
------------
## Installation

The recommended installation method is via [RubyGems](http://rubygems.org/).
The recommended installation method is via [RubyGems](https://rubygems.org/).
To install the latest official release of the `RDF::TriX` gem, do:

% [sudo] gem install rdf-trix

Download
--------
## Download

To get a local working copy of the development repository, do:

Expand All @@ -43,20 +124,18 @@ To get a local working copy of the development repository, do:
Alternatively, download the latest development version as a tarball as
follows:

% wget http://github.com/ruby-rdf/rdf-trix/tarball/master
% wget https://github.com/ruby-rdf/rdf-trix/tarball/master

Mailing List
------------
## Mailing List

* <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
* <https://lists.w3.org/Archives/Public/public-rdf-ruby/>

Author
------
## Authors

* [Arto Bendiken](http://github.com/bendiken) - <http://ar.to/>
* [Arto Bendiken](https://github.com/artob) - <https://ar.to/>
* [Gregg Kellogg](https://github.com/gkellogg) - <https://greggkellogg.net/>

Contributors
------------
# Contributors

Refer to the accompanying {file:CREDITS} file.

Expand All @@ -77,12 +156,16 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
enough, be assured we will eventually add you in there.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
explicit [public domain dedication][PDD] on record from you.
explicit [public domain dedication][PDD] on record from you,
which you will be asked to agree to on the first commit to a repo within the organization.
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.

## License

This is free and unencumbered public domain software. For more information,
see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.

[RDF.rb]: http://rdf.rubyforge.org/
[TriX]: http://www.w3.org/2004/03/trix/
[RDF.rb]: https://rubygems.org/gems/rdf/
[TriX]: https://www.hpl.hp.com/techreports/2004/HPL-2004-56.html
[PDD]: https://unlicense.org/#unlicensing-contributions
[RDF-star]: https://w3c.github.io/rdf-star/rdf-star-cg-spec.html
23 changes: 16 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env ruby
require "bundler/setup"
require 'rdf/trix'
require 'rdf/turtle'
require 'rdf/ntriples'

namespace :gem do
desc "Build the rdf-trix-#{File.read('VERSION').chomp}.gem file"
Expand All @@ -12,16 +16,21 @@ namespace :gem do
end
end

desc "Generate etc/doap.xml from etc/doap.ttl."
task :doap do
$:.unshift(File.expand_path("../lib", __FILE__))
require "bundler/setup"
require 'rubygems'
require 'rdf/turtle'
require 'rdf/trix'
desc "Generate etc/doap.nt from etc/doap.ttl."
task :doap => %w(etc/doap.xml etc/doap.nt)

file "etc/doap.xml" => "etc/doap.ttl" do
RDF::TriX::Writer.open("etc/doap.xml") do |writer|
RDF::Turtle::Reader.open("etc/doap.ttl") do |reader|
reader.each_statement { |statement| writer << statement }
end
end
end

file "etc/doap.nt" => "etc/doap.ttl" do
RDF::NTriples::Writer.open("etc/doap.nt") do |writer|
RDF::Turtle::Reader.open("etc/doap.ttl") do |reader|
reader.each_statement { |statement| writer << statement }
end
end
end
2 changes: 1 addition & 1 deletion UNLICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
For more information, please refer to <https://unlicense.org/>
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.1.1
43 changes: 21 additions & 22 deletions etc/doap.nt
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<http://ar.to/#self> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<http://ar.to/#self> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bendiken/foaf> .
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <http://rubygems.org/gems/rdf-trix> .
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox> <mailto:arto@bendiken.net> .
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/name> "Arto Bendiken" .
<http://rubygems.org/gems/rdf-trix> <http://purl.org/dc/terms/creator> <http://ar.to/#self> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#blog> <http://ar.to/> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#blog> <http://blog.datagraph.org/> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#bug-database> <http://github.com/ruby-rdf/rdf-trix/issues> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#created> "2010-02-02" .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#description> "RDF.rb extension for parsing/serializing TriX data."@en .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#developer> <http://ar.to/#self> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#documenter> <http://ar.to/#self> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#download-page> <http://rubygems.org/gems/rdf-trix/> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#homepage> <http://rdf.rubyforge.org/trix/> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#license> <http://creativecommons.org/licenses/publicdomain/> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#maintainer> <http://ar.to/#self> .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#name> "RDF::TriX" .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#platform> "Ruby" .
<http://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#shortdesc> "TriX support for RDF.rb."@en .
<http://rubygems.org/gems/rdf-trix> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
<http://rubygems.org/gems/rdf-trix> <http://xmlns.com/foaf/0.1/maker> <http://ar.to/#self> .
<https://rubygems.org/gems/rdf-trix> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#name> "RDF::TriX" .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#homepage> <https://github.com/ruby-rdf/rdf-trix/> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#license> <https://unlicense.org/1.0/> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#shortdesc> "TriX support for RDF.rb."@en .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#description> "RDF::TriX is an TriX reader/writer for the RDF.rb library suite."@en .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#created> "2010-02-02" .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#programming-language> "Ruby" .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#download-page> <https://rubygems.org/gems/rdf-trix> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#bug-database> <https://github.com/ruby-rdf/rdf-trix/issues> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#blog> <https://greggkellogg.net/> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#developer> <https://ar.to/#self> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#developer> <https://greggkellogg.net/> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#maintainer> <https://greggkellogg.net/> .
<https://rubygems.org/gems/rdf-trix> <http://usefulinc.com/ns/doap#documenter> <https://ar.to/#self> .
<https://rubygems.org/gems/rdf-trix> <http://xmlns.com/foaf/0.1/maker> <https://ar.to/#self> .
<https://rubygems.org/gems/rdf-trix> <http://purl.org/dc/terms/creator> <https://ar.to/#self> .
<https://ar.to/#self> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<https://ar.to/#self> <http://xmlns.com/foaf/0.1/name> "Arto Bendiken" .
<https://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox> <mailto:arto@bendiken.net> .
<https://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <https://rubygems.org/gems/rdf-trix> .
Loading

0 comments on commit 497731c

Please sign in to comment.