Table of Contents

Class TimeQuery

Namespace
EncDotNet.S100.Datasets.Pipelines.Time
Assembly
EncDotNet.S100.Datasets.Pipelines.dll

Discriminated union over the supported temporal input shapes.

public abstract record TimeQuery : IEquatable<TimeQuery>
Inheritance
TimeQuery
Implements
Derived
Inherited Members

Remarks

Tools that accept a time parameter take a TimeQuery rather than a bare DateTimeOffset? so the same wire shape handles single-instant, range, and stepped-series questions.

TimeQuery.Instant selects a single point in time (the existing nearest-step semantics in coverage samplers). TimeQuery.Range expresses "anywhere in [from, to]" — used both as a coverage-series window and as a feature-validity filter. TimeQuery.Series expresses "every step from from through to", useful for "every 30 min for 6 hours" agent queries.

Construct instances via the static factory methods; the underlying records validate their bounds and throw ArgumentException on degenerate inputs. Use Parse(string) to construct from the wire format.

Fields

MaxSeriesCount

Hard cap on the number of instants a TimeQuery.Series may enumerate.

public const int MaxSeriesCount = 4096

Field Value

int

Remarks

Mirrors the page-size cap on query_features — server-side protection against agents asking for a 1-second cadence over a week. Tools should surface a structured error when the requested cadence × window exceeds this.

Methods

At(DateTimeOffset)

Creates a single-instant query. The supplied DateTimeOffset is normalised to UTC.

public static TimeQuery.Instant At(DateTimeOffset value)

Parameters

value DateTimeOffset

Returns

TimeQuery.Instant

Between(DateTimeOffset, DateTimeOffset)

Creates a range query. Throws ArgumentException when to precedes from.

public static TimeQuery.Range Between(DateTimeOffset from, DateTimeOffset to)

Parameters

from DateTimeOffset
to DateTimeOffset

Returns

TimeQuery.Range

Contains(DateTimeOffset)

Returns true when instant falls inside this query's window. For TimeQuery.Instant requires equality.

public bool Contains(DateTimeOffset instant)

Parameters

instant DateTimeOffset

Returns

bool

Every(DateTimeOffset, DateTimeOffset, TimeSpan)

Creates a stepped-series query. Throws ArgumentException on degenerate ordering or non-positive step.

public static TimeQuery.Series Every(DateTimeOffset from, DateTimeOffset to, TimeSpan step)

Parameters

from DateTimeOffset
to DateTimeOffset
step TimeSpan

Returns

TimeQuery.Series

GetWindow()

Window covered by this query. For TimeQuery.Instant the window is a degenerate (zero-length) range at the requested instant; for TimeQuery.Series it's the range from From to To (the actual enumeration may end earlier when (To - From) % Step != 0).

public (DateTimeOffset From, DateTimeOffset To) GetWindow()

Returns

(DateTimeOffset From, DateTimeOffset To)

Overlaps(DateTimeOffset?, DateTimeOffset?)

Returns true when this query's window overlaps the supplied validity interval. Useful for feature-validity filtering.

public bool Overlaps(DateTimeOffset? validityStart, DateTimeOffset? validityEnd)

Parameters

validityStart DateTimeOffset?

Inclusive validity start; null means "open-ended in the past".

validityEnd DateTimeOffset?

Inclusive validity end; null means "open-ended in the future".

Returns

bool