Skip to content

Commit f7d3d7c

Browse files
committed
Release 0.1.0
2 parents 3dba551 + ec6f4ce commit f7d3d7c

File tree

357 files changed

+14031
-6590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+14031
-6590
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Gemfile.lock
1212
benchmark/
1313
/.byebug_history
1414
/coverage/
15+
/doc/

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
language: ruby
22
bundler_args: --without debug
33
script: "bundle exec rspec spec"
4+
# Handle git submodules yourself
5+
git:
6+
submodules: false
7+
# Use sed to replace the SSH URL with the public URL, then initialize submodules
8+
before_install:
9+
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
10+
- git submodule update --init --recursive
411
env:
512
- CI=true
613
rvm:
7-
- 2.2.5
8-
- 2.3.1
14+
- 2.2.6
15+
- 2.3.3
916
- jruby
1017
- rbx
1118
cache: bundler

.yardopts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--title "ShEx: Shape Expression language for Ruby"
2+
--output-dir doc/yard
3+
--protected
4+
--no-private
5+
--hide-void-return
6+
--markup markdown
7+
--readme README.md
8+
-
9+
AUTHORS
10+
VERSION
11+
LICENSE
12+
etc/shex.html
13+
etc/earl.ttl
14+
etc/earl.html

Gemfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ source "https://rubygems.org"
22

33
gemspec
44

5-
gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"
5+
gem 'rdf', github: "ruby-rdf/rdf", branch: "develop"
66

77
group :development, :test do
8-
gem 'ebnf', github: "gkellogg/ebnf", branch: "develop"
9-
gem 'linkeddata', github: "ruby-rdf/linkeddata", branch: "develop"
10-
gem 'rdf-isomorphic', github: "ruby-rdf/rdf-isomorphic", branch: "develop"
11-
gem 'rdf-turtle', github: "ruby-rdf/rdf-turtle", branch: "develop"
12-
gem 'rdf-xsd', github: "ruby-rdf/rdf-xsd", branch: "develop"
13-
gem 'sxp', github: "dryruby/sxp.rb", branch: "develop"
8+
gem 'ebnf', github: "gkellogg/ebnf", branch: "develop"
9+
gem 'linkeddata', github: "ruby-rdf/linkeddata", branch: "develop"
10+
gem 'sxp', github: "dryruby/sxp.rb", branch: "develop"
11+
gem 'simplecov', require: false
12+
gem 'coveralls', require: false
1413
end
1514

1615
group :debug do

README.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ShEx: Shape Expression language for Ruby
22

3-
This is a pure-Ruby library for working with the [Shape Expressions Language][ShEx] to validate the shape of [RDF][] graphs.
3+
This is a pure-Ruby library for working with the [Shape Expressions Language][ShExSpec] to validate the shape of [RDF][] graphs.
44

5-
* <http://ruby-rdf.github.com/shex>
5+
<http://ruby-rdf.github.com/shex>
66

