Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpluscode/shacl-cli
https://github.com/tpluscode/shacl-cli
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tpluscode/shacl-cli
- Owner: tpluscode
- License: mit
- Created: 2022-10-02T11:54:29.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T23:24:52.000Z (over 1 year ago)
- Last Synced: 2024-11-18T09:44:24.625Z (about 1 month ago)
- Language: JavaScript
- Size: 413 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# shacl-cli [![npm version](https://badge.fury.io/js/@tpluscode%2Fshacl-cli.svg)](https://badge.fury.io/js/@tpluscode%2Fshacl-cli)
Validate RDF using SHACL from the command line. Uses RDF/JS tooling
## Why?
* [x] Loads shapes and data graph from any RDF format known to [@rdfjs/formats-common](https://npm.im/@rdfjs/formats-common).
* [x] Requires only node. No JVM, no Python, etc
* [x] Easily load shapes and data from multiple sources using globs## Installation
```
npm install @tpluscode/shacl-cli
```## Usage
```
Usage: shacl-cli validate [options]Options:
--shapes Sources of the Shapes Graph
--data Source of the Data Graph
--prefixes Prefixes of common vocabularies known to the @zazuko/rdf-vocabularies package or custom prefixes as prefix=namespace
-h, --help display help for command
```### Shapes and data as globs
Validates multiple data files using multiple shape sources
```
shacl-cli validate \
--shapes example/shape/*.ttl \
--data example/person/*.ttl
```### Select individual files
Both `--shapes` and `--data` allow multiple values and can be used multiple times
```
shacl-cli validate \
--shapes example/shape/Person.ttl example/shape/Occupation.ttl \
--data example/person/John.ttl \
--data example/person/Frank.ttl
```### Output prefixes
The output is a nicely formatted turtle. Add `--prefixes` to shorten URIs.
```
shacl-cli validate \
--shapes example/shape/*.ttl \
--data example/person/*.ttl \
--prefixes schema person=http://example.org/person/
```### Other formats are supported
```
shacl-cli validate \
--shapes example/shape/*.ttl \
--data example/person/multiple.trig
```