DataType Node
A DataType Node specifies the constraints for a literal value.
Key-value table
In the following the basic attributes that a DataType Node can have are listed:
key | required | value type | description | related error |
| true | IRI | The XSD-IRI representing the datatype the value must have. Below are the mapping functions between schema.org datatypes and XSD datatypes | Non-conform range |
| false | Literal | The standard value for this DataType (must be of the respective datatype). This is only a representational key-property (non-validating) |
Example
Advanced Constraints
Advanced constraints are introduced with this DS version. They can be used in DataType nodes for specific datatypes. Some of these constraints can have multiple entries; if that is the case, then an array is used to wrap the values.
Value Range Constraint Components
SHACL reference: https://www.w3.org/TR/shacl/#core-components-range
These constraint components dictate a value range that the value of a literal value must have. The datatype for this value must be the same as the datatype of the constrained literal. Datatypes that are allowed to have these constraints are: Date, DateTime, Time, Number, Float, and Integer.
key | value type | description | related error |
| same as constrained Data Type | The minimum exclusive value that the value must have | Non-conform sh:minExclusive |
| same as constrained Data Type | The minimum inclusive value that the value must have | Non-conform sh:minInclusive |
| same as constrained Data Type | The maximum exclusive value that the value must have | Non-conform sh:maxExclusive |
| same as constrained Data Type | The maximum inclusive value that the value must have | Non-conform sh:maxInclusive |
Example:
String based Constraint Components
SHACL reference: https://www.w3.org/TR/shacl/#core-components-string
These constraint components are meant for literals having the datatype string (and their sub-datatypes in some cases).
key | value type | description | related error |
| Integer | The maximum allowed string length of a literal (String or URL) | Non-conform sh:maxLength |
| Integer | The minimum allowed string length of a literal (String or URL) | Non-conform sh:minLength |
| [Regex] | A regular expression that the literal must match (String or URL) | Non-conform sh:pattern |
| [Language-Tag] | The literal must use a language tag given in the list of language tags (https://tools.ietf.org/html/bcp47) . Only for String values (in theory the exact datatype of the target literal is | Non-conform sh:languageIn |
| Boolean | The property | Non-conform sh:uniqueLang |
Example of a DataType Node as range for schema:description
:
Example of a DataType Node as range for schema:telephone
:
Property Value Pair Constraint Components
SHACL reference: https://www.w3.org/TR/shacl/#core-components-property-pairs
These constraints are explained in Property.md since they are expressed on a property-level, and not on a data-type-level.
Other Constraint Components
SHACL reference: https://www.w3.org/TR/shacl/#core-components-others
These constraints can be used on any data type.
key | value type | description | related error |
| same as constrained Data Type | Specifies the condition that each value node is a member of a provided SHACL list | Non-conform sh:in |
| same as constrained Data Type | Specifies the condition that at least one value node is equal to the given value | Non-conform sh:hasValue |
Example:
Datatype Mapping
Mapping Functions between XSD datatypes and schema.org datatypes:
(Other datatypes are ignored for now, since they are not used in practice)
Last updated