Resampling And Windowing

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 resample_to_grid(
  [{ts: 1100, value: 1.0}, {ts: 1500, value: 3.0}, {ts: 2500, value: 5.0}],
  1000,
  'avg'
)

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

Resampling And Windowing 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 Resampling And Windowing, which helps planner tooling preserve the intended sequence semantics.

CALL nexyron.entity_time_range([12345], 0, 86400000, 'Reading')
YIELD node_id, start_ts, weight
WITH collect({
       ts: start_ts,
       value: weight,
       node_id: node_id
     }) AS series
RETURN align_to_grid(series, 60000) AS aligned,
       resample_to_grid(series, 300000, 'avg', 'value') AS rollup_5m,
       calendar_window(series, 'hour', 'value') AS hourly_summary,
       sliding_window(series, 10) AS recent_windows,
       missing_ratio(series, 60000) AS cadence_gap_ratio

Real Use Cases

Real Limitations And Tradeoffs