Rel Data Types
This reference guide describes the various data types in Rel.
|Numeric||Primitive||Fixed-sized decimals with |
|Numeric||Abstract||Union of all numeric data types.|
|Time||Primitive||Timestamps containing date and time information.|
|Key||Abstract||Entity key, union of |
|Meta||Primitive||Symbols. Can be used to specify names of relations.|
|Other||Abstract||Union of all data types.|
|Other||Primitive||Boolean data type (for JSON support only).|
|Other||Primitive||File positions in a data file.|
|Other||Primitive||Singleton representing missing data.|
Rel classifies data types based on their main purpose:
|Numeric||Numeric data types.|
|Text||Text-based data types.|
|Time||Time-related data types.|
|Key||Data types for identification purposes, such as UUIDs.|
|Meta||Data types referring to metadata information (such as relation names).|
|Other||All other supported data types.|
Rel also distinguishes between two kinds of data types:
|Primitive||Data types with no further subtypes.|
|Abstract||Data types built on top of primitive types, usually unions of multiple primitive data types.|
Relations are unordered collections of tuples. A tuple is an ordered collection of individual data values. Each data value has a data type.
In Rel, each data type has an associated unary relation, which includes all the values of that type. Type relations are often infinite, and therefore cannot be listed directly, but are still useful when specifying knowledge graphs, data schemas, and constraints.
Checking types is particularly useful for integrity constraints, as many of the examples in this document show. See Integrity Constraints for more details.
For each data type, Rel generally provides:
- A way to construct values of that data type.
- A type relation that tests if a given value belongs to that type.
- Operations specific to the data type.
The following sections describe each supported data type and provide examples of how they can be used:
- Numeric Data Types
- Text Data Types
- Time-Related Data Types
- Entity Data Types
- Metadata Types
- Other Data Types