DataType Schema

DataType is a meta-schema for defining basic data types (like Text, Number, Boolean) and their validation rules. Unlike regular schemas that define properties, DataTypes define validation constraints for atomic values.

Schema Definition

Schema URL: https://rustybeam.net/schema/DataType

Properties

Property Type Cardinality Description
id https://rustybeam.net/schema/URL 1 The URL identifier for this data type
name https://rustybeam.net/schema/Text 1 The name of the data type
baseType https://rustybeam.net/schema/Text 1 The fundamental type (text, number, boolean, datetime, url)
validationPattern https://rustybeam.net/schema/Text 0..1 Regular expression for validating values of this type
constraints https://rustybeam.net/schema/Text 0..n Additional validation constraints (JSON format)
description https://rustybeam.net/schema/Text 0..1 Human-readable description of the data type

Usage

DataType documents define atomic data types that can be referenced in Property definitions. When a Property's type references a DataType URL, validation software should apply the DataType's validation rules to the property's value.

Note: DataTypes are fundamentally different from Schemas. While Schemas define structured objects with properties, DataTypes define validation rules for single values.

Example

<body itemscope itemtype="https://rustybeam.net/schema/DataType">
    <meta itemprop="id" content="https://rustybeam.net/schema/Email">
    <meta itemprop="name" content="Email">
    <meta itemprop="baseType" content="text">
    <meta itemprop="validationPattern" content="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$">
    <meta itemprop="description" content="RFC 5322 compliant email address">
    ...
</body>

See Also