Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Sep 15, 2024
1 parent 6ededd6 commit f67c4dd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# SHACL-test

Runs SHACL shapes against a set of positive and negative test cases (data graphs).

Positive test cases are a simple fail/pass.
Negative test cases are expected to fail and the validation report is compared against the
expectation using [approvals](https://npm.im/approvals).

In case of failures, a [SHACL Playground](https://shacl-playground.zazuko.com)
link is provided for further investigation.

## Usage

```sh
npx shacl-test \
--shapes=${SHAPES} \
--valid-cases="${VALID_CASES_GLOB}" \
--invalid-cases="${INVALID_CASES_GLOB}" \
--approve \
--debug \
--prefixes=${PREFIXES}
```

Only the `--shapes` option is required. The rest are optional.

`--valid-cases` and `--invalid-cases` are globs that match the test cases.
Make sure to put them in quotes to avoid shell expansion.

`--approve` will approve the validation reports for the negative test cases instead of failing.

`--debug` will print the validation report for each test case.

`--prefixes` is a comma-separated list of prefix declarations to be used in the SHACL shapes.
For example, `--prefixes=schema,qudt,cube=https://cube.link/`, will declare the prefixes
`schema`, `qudt` and `cube` with the respective URIs. In the case of `schema` and `qudt`, their
URIs are taken from the list provided by the [`@zazuko/prefixes`](https://github.com/zazuko/rdf-vocabularies/blob/master/packages/prefixes/prefixes.ts) package (and, by extension, the [Zazuko prefix server](https://prefix.zazuko.com)).

0 comments on commit f67c4dd

Please sign in to comment.