Skip to content

Temporal sequence Aggregation Function#3

Merged
estebanzimanyi merged 13 commits into
MobilityDB:mainfrom
marianaGarcez:main
Jul 21, 2025
Merged

Temporal sequence Aggregation Function#3
estebanzimanyi merged 13 commits into
MobilityDB:mainfrom
marianaGarcez:main

Conversation

@marianaGarcez

Copy link
Copy Markdown
Contributor

This PR adds the temporal sequence aggregation functionality and refactors to use a centralized MEOSWrapper class instead of direct C calls.

Key Changes:

  1. MEOSWrapper API Additions:
  • Added wrapper functions for common MEOS operations
  1. TemporalSequenceAggregationPhysicalFunction Refactoring:
  • Replaced direct MEOS C API calls with MEOSWrapper functions
  • Removed local MEOS initialization logic (now handled by wrapper)
  1. New Test Cases:
  • Added temporal_sequence2.test
  • Added temporal_sequence3.test

Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Segmentation fault sometimes

Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
Signed-off-by: marianaGarcez <marianamgd@gmail.com>
@estebanzimanyi estebanzimanyi merged commit 434e0a3 into MobilityDB:main Jul 21, 2025
marianaGarcez pushed a commit that referenced this pull request Jul 31, 2025
estebanzimanyi added a commit to estebanzimanyi/MobilityNebula that referenced this pull request May 21, 2026
…/27 cells) on NebulaStream

Additive scaffold for the BerlinMOD-9 × 3 streaming-form parity contract
on MobilityNebula, sibling to the existing SNCB Q-series and matching
the MobilityFlink MobilityDB#3 / MobilityKafka MobilityDB#1 streaming-form definitions.

Cells in this PR:

  Q1 'which vehicles have appeared'      — continuous + windowed + snapshot
  Q2 'where is vehicle X at time T'      — continuous + windowed + snapshot
  Q3 'vehicles within 5 km of P'         — continuous + windowed + snapshot
  Q4 'vehicles inside region R (polygon)'— continuous + windowed + snapshot
  Q7 'first passage of vehicle through POI' × {POI1, POI2, POI3}
                                          — continuous + windowed + snapshot
                                          (3 YAMLs per form via per-POI fan-out)

Form mapping to NebulaStream windows:

  continuous: SLIDING(time_utc, SIZE 1 SEC, ADVANCE BY 1 SEC)
  windowed:   TUMBLING(time_utc, SIZE 10 SEC)
  snapshot:   TUMBLING(time_utc, SIZE 5 SEC)

