ShEx (Shape Expressions) is a language to describe RDF graph structures. It can be used for validation, traversal and transformation of RDF graphs.
The Shape Expressions (ShEx) language describes RDF nodes and graph structures. A node constraint describes an RDF node (IRI, blank node or literal) and a shape describes the triples involving nodes in an RDF graph. These descriptions identify predicates and their associated cardinalities and datatypes. ShEx shapes can be used to communicate data structures associated with some process or interface, generate or validate data, or drive user interfaces.
Syntaxes
ShEx has an abstract syntax which can be expressed in a
- Compact syntax (ShExC) - terse, human-readable representation of RDF schemas,
- JSON-LD syntax (ShExJ) - a JSON representation with an
@context
, - RDF syntaxes (ShExR) - any equivalent to the JSON-LD interpretation of ShExJ.
Documentation
- ShEx specification - defines the syntax of a ShEx schema and the semantics of testing RDF data against that schema.
- ShapeMap specification - defines the selection of node/shape pairs for validation.
- Primer - an introduction to ShEx