shex-check

The command shex-check checks whether a ShEx schema is well-formed: it parses the schema, compiles it, and checks for negative dependency cycles. Unlike shex, it never loads the schema into session state, and unlike shex-validate, it needs no RDF data or ShapeMap — it only checks the schema itself.

Examples

Check a well-formed schema

$ rudof shex-check -s examples/user.shex
Schema is valid: well-formed and contains no negative cycles.

Check a schema with a negative cycle

$ rudof shex-check -s "PREFIX : <http://example.org/> :S { :p @:T } :T { :q NOT @:S }"
Schema contains negative cycles in its dependency graph:

Negative cycle #1:
  Shapes involved:
    - :S
    - :T

  Negative cycle path:
    :S <--[NOT]-- :T <-- :S

shex-check always exits successfully (exit code 0) whether or not the schema is well-formed — the report itself communicates the result, the same way shex-validate's validation report does for data conformance.

Options

OptionDescription
-s, --schema INPUTSchema, file, URI, or - for stdin (required)
-f, --format FORMATSchema format (ShExC, ShExJ, Turtle, ...), default ShExC
-b, --base IRIBase IRI for resolving relative IRIs in the schema