Skip to content

Commit 674388f

Browse files
committed
Improve documentation.
1 parent d3f01ef commit 674388f

5 files changed

Lines changed: 82 additions & 13 deletions

File tree

.yardopts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--title "W3C Linked Data Patch Format for RDF.rb."
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/ld-patch.html
13+
etc/earl.ttl
14+
etc/earl.html

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Gregg Kellogg <gregg@greggkellogg.net>

README.md

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,79 @@
33
This is a [Ruby][] implementation of [LD Patch][] for [RDF.rb][].
44

55
[![Gem Version](https://badge.fury.io/rb/ld-patch.png)](http://badge.fury.io/rb/ld-patch)
6-
76
[![Build Status](https://travis-ci.org/ruby-rdf/ld-patch.png?branch=master)](http://travis-ci.org/ruby-rdf/ld-patch)
8-
97
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/ld-patch/badge.svg)](https://coveralls.io/r/ruby-rdf/ld-patch)
108

9+
## Description
10+
11+
This gem implements the [LD Patch][] specification with a couple of changes and/or limitations:
12+
13+
* The `INDEX` terminal was replaced by `INTEGER`. Having two terminals matching the same token strings causes a conflict. As a result, a _slice_ may contain positive integers, as well as unsigned and negative-integers.
14+
* The _graph_ rule is changed to the following:
15+
16+
[18] graph ::= triples ('.' triples?)*
17+
18+
This is necessary as the specified production is not context-free. As a result, it is possible for a graph to contain multiple trailing "`.`".
19+
20+
[LD Patch][] is useful inside a Rack container where it can respond to `POST` messages to affect the modification of a _target graph_ identified using the URL of the `POST`.
21+
1122
## Features
1223

1324
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
1425
* Complete [Linked Data Patch Format][LD Patch] parsing and execution
1526
* Implementation Report: {file:etc/earl.html EARL}
1627
* Compatible with Ruby >= 2.0.0.
1728

18-
## Description
29+
## Documentation
30+
Full documentation available on [Rubydoc.info][LD-Patch doc]
31+
32+
## Implementation Notes
33+
The reader uses the [EBNF][] gem to generate first, follow and branch tables, and uses the `Parser` and `Lexer` modules to implement the LD Patch parser.
34+
35+
The parser takes branch and follow tables generated from the [LD Patch Grammar](file.ld-patch.html) described in the [specification][LD Patch]. Branch and Follow tables are specified in the generated {LD::Patch::Meta}.
36+
37+
## Dependencies
38+
39+
* [Ruby](http://ruby-lang.org/) (>= 2.0.0)
40+
* [RDF.rb](http://rubygems.org/gems/rdf) (>= 1.1.15)
41+
* [EBNF][] (>= 0.3.0)
42+
* [SPARQL][] (>= 1.1.7)
43+
* [SXP][] (>= 0.1.5)
44+
* [RDF::XSD][] (>= 1.1.4)
45+
46+
## Mailing List
47+
* <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
48+
49+
## Author
50+
* [Gregg Kellogg](http://github.com/gkellogg) - <http://greggkellogg.net/>
51+
52+
## Contributing
53+
This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration.
54+
55+
* Do your best to adhere to the existing coding conventions and idioms.
56+
* Don't use hard tabs, and don't leave trailing whitespace on any line.
57+
* Do document every method you add using [YARD][] annotations. Read the [tutorial][YARD-GS] or just look at the existing code for examples.
58+
* Don't touch the `.gemspec`, `VERSION` or `AUTHORS` files. If you need to change them, do so on your private branch only.
59+
* Do feel free to add yourself to the `CREDITS` file and the corresponding list in the the `README`. Alphabetical order applies.
60+
* 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.
61+
62+
## License
63+
This is free and unencumbered public domain software. For more information,
64+
see <http://unlicense.org/> or the accompanying {file:LICENSE} file.
65+
66+
A copy of the [LD Patch EBNF](file:etc/ld-patch.ebnf) and derived parser files are included in the repository, which are not covered under the UNLICENSE. These files are covered via the [W3C Document License](http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231).
1967

20-
[Ruby]: http://ruby-lang.org/
21-
[RDF]: http://www.w3.org/RDF/
22-
[RDF.rb]: http://rdf.rubyforge.org/
23-
[Linked Data]: http://rubygems.org/gems/linkeddata
24-
[LD Patch]: http://www.w3.org/TR/ldpatch/
25-
[SSE]: http://openjena.org/wiki/SSE
26-
[SXP]: http://sxp.rubyforge.org/
68+
[Ruby]: http://ruby-lang.org/
69+
[RDF]: http://www.w3.org/RDF/
70+
[YARD]: http://yardoc.org/
71+
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
72+
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
73+
[RDF.rb]: http://rubygems.org/gems/rdf
74+
[RDF::XSD]: http://rubygems.org/gems/rdf-xsd
75+
[EBNF]: http://rubygems.org/gems/ebnf
76+
[SPARQL]: http://rubygems.org/gems/sparql
77+
[Linked Data]: http://rubygems.org/gems/linkeddata
78+
[SSE]: http://openjena.org/wiki/SSE
79+
[SXP]: http://rubygems.org/gems/sxp-ruby
80+
[LD Patch]: http://www.w3.org/TR/ldpatch/
81+
[LD-Patch doc]: http://rubydoc.info/github/ruby-rdf/ld-patch

lib/ld/patch/algebra/bind.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Bind < SPARQL::Algebra::Operator::Ternary
6161
# the graph or repository to write
6262
# @param [Hash{Symbol => Object}] options
6363
# any additional options
64-
# @param [RDF::Query::Solutions] bindings
64+
# @option options [RDF::Query::Solutions] :bindings
6565
# @return [RDF::Query::Solutions] A single solution including passed bindings with `var` bound to the solution.
6666
# @raise [Error]
6767
# If path does not evaluate to a single term

lib/ld/patch/parser.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ def to_s
364364
@result.to_sxp
365365
end
366366

367+
alias_method :ll1_parse, :parse
367368
# Parse patch
368369
#
369370
# The result is an S-List. Productions return an array such as the following:
@@ -373,8 +374,6 @@ def to_s
373374
# @param [Symbol, #to_s] prod The starting production for the parser.
374375
# It may be a URI from the grammar, or a symbol representing the local_name portion of the grammar URI.
375376
# @return [Array]
376-
alias_method :ll1_parse, :parse
377-
378377
def parse(prod = START)
379378
ll1_parse(@input, prod.to_sym, @options.merge(branch: BRANCH,
380379
first: FIRST,

0 commit comments

Comments
 (0)