Skip to content

Function: allen()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / allen

Function: allen()

allen(relation, intervalA, intervalBTermId): ConstraintInputDto

Defined in: src/builders/allen.ts:39

Create an Allen temporal constraint.

Parameters

relation

AllenRelation

One of the 13 Allen interval relations.

intervalA

string

The first interval identifier (variable or feature path).

intervalBTermId

string

The term ID (UUID) containing the second interval.

Returns

ConstraintInputDto

A ConstraintInputDto of type Allen.

Remarks

Serialization format: Tagged (ConstraintInputDto).

Produces the following JSON:

{
"type": "Allen",
"interval_a": "start_time",
"interval_b_term_id": "uuid",
"relation": "before"
}

The 13 Allen relations are: before, after, meets, met_by, overlaps, overlapped_by, during, contains, starts, started_by, finishes, finished_by, equals.

Example

import { allen } from '@kortexya/reasoninglayer';
// Event A must happen before Event B:
const constraint = allen("before", "event_a_time", "event-b-term-uuid");
// Meeting must overlap with work hours:
const overlap = allen("overlaps", "meeting_time", "work-hours-term-uuid");