Skip to main content

Temporal Representation

Layers provides composable temporal primitives that fully subsume TimeML/ISO-TimeML, W3C OWL-Time, Allen's Interval Algebra, and ISO 8601. This guide documents the temporal type system and maps each standard to Layers equivalents.

Two Kinds of Time

Layers distinguishes media time from semantic time:

  • Media time (temporalSpan): where in an audio/video recording an annotation occurs. Expressed as millisecond offsets. Used for anchoring annotations to media: "this word is at 3:45–3:47 in the recording."

  • Semantic time (temporalExpression): what time a linguistic expression refers to. Expressed as ISO 8601 values with granularity, calendar, modifiers, and document function. Used for temporal annotation: "this expression refers to March 2024."

Media time lives on anchors (pub.layers.defs#anchor.temporalSpan). Semantic time lives on annotations (pub.layers.annotation#annotation.temporal). They are independent: a temporal expression annotation at 3:45 in a recording might refer to "next Tuesday."

Temporal Primitives

Three composable objects in pub.layers.defs:

temporalEntity

The normalized temporal value. Consumers dispatch on which fields are populated:

PatternFieldsExample
Point in timeinstant"2024-03-15"
Bounded intervalintervalStart + intervalEnd"2024-01-01" to "2024-12-31"
Start + durationintervalStart + duration"2024-03-15" + "P7D"
Pure durationduration"PT2H30M"
Uncertain boundsearliest + latest"2024-03-01" to "2024-03-31"
Repeating patternrecurrence"R/P1W" (weekly)

All datetime strings use ISO 8601. Granularity (year, month, day, etc.) specifies the precision of the value. Calendar (gregorian, hijri, hebrew, etc.) specifies the temporal reference system.

temporalModifier

Qualitative modification: approximate, early, mid, late, start, end, before, after, on-or-before, on-or-after, less-than, more-than.

temporalExpression

The complete temporal annotation, packaging:

  • type: date, time, duration, set, interval, relative
  • value: ref to temporalEntity
  • modifier: ref to temporalModifier
  • anchorRef: what this expression is relative to (e.g., document creation time)
  • function: the role this time plays in the document (creation-time, publication-time, etc.)

Temporal Relations

Temporal relations between annotations use pub.layers.graph#graphEdge with Allen's 13 interval relations as edgeType values:

RelationInverseMeaning
beforeafterA ends before B starts (gap between)
meetsmet-byA ends exactly when B starts
overlapsoverlapped-byA starts first, they share some time, B ends last
startsstarted-byA and B start together, A ends first
duringcontainsA is entirely within B
finishesfinished-byA and B end together, A starts later
equalsequalsA and B have identical start and end

Additional temporal edge types: simultaneous (TimeML extension, looser than equals).

Aspectual edge types (TimeML ALINK): initiates, culminates, terminates, continues, reinitiates.

The label field on a temporal graphEdge can carry the linguistic signal/connective that triggered the relation (e.g., "before", "since", "during"). Signal annotations themselves use subkind="temporal-signal" on annotation layers.

Composability Examples

Simple date annotation:

{
"subkind": "temporal-expression",
"label": "DATE",
"text": "March 15, 2024",
"temporal": {
"type": "date",
"value": {
"instant": "2024-03-15",
"granularity": "day"
}
}
}

Vague duration:

{
"temporal": {
"type": "duration",
"value": { "duration": "PT3H" },
"modifier": { "mod": "approximate" }
}
}

Weekly recurrence ("every Tuesday"):

{
"temporal": {
"type": "set",
"value": { "recurrence": "R/P1W" }
}
}

Relative time ("3 days ago"):

{
"temporal": {
"type": "relative",
"value": { "duration": "P3D" },
"modifier": { "mod": "before" },
"anchorRef": { "localId": "dct-annotation-uuid" }
}
}

Document creation time:

{
"temporal": {
"type": "date",
"value": { "instant": "2024-01-15" },
"function": "creation-time"
}
}

Uncertain month ("sometime in March"):

{
"temporal": {
"type": "date",
"value": {
"earliest": "2024-03-01",
"latest": "2024-03-31",
"granularity": "month"
}
}
}

Non-Gregorian calendar ("Ramadan 1445 AH"):

{
"temporal": {
"type": "interval",
"value": {
"intervalStart": "2024-03-11",
"intervalEnd": "2024-04-09",
"calendar": "hijri"
}
}
}

Temporal relation (graphEdge):

{
"source": { "recordRef": "at://did:plc:.../pub.layers.annotation/...", "objectId": "timex-1-uuid" },
"target": { "recordRef": "at://did:plc:.../pub.layers.annotation/...", "objectId": "timex-2-uuid" },
"edgeType": "before",
"label": "before",
"confidence": 9500
}

Standards Mapping

TimeML / ISO-TimeML (ISO 24617-1)

TimeML is the ISO standard for temporal and event annotation. Layers fully subsumes TimeML through structured temporal primitives and graph edges.

TimeML ElementLayers EquivalentNotes
TIMEX3annotation with subkind="temporal-expression" + temporal fieldAll TIMEX3 attributes mapped to structured fields
TIMEX3.type (DATE, TIME, DURATION, SET)temporalExpression.typeDATE to date, TIME to time, DURATION to duration, SET to set
TIMEX3.valuetemporalEntity fieldsISO 8601 values decomposed into instant, intervalStart, intervalEnd, duration
TIMEX3.mod (APPROX, START, MID, END, BEFORE, AFTER)temporalModifier.modAPPROX to approximate, START to start, MID to mid, END to end, BEFORE to before, AFTER to after
TIMEX3.anchorTimeIDtemporalExpression.anchorRefobjectRef pointing to another temporal annotation
TIMEX3.temporalFunctiontemporalExpression.anchorRef presenceIf anchorRef is populated, the value is computed relative to it
TIMEX3.functionInDocumenttemporalExpression.functionCREATION_TIME to creation-time, PUBLICATION_TIME to publication-time, etc.
EVENT (temporal attributes)annotation.featuresTimeML event attributes (tense, aspect, polarity, modality, class) map to feature keys on situation-mention annotations
SIGNALannotation with subkind="temporal-signal"Temporal connectives and prepositions ("before", "during", "since")
TLINKgraphEdge with Allen edgeTypeTimeML relType maps to Allen relation edge types. BEFORE to before, AFTER to after, INCLUDES to contains, IS_INCLUDED to during, SIMULTANEOUS to simultaneous, IDENTITY to equals, BEGINS to starts, ENDS to finishes, BEGUN_BY to started-by, ENDED_BY to finished-by
TLINK.signalIDgraphEdge.label or graphEdge.propertiesThe linguistic signal triggering the temporal relation
ALINKgraphEdge with aspectual edgeTypeINITIATES to initiates, CULMINATES to culminates, TERMINATES to terminates, CONTINUES to continues, REINITIATES to reinitiates
SLINKgraphEdge with edgeType="discourse" + labelSubordination links (modal, evidential, factive, conditional) are discourse relations

Completeness: Full subsumption. Every TimeML element and attribute has a direct mapping.

W3C OWL-Time

OWL-Time is the W3C ontology for temporal concepts. Layers maps its class hierarchy to the polymorphic temporalEntity type.

OWL-Time ConceptLayers EquivalentNotes
TemporalEntitytemporalEntityPolymorphic: dispatch on populated fields
InstanttemporalEntity.instantSingle ISO 8601 datetime string
Interval / ProperIntervaltemporalEntity.intervalStart + intervalEndBounded interval with distinct start/end
hasBeginningtemporalEntity.intervalStartInterval start bound
hasEndtemporalEntity.intervalEndInterval end bound
DurationtemporalEntity.durationISO 8601 duration string
hasTemporalDurationtemporalEntity.durationDuration of an interval
DateTimeDescriptiontemporalEntity + granularity + calendarCalendar-aware temporal description
GeneralDateTimeDescriptiontemporalEntity + calendarUriArbitrary temporal reference system
unitTypetemporalEntity.granularityTemporal precision unit
hasTRS (Temporal Reference System)temporalEntity.calendar / calendarUriCalendar system identification
DayOfWeek, MonthOfYeartemporalEntity.featuresEncode as feature keys when needed
TemporalAggregateMultiple temporalEntity refs or clusterSetGroup temporal entities via clustering
Allen interval relations (before, after, etc.)graphEdge.edgeTypeAll 13 as first-class edge types
hasInside (Instant in Interval)graphEdge with edgeType="during"Instant during an interval

Completeness: Full subsumption. Every OWL-Time class and property has a mapping. The Layers representation is more compact (polymorphic object vs. class hierarchy) but equally expressive.

Allen's Interval Algebra

Allen's interval algebra defines 13 mutually exclusive relations between two time intervals. All 13 are first-class graphEdge.edgeType values in Layers.

#RelationInverseVisualDefinition
1beforeafterAAA BBBA ends before B starts
2afterbeforeBBB AAAA starts after B ends
3meetsmet-byAAABBBA ends exactly when B starts
4met-bymeetsBBBAAAA starts exactly when B ends
5overlapsoverlapped-byAAA___/___BBBA starts first, overlap, B ends last
6overlapped-byoverlaps___AAA/BBB___B starts first, overlap, A ends last
7startsstarted-byAA____/BBBBBSame start, A ends first
8started-bystartsAAAAA/BB____Same start, B ends first
9duringcontains_AAA_/BBBBBA entirely within B
10containsduringAAAAA/_BBB_B entirely within A
11finishesfinished-by____AA/BBBBBSame end, A starts later
12finished-byfinishesAAAAA/____BBSame end, B starts later
13equalsequalsAAAAA/BBBBBIdentical start and end

Inverse convention: before(A,B) is equivalent to after(B,A). Both are valid; use whichever is natural for the annotation direction.

Point algebra: For instants (zero-duration intervals), only three Allen relations apply: before, after, equals.

Constraint composition: Allen's composition table (what can be inferred from combining two relations) is an application-level concern, not encoded in the schema. Libraries like allen-algebra can compute transitive closure over Layers graph edges.

ISO 8601

All temporal string values in Layers use ISO 8601 format.

ISO 8601 ConceptLayers FieldExample
DatetemporalEntity.instant2024-03-15
Date and timetemporalEntity.instant2024-03-15T14:30:00Z
Date with timezonetemporalEntity.instant2024-03-15T14:30:00+09:00
Year onlytemporalEntity.instant + granularity="year"2024
Year-monthtemporalEntity.instant + granularity="month"2024-03
Week datetemporalEntity.instant2024-W12-3
Ordinal datetemporalEntity.instant2024-075
DurationtemporalEntity.durationP3Y2M10D, PT2H30M, P1W
Interval (start/end)intervalStart + intervalEndTwo ISO 8601 datetime strings
Interval (start/duration)intervalStart + durationStart + ISO 8601 duration
Interval (duration/end)duration + intervalEndISO 8601 duration + end
Repeating intervaltemporalEntity.recurrenceR5/P1D (5 daily), R/P1W (weekly unbounded)

ELAN / Timeline-Based Annotation

ELAN and similar multimedia annotation tools use timeline-based representation with time-aligned tiers.

ELAN ConceptLayers EquivalentNotes
TimelinetemporalSpan on anchorMedia time in milliseconds
Time-aligned tierannotationLayer with temporal anchorsEach annotation has anchor.temporalSpan
Symbolic tier (dependent)annotationLayer with parentLayerRefReferences parent time-aligned tier
Time slotImplicit in temporalSpan.start / temporalSpan.endingMillisecond precision
Controlled vocabularyontologyRef on annotationLayerPoints to ontology defining the label set
Forced alignmentpub.layers.alignment with kind="audio-to-text"Alignment between audio and text segments

See Also