Tomas Uribe and Stefan Pabst
24 November 2021
less than a minute read
We are excited to add a new reference guide to our rapidly growing documentation. The Rel Data Types Guide describes the various built-in data types in Rel along with examples of how they can be used.
The guide shows for each data type:
For instance, we can write relations with different data types, and filter on entries that have specific types:
def R = {1; 0.5; :a; 'C'; "abc"}
def output(x) = R(x) and (Char(x) or Int(x))
Output:
'C' |
1 |
A Rel model does not have to specify the types of all relations in advance, since they are inferred and tracked automatically, but we still have the option to specify and enforce typed schemas using Integrity Constraints, if we choose to do so.
For example, we can specify that the relation price
always relates an integer ID with a price that is stored as fixed–decimal with 2 decimals places:
ic price_types_constraint {
subset(price, (Int, FixedDecimal[64, 2]))
}
These constraints can be added, removed or adjusted as your model or knowledge graph grows.
We are excited to announce worksheets, a new interface for submitting Rel queries. Worksheets allow you to develop blocks of Rel code and run them against a database. They can be shared with other users using their URLs.
Read MoreWe are excited to announce the support of varargs in Rel. You can use varargs to write more general code that works for multiple arities. Varargs can be useful when writing generic relations for common utilities.
Read MoreValue types help distinguish between different kinds of values, even though the underlying representation may be identical. Value types can be used to define other value types.
Read More