Data Types
Defining the acceptable values of a property type
Overview
Data types describe an acceptable format of a value. Data types (validation logic) are distinct from property types (semantic meaning), allowing for single data types to be re-used across many multiple property types.
Primtive data types
HASH contains a series of primitive data types, which are widely used, and from which more complex data types can be constructed. These include:
→
Text
: an ordered sequence of characters, including letters, numbers, and symbols→
Number
: an arithmetical value (in the real number system)→
Boolean
: a "true" or "false" value
HASH also contains three other primitive data types, which are unlikely to be useful to most users.
The 3 advanced primitive data types
The following primtive data types are also supported in HASH, ensuring that all values representable within JavaScript Object Notation (JSON) are also representable in HASH:
→
Null
: A placeholder value representing 'nothing'→
Object
: A plain JSON object with no predefined structure→
Empty List
: An empty List
Custom data types
Non-primitive (i.e. "custom") data types provide an easy way to validate more complicated property values which historically might have required the repeated writing or rewriting or Regular Expressions (RegEx), or use of purpose-built programming language data validation libraries -- for example credit card numbers, dates, phone numbers, colors, etc.
Available data types
You can view all of the publicly-shared data types that are in HASH from the Types > Data Types page. This includes commonly-used everyday data formats such as phone numbers, email addressses, URLs and currencies, as well as standard SI units (e.g. time, length, mass, current, temperature, substance amounts and luminosity), in addition to many more niche, domain-specific and esoteric types.
If you can't find an existing data type that fits your needs, you can also create your own.
Creating custom data types
We'll be documenting how to create custom data types shortly.
Data type groups
Converting between data types
We'll be adding information about converting between data types using "data type groups" in the near future.
Create a free account
Sign up to try HASH out for yourself, and see what all the fuss is about
By signing up you agree to our terms and conditions and privacy policy