Skip to content

Commit 8929032

Browse files
committed
Add command line documentation to README.
1 parent 9c629ea commit 8929032

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ Full documentation available on [Rubydoc.info][LD-Patch doc]
5353
operator = LD::Patch.parse(patch, base_uri: "http://rubygems.org/gems/ld-patch")
5454
operator.execute(queryable) # alternatively queryable.query(operator)
5555

56+
## Command Line
57+
When the `linkeddata` gem is installed, RDF.rb includes a `rdf` executable which acts as a wrapper to perform a number of different
58+
operations on RDF files, including LD::Patch, which is used as a stream command and must be followed by serialize to see the results. The commands specific to LD::Patch is
59+
60+
* `ld-patch`: Patch the current graph using a patch file
61+
62+
Using this command requires either a `patch-input` where the patch is URI encoded, or `patch-file`, which references a URI or file path to the patch.
63+
Example usage:
64+
65+
rdf patch serialize https://raw.githubusercontent.com/ruby-rdf/ld-patch/develop/etc/doap.ttl \
66+
--patch-input Add%20%7B%20%3Chttp://example.org/s2%3E%20%3Chttp://example.org/p2%3E%20%3Chttp://example.org/o2%3E%20%7D%20. \
67+
--output-format ttl
68+
5669
## Implementation Notes
5770
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.
5871

0 commit comments

Comments
 (0)