Various types of data are supported by WEM. These data types can be saved to a database, they can be used to add logic to your application, produce forms for user input, the can be used as static data and more.
The available data types are stated below.
Boolean
A boolean value can either be true
, false
or unknown.
Expression literal examples
true
false
An unknown value is written as UnknownBoolean
.
Concept
A concept value is defined in the ontology.
Data model: a field that has a concept value is called a “single select” field.
Expression literal examples
`Color`
`Color`.`Orange`
`Color`.`Blue`
`Color`.`Red`
An unknown value is written as Unknownconcept
.
Concept type
A concept set is a collection of concepts. Duplicates can never occur in the same collection and are filtered out.
Data model: a field that has a concept set value is called a “multi select” field.
Expression literal examples
{ `Color`.`Orange`, `Color`.`Blue`, `Color`.`Red` }
An unknown value is written as Unknownconceptset
.
Date time
A date, optionally with a time.
Expression literal examples
'2014-08-21' /* Date without time */
'2014-08-21T14:30:00' /* Date with time */
An unknown value is written as UnknownDateTime
.
Units
The contents of a date consist of several parts in the following units.
Year
Month
Week
Day
Hour
Minute
Second
Millisecond
These units can be typed in expressions.
Formatting
The formatting of duration values can be controlled using format strings. Some examples for formatting '2014-08-21 14:30'
are shown below.
(empty) /* 21-8-2014 14:30:00 */
MM-dd-yy /* 08-21-14 */
MMMM d yyyy /* August 21 2014 */
dddd MMM d /* Thursday Aug 21 */
d/M/yy HH:mm /* 21/8/14 14:30 */
hh:mm:ss /* 02:30:00 */
h:mm tt /* 2:30 PM */
Duration
A duration or time span.
Expression literal examples
'30s' /* 30 seconds */
'1d4h12m30s' /* 1 day, 4 hours, 12 minutes and 30 seconds */
'1d15m' /* 1 day and 15 minutes */
'120m' /* 2 hours */
'12m30s' /* 12 minutes and 30 seconds */
'12.5m' /* 12 minutes and 30 seconds */
An unknown value is written as UnknownDuration
.
Formatting
The formatting of duration values can be controlled using format strings. Some examples for formatting '1d4h12m30s'
are shown below.
(empty) /* 04:12:30 */
days /* 1.17534722222222 */
hours /* 28.2083333333333 */
minutes /* 1692.5 */
seconds /* 101550 */
clock /* 04:12 */
long /* 1 day, 4 hours, 12 minutes and 30 seconds */
File
A file.
Expression literal examples
No literal for a file can be written in expressions.
An unknown value is written as UnknownFile
.
Number
A number.
Expression literal examples
1
0
3.14
-1
-0.0054825
An unknown value is written as UnknownNumber
.
Formatting
The formatting of numbers can be controlled using format strings. Some examples for formatting 1054.32179
are shown below.
0000 /* 1054 */
#,000.000 /* 1,054.322 */
000,000,000.00### /* 000,000,001,054.32179 */
Reference
Contains a row ID of a database list.
Expression literal examples
No literal for a reference can be written in expressions.
An unknown value is written as UnknownEntityReference
.
Rich text
Contains plain HTML.
Expression literal examples
No literal for rich text can be written in expressions.
An unknown value is written as UnknownRichText
.
Text
Contains text.
Expression literal examples
A text literal consists of zero or more characters enclosed by double quotes.
"Hello World!"
"Greetings Mr Doe."
""
"The wolf said: \"Little pig, little fatty, let me come in.\"."
An unknown value can be written as UnknownString
.
Note: special characters are escaped with a backslash (\).