Skip to content

Commit

Permalink
Finish 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 29, 2021
2 parents 8bf96e7 + 48c9444 commit 1750b56
Show file tree
Hide file tree
Showing 47 changed files with 88,552 additions and 351 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
@@ -0,0 +1 @@
repo_token: l9jUsMUkVuNJ3uVs9nBjszn8YhhZbqvZk
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -22,15 +22,16 @@ jobs:
runs-on: ubuntu-latest
env:
CI: true
ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }}
strategy:
fail-fast: false
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
#- ruby-head # Commented out until net-http-persistent is updaated
- 3.0
- 3.1
- ruby-head
- jruby
steps:
- name: Clone repository
Expand All @@ -42,5 +43,9 @@ jobs:
- name: Install dependencies
run: bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rspec spec

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 }}
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions Gemfile
Expand Up @@ -2,28 +2,28 @@ source "https://rubygems.org"

gemspec

gem 'rdf', git: "https://github.com/ruby-rdf/rdf", branch: "develop"
gem 'rdf', git: "https://github.com/ruby-rdf/rdf", branch: "develop"
gem 'sparql', git: "https://github.com/ruby-rdf/sparql", branch: "develop"
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"

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-aggregate-repo', git: "https://github.com/ruby-rdf/rdf-aggregate-repo", branch: "develop"
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", 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-trig', git: "https://github.com/ruby-rdf/rdf-trig", branch: "develop"
gem 'rdf-turtle', git: "https://github.com/ruby-rdf/rdf-turtle", branch: "develop"
gem 'rdf-vocab', git: "https://github.com/ruby-rdf/rdf-vocab", branch: "develop"
gem 'rdf-xsd', git: "https://github.com/ruby-rdf/rdf-xsd", branch: "develop"
gem 'json-ld', git: "https://github.com/ruby-rdf/json-ld", branch: "develop"
gem 'sparql-client', git: "https://github.com/ruby-rdf/sparql-client", branch: "develop"
end

group :development, :test do
gem 'simplecov', '~> 0.16', platforms: :mri
gem 'coveralls', '~> 0.8', '>= 0.8.23', platforms: :mri
gem 'simplecov', '~> 0.21', platforms: :mri
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
end

group :debug do
gem 'awesome_print', github: 'akshaymohite/awesome_print'
gem 'byebug', platform: :mri
end
29 changes: 14 additions & 15 deletions README.md
Expand Up @@ -3,7 +3,7 @@ Notation-3 reader/writer for [RDF.rb][RDF.rb] .

