Skip to content

Commit

Permalink
Split out "request" extension and jsonld tool.
Browse files Browse the repository at this point in the history
- Move "request" extension to jsonld-request module.
- Move jsonld tool to jsonld-cli module.
- Update to use() call to require jsonld-request module.
- Add CHANGELOG.
- Update dependencies and README.
  • Loading branch information
davidlehn committed Sep 13, 2015
1 parent 1531b50 commit f4159f2
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2,326 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# jsonld ChangeLog

## [Unreleased]

### Breaking Changes
- "request" extension moved to [jsonld-request][]. This was done to simplify
the core JSON-LD processing library. In particular, the extension pulled in
RDFa processing code and related dependencies. The old method of using this
exension of `jsonld.use('request')` is deprecated in favor of using the new
module directly.
- The `jsonld` tool moved to [jsonld-cli][]. This was also done to simplify the
core JSON-LD processing library and because it uses the [jsonld-request][]
module.

## [0.3.26] - 2015-09-01

## Before 0.3.26

- See git history for changes.

[jsonld-cli]: https://github.com/digitalbazaar/jsonld-cli
[jsonld-request]: https://github.com/digitalbazaar/jsonld-request

[Unreleased]: https://github.com/digitalbazaar/jsonld/compare/0.3.26...HEAD
[0.3.26]: https://github.com/digitalbazaar/jsonld/compare/0.3.25...0.3.26
39 changes: 8 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,39 +238,14 @@ jsonld.compact(doc, context, {documentLoader: customLoader},
function(err, compacted) { ... });
```

Using the Command-line Tool
---------------------------

The jsonld command line tool can be used to:
Related Modules
---------------

* Transform JSON-LD to compact, expanded, normalized, or flattened form
* Transform RDFa to JSON-LD
* Normalize JSON-LD/RDFa Datasets to NQuads

To install the tool, do the following (you will need git, nodejs, and
npm installed):

git clone https://github.com/digitalbazaar/jsonld.js.git
cd jsonld.js
npm install

To compact a document on the Web using a JSON-LD context published on
the Web:

./bin/jsonld compact -c "https://w3id.org/payswarm/v1" "http://recipes.payswarm.com/?p=10554"

The command above will read in a PaySwarm Asset and Listing in RDFa 1.0 format,
convert it to JSON-LD expanded form, compact it using the
'https://w3id.org/payswarm/v1' context, and dump it out to the console in
compacted form.

./bin/jsonld normalize -q "http://recipes.payswarm.com/?p=10554"

The command above will read in a PaySwarm Asset and Listing in RDFa 1.0 format,
normalize the data using the RDF Dataset normalization algorithm, and
then dump the output to normalized NQuads format. The NQuads can then be
processed via SHA-256, or similar algorithm, to get a deterministic hash
of the contents of the Dataset.
* [jsonld-cli][]: A command line interface tool called `jsonld` that exposes
most of the basic jsonld.js API.
* [jsonld-request][]: A module that can read data from stdin, URLs, and files
and in various formats and return JSON-LD.

Commercial Support
------------------
Expand Down Expand Up @@ -341,3 +316,5 @@ To generate earl reports:
[RDFa]: http://www.w3.org/TR/rdfa-core/
[RFC7159]: http://tools.ietf.org/html/rfc7159
[json-ld.org]: https://github.com/json-ld/json-ld.org
[jsonld-cli]: https://github.com/digitalbazaar/jsonld-cli
[jsonld-request]: https://github.com/digitalbazaar/jsonld-request
Loading

1 comment on commit f4159f2

@dlongley
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses #110 and #98.

Please sign in to comment.