77
[![Gem Version](https://badge.fury.io/rb/shex.png)](http://badge.fury.io/rb/shex)
88
[![Build Status](https://travis-ci.org/ruby-rdf/shex.png?branch=master)](http://travis-ci.org/ruby-rdf/shex)
@@ -12,14 +12,51 @@ This is a pure-Ruby library for working with the [Shape Expressions Language][Sh
1212
## Features
1313

1414
* 100% pure Ruby with minimal dependencies and no bloat.
15-
* Fully compatible with [RDF 1.1][] specifications.
15+
* Fully compatible with [ShEx][ShExSpec] specifications.
1616
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
1717

18+
## Description
19+
20+
The ShEx gem implements a [ShEx][ShExSpec] Shape Expression engine.
21+
22+
* `ShEx::Parser` parses ShExC formatted documents generating executable operators which can be serialized as [S-Expressions](http://en.wikipedia.org/wiki/S-expression).
23+
* `ShEx::Algebra` executes operators against Any `RDF::Graph`, including compliant [RDF.rb][].
24+
25+
## Example
26+
27+
require 'rubygems'
28+
require 'rdf/turtle'
29+
require 'shex'
30+
31+
shexc: %(
32+
PREFIX doap: <http://usefulinc.com/ns/doap#>
33+
PREFIX dc: <http://purl.org/dc/terms/>
34+
<TestShape> EXTRA a {
35+
a doap:Project;
36+
(doap:name;doap:description|dc:title;dc:description)+;
37+
doap:category*;
38+
doap:developer IRI;
39+
doap:implements [<https://shexspec.github.io/spec/>]
40+
}
41+
)
42+
graph = RDF::Graph.load("etc/doap.ttl")
43+
schema = ShEx.parse(shexc)
44+
map = {
45+
"http://rubygems.org/gems/shex" => "TestShape"
46+
}
47+
schema.satisfies?("http://rubygems.org/gems/shex", graph, map)
48+
# => true
49+
1850
## Documentation
1951

2052
<http://rubydoc.info/github/ruby-rdf/shex>
2153

2254

55+
## Implementation Notes
56+
The ShExC parser uses the [EBNF][] gem to generate first, follow and branch tables, and uses the `Parser` and `Lexer` modules to implement the ShExC parser.
57+
58+
The parser takes branch and follow tables generated from the [ShEx Grammar](file.shex.html) described in the [specification][ShExSpec]. Branch and Follow tables are specified in the generated {ShEx::Meta}.
59+
2360
## Dependencies
2461

2562
* [Ruby](http://ruby-lang.org/) (>= 2.0)
@@ -30,7 +67,7 @@ This is a pure-Ruby library for working with the [Shape Expressions Language][Sh
3067
The recommended installation method is via [RubyGems](http://rubygems.org/).
3168
To install the latest official release of RDF.rb, do:
3269

33-
% [sudo] gem install shex # Ruby 2+
70+
% [sudo] gem install shex
3471

3572
## Download
3673

@@ -81,5 +118,7 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
81118
This is free and unencumbered public domain software. For more information,
82119
see <http://unlicense.org/> or the accompanying {file:LICENSE} file.
83120

84-
[ShEx]: https://shexspec.github.io/spec/
85-
[RDF]: http://www.w3.org/RDF/
121+
[ShExSpec]: https://shexspec.github.io/spec/
122+
[RDF]: http://www.w3.org/RDF/
123+
[RDF.rb]: http://rubydoc.info/github/ruby-rdf/rdf
124+
[EBNF]: http://rubygems.org/gems/ebnf

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1
1+
0.1.0

etc/doap.shex

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
PREFIX doap: <http://usefulinc.com/ns/doap#>
2+
PREFIX dc: <http://purl.org/dc/terms/>
3+
<TestShape> EXTRA a {
4+
a [doap:Project];
5+
6+
# May have either or both of doap:name/doap:description or dc:title/dc:description
7+
( doap:name Literal;
8+
doap:description Literal
9+
| dc:title Literal;
10+
dc:description Literal)+;
11+
12+
# Good idea to use a category for what the project relates to
13+
doap:category IRI*;
14+
15+
# There must be at least one developer
16+
doap:developer IRI+;
17+
18+
# For our purposes, it MUST implement the ShEx specification.
19+
doap:implements [<https://shexspec.github.io/spec/>]
20+
}

etc/doap.ttl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
@prefix ex: <http://example.org/> .
88
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
99

10-
<http://rubygems.org/gems/rdf-turtle> a doap:Project, earl:TestSubject, earl:Software ;
11-
doap:name "RDF::Turtle" ;
12-
doap:homepage <http://ruby-rdf.github.com/rdf-turtle> ;
10+
<http://rubygems.org/gems/shex> a doap:Project, earl:TestSubject, earl:Software ;
11+
doap:name "ShEx" ;
12+
doap:homepage <http://ruby-rdf.github.com/shex> ;
1313
doap:license <http://creativecommons.org/licenses/publicdomain/> ;
14-
doap:shortdesc "Turtle reader/writer for Ruby."@en ;
15-
doap:description "RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."@en ;
16-
doap:created "2011-08-29"^^xsd:date ;
14+
doap:shortdesc "ShEx is a Shape Expression engine for Ruby."@en ;
15+
doap:description "ShEx is an Shape Expression engine for the RDF.rb library suite."@en ;
16+
doap:created "2016-12-09"^^xsd:date ;
1717
doap:programming-language "Ruby" ;
18-
doap:implements <http://www.w3.org/TR/turtle/> ;
18+
doap:implements <https://shexspec.github.io/spec/> ;
1919
doap:category <http://dbpedia.org/resource/Resource_Description_Framework>,
2020
<http://dbpedia.org/resource/Ruby_(programming_language)> ;
21-
doap:download-page <http://rubygems.org/gems/rdf-turtle> ;
21+
doap:download-page <http://rubygems.org/gems/shex> ;
2222
doap:mailing-list <http://lists.w3.org/Archives/Public/public-rdf-ruby/> ;
23-
doap:bug-database <http://github.com/ruby-rdf/rdf-turtle/issues> ;
23+
doap:bug-database <http://github.com/ruby-rdf/shex/issues> ;
2424
doap:blog <http://greggkellogg.net/> ;
2525
doap:developer <http://greggkellogg.net/foaf#me> ;
2626
doap:maintainer <http://greggkellogg.net/foaf#me> ;
2727
doap:documenter <http://greggkellogg.net/foaf#me> ;
2828
foaf:maker <http://greggkellogg.net/foaf#me> ;
29-
dc:title "RDF::Turtle" ;
30-
dc:description "RDF::Turtle is an Turtle reader/writer for the RDF.rb library suite."@en ;
31-
dc:date "2011-08-29"^^xsd:date ;
29+
dc:title "ShEx" ;
30+
dc:description "ShEx is an Shape Expression engine for the RDF.rb library suite."@en ;
31+
dc:date "2016-12-09"^^xsd:date ;
3232
dc:creator <http://greggkellogg.net/foaf#me> ;
3333
dc:isPartOf <http://rubygems.org/gems/rdf> .

0 commit comments

Comments
 (0)