Code Monkey home page Code Monkey logo

ld-cli's Introduction

Linked Data CLI

A simple command line utility allowing to process JSON-LD, RDF, and CBOR-LD, documents. The goal is to provide native executables compiled for Ubuntu, Mac and Windows.

Features

Installation

Downloads

> unzip ld-cli-....zip
> chmod +x ld-cli

Usage

> ld-cli -h
Usage: ld-cli [-hv] [COMMAND]

Linked Data Command Line Processor

Options:
  -h, --help      display help message
  -v, --version   display a version

Commands:
  expand      Expand JSON-LD document
  compact     Compact JSON-LD document using the context
  flatten     Flatten JSON-LD document and optionally compact using a context
  frame       Frame JSON-LD document using the frame
  fromrdf     Transform N-Quads document into a JSON-LD document in an expanded form
  tordf       Transform JSON-LD document into N-Quads document
  compress    Compress JSON-LD document into CBOR-LD  
  decompress  Decompress CBOR-LD document into JSON-LD
  
> ld-cli expand -h
Usage: ld-cli expand [-op] [-b=<base>] [-c=<context>] [-i=<input>] [-m=1.0|1.1]

Expand JSON-LD document

Options:
  -b, --base=<base>         input document base IRI
  -c, --context=<context>   context IRI
  -i, --input=<input>       input document IRI
  -m, --mode=1.0|1.1        processing mode
  -o, --ordered             certain algorithm processing steps are ordered
                              lexicographically
  -p, --pretty              pretty print output JSON

Pipeline

> cat document.json | ld-cli expand --ordered --pretty > expanded.jsonld

file:/ scheme support

> ld-cli compress -i file:/home/filip/example.jsonld output.cborld

Contributing

All PR's welcome!

Building

  1. Install GraalVM and Native Image
    • download and unpack graalvm-ce-java17-[platform]-[version].tar.gz
    • set JAVA_HOME and PATH env variables
    • gu install native-image
  2. mvn clean package -P native-image
  3. ./target/ld-cli

Resources

Sponsors

Commercial Support

Commercial support is available at [email protected]

ld-cli's People

Contributors

dependabot[bot] avatar filip26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cybernetics

ld-cli's Issues

Enable Windows Build

Enable Windows build by adding windows-latest into build matrix ( .github/workflows/executables.yml). Resolve missing cl.exe command issue.

flatten with --context does not seem to be working (?)

This works:

ld-cli flatten --mode=1.1 --input=file:"$PWD"/test/picasso.json

with this picasso.json, which has (x2) @context loading this picasso-context.jsonld.

When I remove (x2) the @context, as I will in https://github.com/enola-dev/enola/pull/796/files (WIP), then this doesn't work, there is no failure, but content is missing:

ld-cli flatten --mode=1.1 --context=file:"$PWD"/test/picasso-context.jsonld --input=file:"$PWD"/test/picasso.json

PS, just FYI: I had used ld-cli for exploring and learning JSON-LD (Thank You for creating it!), and am now moving on to directly using https://github.com/filip26/titanium-json-ld (actually its https://github.com/HASMAC-AS/hasmac-json-ld fork, via https://github.com/eclipse-rdf4j/rdf4j) and it works there. So I don't really need a fix, but just wanted to let you know about this, in case you wanted to look into it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.