MEOS-side surface consumed (already exposed by PR MobilityDB#14 + follow-ups):

  edwithin_tgeo_geo — Q3 (POINT predicate), Q4 (POLYGON, d=0.0), Q7 (per-POI POINT)
  TEMPORAL_SEQUENCE — Q2 (per-window trajectory aggregation)

No new MEOS PhysicalFunction classes added; no C++ changes; no SNCB
Q-series modifications. All YAMLs are additive in a new
Queries/berlinmod/ subdirectory.

Q7 fan-out: NebulaStream's current SQL has no Cartesian (vehicle × POI)
aggregation primitive; Q7 is expressed as one YAML per (POI, form) and
consumers read the per-POI output files together to recover the full
per-(vehicle, POI) first-passage matrix. Three POIs × three forms = nine
YAMLs.

Add (additions):
  Queries/berlinmod/q1_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q2_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q3_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q4_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q7_poi{1,2,3}_{continuous,windowed,snapshot}.yaml (9)
  Input/input_berlinmod.csv  (sample data: 3 vehicles × 21 events, 14 simulated seconds)
  docs/berlinmod-streaming-forms.md

Validation: every YAML parses cleanly via python3 yaml.safe_load.
Runtime verification gated on the NebulaStream test harness.

Coverage: 15 of 27 cells (56 %). Q5/Q6/Q8/Q9 × 3 forms documented as
needing either NebulaStream-side stream-self-join support (Q5/Q9) or
new MEOS PhysicalFunction classes (Q6 temporal_length, Q8 distance to
LINESTRING) — surfaced in docs/berlinmod-streaming-forms.md.
estebanzimanyi added a commit to estebanzimanyi/MobilityNebula that referenced this pull request May 21, 2026
… on NebulaStream (33 YAMLs, 27/27 cells)

Additive scaffold for the BerlinMOD-9 × 3 streaming-form parity contract
on MobilityNebula, sibling to the existing SNCB Q-series and matching
the MobilityFlink MobilityDB#3 / MobilityKafka MobilityDB#1 streaming-form definitions.

All 27 cells covered:

  Q1 'which vehicles have appeared'      — full (continuous + windowed + snapshot)
  Q2 'where is vehicle X at time T'      — full
  Q3 'vehicles within 5 km of P'         — full
  Q4 'vehicles inside region R (polygon)'— full
  Q5 'pairs of vehicles meeting near P'  — partial (emit per-vehicle trajectories near P; consumer joins)
  Q6 'cumulative distance per vehicle'   — partial (emit TEMPORAL_SEQUENCE; consumer computes length)
  Q7 'first passage of vehicle through POI' × {POI1, POI2, POI3}
                                          — full (per-POI fan-out)
  Q8 'vehicles within d of LINESTRING'   — full (edwithin_tgeo_geo with LINESTRING geometry)
  Q9 'distance between X and Y at time T'— partial (emit X and Y trajectories; consumer joins)

18 of 27 cells are FULL (the BerlinMOD-Q semantic is computed entirely
inside NebulaStream). 9 cells are PARTIAL — NebulaStream emits the
per-window inputs (trajectory, candidate vehicles) and a consumer
post-processes for the final BerlinMOD-Q answer. The partial pattern
is the natural expression of these queries in NebulaStream's current
SQL surface; the path to FULL is documented per-Q in
docs/berlinmod-streaming-forms.md (a stream-self-join for Q5/Q9, a
temporal_length scalar function for Q6).

Form mapping to NebulaStream windows:

  continuous: SLIDING(time_utc, SIZE 1 SEC, ADVANCE BY 1 SEC)
  windowed:   TUMBLING(time_utc, SIZE 10 SEC)
  snapshot:   TUMBLING(time_utc, SIZE 5 SEC)

MEOS-side surface consumed (already exposed by PR MobilityDB#14 + follow-ups):

  edwithin_tgeo_geo — Q3 (POINT predicate), Q4 (POLYGON, d=0.0),
                      Q5 (POINT predicate), Q7 (per-POI POINT),
                      Q8 (LINESTRING predicate)
  TEMPORAL_SEQUENCE — Q2 / Q5 / Q6 / Q9 (per-window per-vehicle trajectory)

No new MEOS PhysicalFunction classes added; no C++ changes; no SNCB
Q-series modifications. All 33 YAMLs are additive in a new
Queries/berlinmod/ subdirectory.

Add (additions):
  Queries/berlinmod/q1_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q2_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q3_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q4_{continuous,windowed,snapshot}.yaml          (3)
  Queries/berlinmod/q5_{continuous,windowed,snapshot}.yaml          (3, partial)
  Queries/berlinmod/q6_{continuous,windowed,snapshot}.yaml          (3, partial)
  Queries/berlinmod/q7_poi{1,2,3}_{continuous,windowed,snapshot}.yaml (9, full via fan-out)
  Queries/berlinmod/q8_{continuous,windowed,snapshot}.yaml          (3, LINESTRING predicate)
  Queries/berlinmod/q9_{continuous,windowed,snapshot}.yaml          (3, partial)
  Input/input_berlinmod.csv  (sample data: 3 vehicles × 21 events, 14 simulated seconds)
  docs/berlinmod-streaming-forms.md

Validation: every YAML parses cleanly via python3 yaml.safe_load.
Runtime verification gated on the NebulaStream test harness.

Coverage: 27 of 27 cells (100 %), with 18 FULL and 9 PARTIAL annotated
explicitly per Q. Path to FULL for the 9 PARTIAL cells is one
MobilityNebula C++ PhysicalFunction class each (or a NebulaStream
upstream stream-self-join), documented in
docs/berlinmod-streaming-forms.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants