Atomic Types

Atomic Types are the building blocks of entity types. The type system is a tree structure, where the semantic types are the branches and the atomic types are the leaves.

In SCL and Python when a field with an atomic type is accessed, the value of the atomic type is returned, not the atomic type object. To get the atomic type object, an underscore or “_object” is appended to the field name. This provides access to relevant helper methods, like for instance temperature conversion to Fahrenheit or date time related helpers.

Many atomic type constructors/setters are capable of taking a number of input types and normalize them to a standard format. For instance date_time can be given an ISO-8601 string with time zone, a Python datetime.datetime object or a UTC UNIX epoch integer / float.

Type Description
any Any can be any Atomic Type or value. It can be a date, URL, Boolean, integer, string, any valid value, etc.
entity Entity is a structured entity. For more details, see: Entity Type Definitions
bool Boolean - True or False
int<min, max> Integer - Negative or positive number in the given range (optional).
uint<min, max> Unsigned Integer - Positive number in the given range (optional).
float<min, max> Floating point number in the given range (optional)
rating Floating point number - Rating in the range 0.0 to 1.0
string<limit, regex> String - Non localized string with an optional length limit
name<limit> String - string with default limit of 64 characters
id<limit, regex> String - default limit: 64 / regex: ^[A-Za-z0-9_-.:]*$
user_id<limit, regex> String - default limit: 64 / regex: ^[A-Za-z0-9_-.:]*$
type_id<limit, regex> String - default limit: 64 / regex: ^[a-z][a-z0-9_.]*$
botlet_id<limit, regex> String - default limit: 64 / regex: ^[a-z][a-z0-9_.]*$
uuid<limit, regex> String - default limit: 36 / regex: ^[a-f0-9-]*$
field_name<limit, regex> String - default limit: 64 / regex: ^[a-z][a-z0-9_]*$
lstring<limit> Localized String - Localized string with an optional length limit.
list<type> A list of Entity Type or Atomic Types The type is optional and can also be a list of types
set<type> A list of Entity Type or Atomic Types The type is optional and can also be a list of types
map<key_type, value_type> Map - A dictionary of Entity Type or Atomic Types The types are optional and can also be a list of types
date_time ISO-8601 with time zone
date ISO-8601
time ISO-8601
duration Duration - Duration in seconds as int or float
url URL - A URL
link Link - A pair of URL and text
key_value_pair A pair of key / value strings
header Header - A pair of key / value strings
image_url Image URL - URL for an image with optional size options This can be a simple url or a dictionary of size => url Valid sizes are: [‘thumb’, ‘small’, ‘mobile’, ‘web’, ‘large’, ‘full’]
email_address Email Address - An email address
enum Enum [values] - A string out of a list of allowed values.
tags Tags - Set or Map of tags and scores from 0.0 to 1.0
ids Identifiers - A dictionary mapping domains to IDs. The domain should be a web domain like “youtube.com”.
country_code CountryCode - ISO 3166-1 alpha-2
locale Locale Language Code - ISO 639-1 _ ISO 3166-1 alpha-2
currency Currency Code - ISO 4217
money Pair of micros and ISO 4217 Currency Code
time_zone Time Zone - Example: America/Los_Angeles
mime_type Mime Type - a valid mime type
percentage Floating point number
color Hex String of red / green / blue: RRGGBB
illuminance Floating point number - LUX
distance Floating point number - Distance in meters
area Floating point number - Area in square meters
volume Floating point number - Volume in cubic meters
speed Floating point number - Speed in meters per second
frequency Floating point number - Frequency in occurrences per second
rpm Floating point number - Rotations per minute
level Floating point number - Level in decibel (e.g. sound)
temperature Floating point number - Temperature in celsius
pressure Floating point number - Pressure in Pascal
humidity Percentage
azimuth Floating point number - Direction in the range of 0.0 to 360.0
mass Floating point number - Mass in gram
force Floating point number - Force in newtons
energy Floating point number - Energy in joules
fuel_consumption Floating point number - Fuel consumption in liters per 100 kilometers
current Floating point number - Current in ampere
voltage Floating point number - Voltage in volt
power Floating point number - Power in watt