[![Gem Version](https://badge.fury.io/rb/rdf-n3.png)](https://badge.fury.io/rb/rdf-n3)
[![Build Status](https://github.com/ruby-rdf/rdf-n3/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-n3/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-n3/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-n3)
[![Coverage Status](https://coveralls.io/repos/github/ruby-rdf/rdf-n3/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-n3?branch=develop)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)

## Description
Expand All @@ -19,6 +19,7 @@ This version tracks the [W3C N3 Community Group][] [Specification][N3] which has
* The modifier `<-` is introduced as a synonym for `is ... of`.
* The SPARQL `BASE` and `PREFIX` declarations are supported.
* Implicit universal variables are defined at the top-level, rather than in the parent formula of the one in which they are defined.
* Support for explicit existential and universal variables (`@forAll` and `@forSome`) has been removed. Quick variables are the standard for universal quantification and blank nodes for existential, but scoping rules are different: Quickvars have top-level scope, and blank nodes formula scope.

This brings N3 closer to compatibility with Turtle.

Expand All @@ -27,6 +28,8 @@ RDF::N3 parses [Notation-3][N3], [Turtle][] and [N-Triples][] into statements or

Install with `gem install rdf-n3`

[Implementation Report](https://ruby-rdf.github.io/rdf-n3/etc/earl.html)

## Limitations
* Support for Variables in Formulae. Existential variables are quantified to RDF::Node instances, Universals to RDF::Query::Variable, with the URI of the variable target used as the variable name.

Expand Down Expand Up @@ -69,6 +72,7 @@ Reasoning is discussed in the [Design Issues][] document.
* `list:append` (See {RDF::N3::Algebra::List::Append})
* `list:first` (See {RDF::N3::Algebra::List::First})
* `list:in` (See {RDF::N3::Algebra::List::In})
* `list:iterate` (See {RDF::N3::Algebra::List::Iterate})
* `list:last` (See {RDF::N3::Algebra::List::Last})
* `list:length` (See {RDF::N3::Algebra::List::Length})
* `list:member` (See {RDF::N3::Algebra::List::Member})
Expand All @@ -78,9 +82,11 @@ Reasoning is discussed in the [Design Issues][] document.
* `log:conclusion` (See {RDF::N3::Algebra::Log::Conclusion})
* `log:conjunction` (See {RDF::N3::Algebra::Log::Conjunction})
* `log:content` (See {RDF::N3::Algebra::Log::Content})
* `log:dtlit` (See {RDF::N3::Algebra::Log::DtLit})
* `log:equalTo` (See {RDF::N3::Algebra::Log::EqualTo})
* `log:implies` (See {RDF::N3::Algebra::Log::Implies})
* `log:includes` (See {RDF::N3::Algebra::Log::Includes})
* `log:langlit` (See {RDF::N3::Algebra::Log::LangLit})
* `log:n3String` (See {RDF::N3::Algebra::Log::N3String})
* `log:notEqualTo` (See {RDF::N3::Algebra::Log::NotEqualTo})
* `log:notIncludes` (See {RDF::N3::Algebra::Log::NotIncludes})
Expand Down Expand Up @@ -139,7 +145,7 @@ Reasoning is discussed in the [Design Issues][] document.
* `string:scrape` (See {RDF::N3::Algebra::Str::Scrape})
* `string:startsWith` (See {RDF::N3::Algebra::Str::StartsWith})

#### RDF Time vocabulary <>
#### RDF Time vocabulary <http://www.w3.org/2000/10/swap/time#>

* `time:dayOfWeek` (See {RDF::N3::Algebra::Time::DayOfWeek})
* `time:day` (See {RDF::N3::Algebra::Time::Day})
Expand Down Expand Up @@ -173,15 +179,8 @@ when turned into an RDF Repository results in the following quads
Reasoning uses a Notation3 Algebra, similar to [SPARQL S-Expressions][]. This implementation considers formulae to be patterns, which may be asserted on statements made in the default graph, possibly loaded from a separate file. The logical relationships are reduced to algebraic operators.

### Variables
N3 Variables are introduced with `@forAll`, `@forSome`, or `?x`. Variables reference URIs described in formulae, typically defined in the default vocabulary (e.g., `":x"`). Existential variables are replaced with an allocated `RDF::Node` instance. Universal variables are replaced with a `RDF::Query::Variable` instance. For example, the following N3 generates the associated statements:

@forAll <#h>. @forSome <#g>. <#g> <#loves> <#h> .

results in:

h = RDF::Query::Variable.new(<#h>)
g = RDF::Node.new()
RDF::Statement(f, <#loves>, h)
The latest version of N3 supports only quickVars (e.g., `?x`). THe former explicit `@forAll` and `@forSome` of been removed.
Existential variables are replaced with an allocated `RDF::Node` instance.

Note that the behavior of both existential and universal variables is not entirely in keeping with the [Team Submission][], and neither work quite like SPARQL variables. When used in the antecedent part of an implication, universal variables should behave much like SPARQL variables. This area is subject to a fair amount of change.

Expand All @@ -194,11 +193,11 @@ Formulae are typically used to query the knowledge-base, which is set from the b
Blank nodes associated with rdf:List statements used as part of a built-in are made _non-distinguished_ existential variables, and patters containing these variables become optional. If they are not bound as part of the query, the implicitly are bound as the original blank nodes defined within the formula, which allows for both constant list arguments, list arguments that contain variables, or arguments which are variables expanding to lists.

## Dependencies
* [Ruby](https://ruby-lang.org/) (>= 2.4)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1, >= 3.1.4)
* [EBNF][EBNF gem] (~> 2.1)
* [Ruby](https://ruby-lang.org/) (>= 2.6)
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
* [EBNF][EBNF gem] (~> 2.2)
* [SPARQL][SPARQL gem] (~> 3.1)
* [SXP][SXP gem] (~> 1.1)
* [SXP][SXP gem] (~> 1.2)

## Documentation
Full documentation available on [RubyDoc.info](https://rubydoc.info/github/ruby-rdf/rdf-n3)
Expand Down
19 changes: 19 additions & 0 deletions Rakefile
Expand Up @@ -26,3 +26,22 @@ end
file "etc/n3.sxp" => "etc/n3.ebnf" do |t|
%x{ebnf -o #{t.name} #{t.source}}
end

file 'etc/manifests.ttl' do
%x{script/tc --write-manifests -o etc/manifests.ttl}
end

desc "Generate EARL report"
task :earl => 'etc/earl.html'

file 'etc/earl.ttl' => 'etc/doap.ttl' do
%x{script/tc --earl -o etc/earl.ttl}
end

file 'etc/earl.jsonld' => %w(etc/earl.ttl etc/manifests.ttl etc/template.haml) do
%x{(cd etc; earl-report --format json -o earl.jsonld earl.ttl)}
end

file 'etc/earl.html' => 'etc/earl.jsonld' do
%x{(cd etc; earl-report --json --format html --template template.haml -o earl.html earl.jsonld)}
end
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.2
3.2.0
5 changes: 5 additions & 0 deletions etc/.earl
@@ -0,0 +1,5 @@
---
:format: :json
:manifest: manifests.ttl
:bibRef: ! '[[Notation3]]'
:name: Notation3
6 changes: 6 additions & 0 deletions etc/README.md
@@ -0,0 +1,6 @@
# EARL results for SHACL.

../script/tc --write-manifests -o manifests.ttl
../script/tc --earl -o earl.ttl
earl-report --format json -o earl.jsonld earl.ttl
earl-report --json --format html --template template.haml -o earl.html earl.jsonld
11 changes: 10 additions & 1 deletion etc/doap.n3
Expand Up @@ -2,6 +2,7 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix earl: <http://www.w3.org/ns/earl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix ex: <http://example.org/> .
Expand All @@ -11,7 +12,7 @@
doap:name "RDF::N3" ;
doap:homepage <https://github.com/ruby-rdf/rdf-n3> ;
doap:license <https://unlicense.org/1.0/> ;
doap:shortdesc "N3 reader/writer for Ruby."@en ;
doap:shortdesc "N3 reader/writer for Ruby RDF.rb."@en ;
doap:description "RDF::N3 is an Notation-3 reader/writer and reasoner for the RDF.rb library suite."@en ;
doap:created "2010-06-03"^^xsd:date;
doap:programming-language "Ruby" ;
Expand All @@ -28,3 +29,11 @@
doap:documenter <https://greggkellogg.net/foaf#me> ;
foaf:maker <https://greggkellogg.net/foaf#me> ;
dc:creator <https://greggkellogg.net/foaf#me> .

<https://greggkellogg.net/foaf#me> a foaf:Person, earl:Assertor;
foaf:name "Gregg Kellogg";
foaf:title "Implementor";
foaf:homepage <https://greggkellogg.net/> .

<https://rubygems.org/gems/rdf-n3>
doap:release <https://github.com/ruby-rdf/rdf-n3/tree/3.1.2> .
36 changes: 21 additions & 15 deletions etc/doap.nt
@@ -1,21 +1,27 @@
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#blog> <https://greggkellogg.net/> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#bug-database> <https://github.com/ruby-rdf/rdf-n3/issues> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/DesignIssues/Notation3.html> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#programming-language> "Ruby" .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#shortdesc> "N3 reader/writer for Ruby."@en .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#homepage> <https://github.com/ruby-rdf/rdf-n3> .
<https://rubygems.org/gems/rdf-n3> <http://xmlns.com/foaf/0.1/maker> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Resource_Description_Framework> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Ruby_(programming_language)> .
<https://rubygems.org/gems/rdf-n3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#description> "RDF::N3 is an Notation-3 reader/writer and reasoner for the RDF.rb library suite."@en .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#mailing-list> <https://lists.w3.org/Archives/Public/public-rdf-ruby/> .
<https://rubygems.org/gems/rdf-n3> <http://purl.org/dc/terms/creator> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#download-page> <https://rubygems.org/gems/rdf-n3> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#name> "RDF::N3" .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#license> <https://unlicense.org/1.0/> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#helper> <http://njh.me/> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#license> <https://unlicense.org/1.0/> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#programming-language> "Ruby" .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#description> "RDF::N3 is an Notation-3 reader/writer and reasoner for the RDF.rb library suite."@en .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#release> <https://github.com/ruby-rdf/rdf-n3/tree/3.1.2> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#name> "RDF::N3" .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#implements> <http://www.w3.org/DesignIssues/Notation3.html> .
<https://rubygems.org/gems/rdf-n3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#shortdesc> "N3 reader/writer for Ruby RDF.rb."@en .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#created> "2010-06-03"^^<http://www.w3.org/2001/XMLSchema#date> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#bug-database> <https://github.com/ruby-rdf/rdf-n3/issues> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#homepage> <https://github.com/ruby-rdf/rdf-n3> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#documenter> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#developer> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#maintainer> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://xmlns.com/foaf/0.1/maker> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#mailing-list> <https://lists.w3.org/Archives/Public/public-rdf-ruby/> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Ruby_(programming_language)> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#category> <http://dbpedia.org/resource/Resource_Description_Framework> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#developer> <https://greggkellogg.net/foaf#me> .
<https://rubygems.org/gems/rdf-n3> <http://usefulinc.com/ns/doap#blog> <https://greggkellogg.net/> .
<https://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/name> "Gregg Kellogg" .
<https://greggkellogg.net/foaf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<https://greggkellogg.net/foaf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/earl#Assertor> .
<https://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/title> "Implementor" .
<https://greggkellogg.net/foaf#me> <http://xmlns.com/foaf/0.1/homepage> <https://greggkellogg.net/> .

0 comments on commit 1750b56

Please sign in to comment.