Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 52 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# jelly-cli

***Warning: This project is in early development and is not yet ready for production use.***

CLI utility for working with Jelly data.
Fast and convenient CLI utility for working with the [Jelly](https://jelly-rdf.github.io/dev/) protocol for RDF streaming.

## Quick start

Expand All @@ -15,27 +13,76 @@ $ chmod +x jelly-cli
$ ./jelly-cli --help
```

## Usage

### Convert RDF to Jelly

To convert an RDF file (e.g., Turtle) to Jelly, simply run:

```shell
$ ./jelly-cli rdf to-jelly input.ttl > output.jelly
```

### Convert Jelly to RDF

To convert from Jelly to RDF run:

```shell
$ ./jelly-cli rdf from-jelly input.jelly > output.ttl
$ ./jelly-cli rdf from-jelly input.jelly > output.nq
```

By default, `jelly-cli` will translate files to NQuads.
But you can also specify the output format with `--out-format`, for example:

```shell
$ ./jelly-cli rdf from-jelly input.jelly --out-format=ttl > output.ttl
```

You can specify most well-known formats supported by Apache Jena, but also a custom Jelly-Text format.
Jelly-Text is a human-readable translation of Jelly binary. It's not meant for machine consumption. It is useful for debugging and inspecting Jelly files.

### Inspect Jelly files

To inspect a Jelly file and get basic information describing its contents, such as stream options or number of triples in the file, run

```shell
$ ./jelly-cli rdf inspect input.jelly
```

You can also compute the statistics separately for each stream frame with the `--per-frame` option:

```shell
$ ./jelly-cli rdf inspect input.jelly --per-frame
```

In both cases, you will get the output as a valid YAML.

### Validate Jelly files

To validate a Jelly file, run

```shell
$ ./jelly-cli rdf validate input.jelly
```

You can also check whether the Jelly file has been encoded using specific stream options or is equivalent to another RDF file, with the use of additional options to this command.

### General tips

Use the `--help` option to learn more about all the available settings:

```shell
$ ./jelly-cli rdf to-jelly --help
$ ./jelly-cli rdf from-jelly --help
$ ./jelly-cli rdf inspect --help
$ ./jelly-cli rdf validate --help
```

Alternatively, you can use the JAR build, which runs on any platform, as long as you have Java (min. version 17). Go to the **[releases page](https://github.com/Jelly-RDF/cli/releases)** and download the `jelly-cli.jar` file. Then, run it like so:
And use the `--debug` option to get more information about any exceptions you encounter.

## Alternative installation

If for some reason the binaries wouldn't work for you, you can use the JAR build. The build runs on any platform, as long as you have Java (min. version 17). Go to the **[releases page](https://github.com/Jelly-RDF/cli/releases)** and download the `jelly-cli.jar` file. Then, run it like so:

```shell
java -jar jelly-cli.jar --help
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resolvers +=
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots"

lazy val jenaV = "5.3.0"
lazy val jellyV = "2.10.0"
lazy val jellyV = "2.10.1"

addCommandAlias("fixAll", "scalafixAll; scalafmtAll")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ case class RdfInspectOptions(
"Whether to print the statistics per frame (default: false). " +
"If true, the statistics are computed and printed separately for each frame in the stream.",
)
@ExtraName("per-frame") perFrame: Boolean = false,
perFrame: Boolean = false,
) extends HasJellyCommandOptions

object RdfInspect extends JellyCommand[RdfInspectOptions]:
Expand Down