Ordered Sequence Analytics

Generic Description

Is a live Cypher function in Nexyron. It is documented separately because time construction, sequence ordering, window parameters, and as-of behavior materially change analytical meaning.

Simple example:

RETURN rolling_avg([10, 12, 18, 20], 2)

Consumer-Level Explanation

Use it when the function semantics match the query intent exactly. Prefer this function when the temporal assumption should be visible to the planner, especially for event streams, freshness checks, and sequence features.

More Detailed Explanation

Ordered Sequence Analytics should be understood by the value shape it expects and the row shape it returns. It composes with MATCH, WHERE, WITH, RETURN, and procedure output, so planner-facing documentation should describe both the immediate value transformation and why it belongs in the database query.

Advanced Example

This example names the event stream and operational context before applying Ordered Sequence Analytics, which helps planner tooling preserve the intended sequence semantics.

CALL nexyron.temporal_history(42, 'heart_rate', 0, 86400000)
YIELD ts, value
WITH collect({ts: ts, value: value}) AS bpm_series
RETURN latest(bpm_series) AS latest_sample,
       nearest_prior(bpm_series, 3600000) AS prior_to_hour_1,
       lag(bpm_series) AS shifted_series,
       diff(bpm_series, 'value') AS beat_deltas,
       rolling_avg(bpm_series, 5, 'value') AS short_term_avg,
       ema(bpm_series, 10, 'value') AS smoothed_series,
       baseline_deviation(bpm_series, 'value') AS latest_z_score

Real Use Cases

Real Limitations And Tradeoffs