Skip to main content

Instants and Intervals

Instants and Intervals

To organize time based data in XINA, we use instants, referring to a single moment in time, and intervals, referring to a range of time. The goal for these components is to make it easy to find, compare, and trend data. Each has their own databases and include fields for:

  • type indicate how the instant/interval should be viewed and interpretted
  • UUID (universally unique identifier)
  • numeric primary and secondary IDs (meaning can depend on subtype)
  • plain text or HTML label and content
  • optional JSON object metadata

Why all these IDs? The UUID uniquely identifies an instant / interval, and is the only way to permanently, globally specify it. It should be applied at the time of creation to ensure consistently even if data is reprocessed. The primary / secondary IDs are optional, and can be used as needed. The general idea is that its much faster and more reliable to query numbers than text, so this is the best way to relate instants and intervals.

Instant Database

Default Location

<model>.data.ins

<model>.data.insf (with file)

Required Fields

fieldtypedescription
u_iduuidUUID
p_idint(8)primary ID
s_idint(4)secondary ID
tinstantunix timestamp
typeint(2)instant type code
levelint(1)level code
labelutf8string(64)plain text label
contentutf8textextended text / CSV / HTML
metajsonobjectadditional metadata as needed
confjsonobjectadditional information specific to type

Standard Types

typecodedescription
message0Basic instant, recommended to use standard IDs to indicate common events
alert1Higher priority variant of message
2D dataset (CSV)100General purpose 1D/2D data set (see below)

Interval Database

Default Location

<model>.data.int

<model>.data.intf (with file)

Required Fields

fieldtypedescription
u_iduuidUUID
p_idint(8)primary ID
s_idint(4)secondary ID
t_startinstantunix timestamp
t_endinstantunix timestamp
durationdurationt_end - t_start
typeint(2)interval type code
levelint(1)level code
labelutf8string(64)plain text label
contentutf8textextended text / CSV / HTML
metajsonobjectadditional metadata as needed
confjsonobjectadditional information specific to type

Standard Types

typecodedescription
marker0Basic interval, recommended to use standard IDs to indicate common events
test1Higher priority variant of message
2D dataset (CSV)100General purpose 1D/2D data set (see below)