This document describes the Shape Expression Vocabulary and Term definitions used for describing Shape Expressions [[shex-semantics]]. This document provides the RDFS [[RDF-SCHEMA]] vocabulary definition and a description of the JSON-LD context definition for use with defining shape expressions.
Alternate versions of the vocabulary definition exist in
Turtle and
JSON-LD,
which also includes the @context required for metadata descriptions.
FIXME
This document describes the RDFS vocabulary description used in the Shape Expression Language (ShEx) [[shex-semantics]] along with the default JSON-LD Context and shape expression to validate RDF versions of shapes.
This specification makes use of the following namespaces:
shex:http://www.w3.org/ns/shex#rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#rdfs:http://www.w3.org/2000/01/rdf-schema#xsd:http://www.w3.org/2001/XMLSchema#The following are class definitions in the shex namespace:
| Annotation |
Annotation
§
Annotations provide a format-independent way to provide additional information about elements in a schema. |
| EachOf |
Each Of
§
A TripleExpression composed of one or more sub-expressions, all of which must match.
|
| IriStem |
IRI Stem
§
An IRI prefix used for matching IRIs.
|
| IriStemRange |
IRI StemRange
§
An IRI prefix (or wildcard) along with a set of excluded values, used for node matching.
|
| Language |
Language
§
An Language tag used for matching Literal Languages. |
| LanguageStem |
Language Stem
§
An Language prefix used for matching Literal Languages.
|
| LanguageStemRange |
Language StemRange
§
An Language prefix (or wildcard) along with a set of excluded values, used for node matching.
|
| LiteralStem |
Literal Stem
§
An Literal prefix used for matching Literals.
|
| LiteralStemRange |
Literal StemRange
§
An Literal prefix (or wildcard) along with a set of excluded values, used for node matching.
|
| NodeConstraint |
Node Constraint
§
A constraint on the type or value of an RDF Node.
|
| NodeKind |
Node Kind
§
The set of kinds of RDF Nodes. |
| OneOf |
One Of
§
A TripleExpression composed of one or more sub-expressions, one of which must match.
|
| Schema |
Schema
§
A Schema contains the set of shapes, used for matching a focus node. |
| SemAct |
Semantic Actions
§
A list of Semantic Actions that serve as an extension point for Shape Expressions. They appear in lists in Schema's startActs and Shape, OneOf, EachOf and TripleConstraint's semActs. |
| Shape |
Shape Or
§
A shapes schema is captured in a Schema object where shapes is a mapping from shape label to shape expression.
|
| ShapeAnd |
Shape And
§
A ShapeExpression composed of one or more sub-expressions, all of which must match.
|
| ShapeExpression |
Shape Expression
§
The abstract class of Shape Expressions. |
| ShapeExternal |
Shape External
§
A reference to a shape defined in some external Schema.
|
| ShapeNot |
Shape Not
§
A ShapeNot is satisfied when it’s included ShapeExpression is not satisfied.
|
| ShapeOr |
Shape Or
§
A ShapeExpression composed of one or more sub-expressions, one of which must match.
|
| Stem |
Stem
§
Abstract class for Stems |
| StemRange |
StemRange
§
Abstract Class for Stem Ranges |
| TripleConstraint |
Triple Constraint
§
A constraint on a triple having a specific predicate and optionally a shape expression used for matching values.
|
| TripleExpression |
Triple Expression
§
The abstract class of Triple Expressions. |
| Wildcard |
Wildcard
§
Indicates that a stem is a Wildcard, rather than a URI prefix. |
The following are property definitions in the shex namespace:
| annotation |
annotation
§
Annotations on a TripleExpression.
|
| closed |
closed
§
Indicates that a Shape is closed, meaning that it may contain no property values other than those used within TripleConstraints.
|
| code |
code
§
Code executed by Semantic Action.
|
| datatype |
datatype
§
A datatype constraint.
|
| exclusion |
exclusion
§
Values that are excluded from value matching.
|
| expression |
expression
§
Expression associated with the TripleExpression.
|
| expressions |
expressions
§
List of 2 or more expressions associated with the TripleExpression.
|
| extra |
extra
§
Properties which may have extra values beyond those matched through a constraint.
|
| extends |
extends
§
Base shape expressions for this shape.
|
| flags |
flags
§
Regular expression flags
|
| fractiondigits |
fraction digits
§
for "fractiondigits" constraints, v is less than or equals the number of digits to the right of the decimal place in the XML Schema canonical form[xmlschema-2] of the value of n, ignoring trailing zeros.
|
| inverse |
inverse
§
Constrains the subject of a triple, rather than the object.
|
| languageTag |
language tag
§
The value used to match the language tag of a language-tagged string.
|
| length |
length
§
The exact length of the value of the cell.
|
| max |
maximum cardinality
§
Maximum number of times this TripleExpression may match; -1 for “*”
|
| maxexclusive |
max exclusive
§
An atomic property that contains a single number that is the maximum valid value (exclusive).
|
| maxinclusive |
max inclusive
§
An atomic property that contains a single number that is the maximum valid value (inclusive).
|
| maxlength |
max length
§
A numeric atomic property that contains a single integer that is the maximum length of the value.
|
| min |
minimum cardinatliy
§
Minimum number of times this TripleExpression may match.
|
| minexclusive |
min exclusive
§
An atomic property that contains a single number that is the minimum valid value (exclusive).
|
| mininclusive |
min inclusive
§
An atomic property that contains a single number that is the minimum valid value (inclusive).
|
| minlength |
min length
§
An atomic property that contains a single integer that is the minimum length of the value.
|
| name |
name
§
Identifier of SemAct extension.
|
| nodeKind |
node kind
§
Restiction on the kind of node matched; restricted to the defined instances of NodeKind. One of shex:iri, shex:bnode, shex:literal, or shex:nonliteral.
|
| numericFacet |
§
Abstract property of numeric facets on a NodeConstraint.
|
| object |
object
§
The object of an Annotation.
|
| pattern |
pattern
§
A regular expression used for matching a value.
|
| predicate |
predicate
§
The predicate of a TripleConstraint or Annotation.
|
| semActs |
semantic action
§
Semantic Actions on this TripleExpression.
|
| shapeExpr |
shape expression
§
Shape Expression referenced by this shape.
|
| shapeExprs |
shape expressions
§
A list of 2 or more Shape Expressions referenced by this shape.
|
| shapes |
shapes
§
Shapes in this Schema.
|
| start |
start
§
A ShapeExpression matched against the focus node prior to any other mapped expressions.
|
| startActs |
start actions
§
Semantic Actions run on the Schema.
|
| stem |
stem
§
A stem value used for matching or excluding values.
|
| stringFacet |
§
An abstract property of string facets on a NodeConstraint.
|
| totaldigits |
total digits
§
for "totaldigits" constraints, v equals the number of digits in the XML Schema canonical form[xmlschema-2] of the value of n
|
| valueExpr |
value expression
§
A ShapeExpression used for matching the object (or subject if inverted) of a TripleConstraint.
|
| values |
values
§
A value restriction on a NodeConstraint.
|
| xsFacet |
§
An abstract property of string and numeric facets on a NodeConstraint.
|
The following are datatype definitions in the shex namespace:
The following are instance definitions in the shex namespace:
| bnode |
bnode
§
Requires node to be a Blank Node |
| iri |
iri
§
Requires node to be an IRI |
| literal |
literal
§
Requires node to be an rdf:Literal |
| nonliteral |
nonliteral
§
Requires node to be a Blank Node or IRI |