ShEx explained

ShEx - Shape Expressions
Paradigm:Data Validation
Year Started:2013
Designer:Eric Prud'hommeaux, Iovka Boneva, Jose Emilio Labra Gayo, Gregg Kellogg, Shape Expressions W3C Community Group
Programming Language:JavaScript, Scala
Latest Release Version:2.1
File Ext:shex, sx
Scope:Semantic Web
Abbreviation:ShEx
Implementations:shex.js,[1] Shaclex
Influenced:SHACL

Shape Expressions (ShEx) [2] is a data modelling language for validating and describing a Resource Description Framework (RDF).

It was proposed at the 2012 RDF Validation Workshop[3] as a high-level, concise language for RDF validation.

The shapes can be defined in a human-friendly compact syntax called ShExC or using any RDF serialization formats like JSON-LD or Turtle.

ShEx expressions can be used both to describe RDF and to automatically check the conformance of RDF data. The syntax of ShEx is similar to Turtle and SPARQL while the semantics is inspired by regular expression languages like RelaxNG.

Example

PREFIX : PREFIX schema: PREFIX xsd:

Person

The previous example declares that nodes conforming to shape Person must have one property schema:name with a string value and zero or more properties schema:knows whose values must conform with shape Person.

Implementations

Project! rowspan="2"
Programming languageVersionLatest releaseCompatible ShEx versionFeatures
value checkingcardinalitymanifest shapemapimportsexternal shapesannotationssemantic actions
ShEx.exElixirv0.1.42020-10-13
Ruby ShExRuby0.7.12022-01-292.0
shexjavaJava2.0
PyShExPythonv0.8.12022-04-142.0
entityshapePython0.0.22023-06-24
shaclexScala0.1.702020-11-02
shex.jsJavaScriptv1.0.0-alpha.262023-04-25

Online playgrounds and demos

Further reading

Specification
Other

See also

Notes and References

  1. Book: Labra Gayo . Jose Emilio . Prud'hommeaux . Eric . Boneva . Iovka . Kontokostas . Dimitris . Validating RDF Data . Morgan & Claypool . 328 . 2018 . 9781681731650 .
  2. Web site: Shape Expressions Language 2.0. 27 March 2017 .
  3. Web site: RDF Validation Workshop: Practical Assurances for Quality RDF Data.