Skip to content

Improved OCEL Import and Memory Usage + Misc Bug Fixes#57

Merged
aarkue merged 13 commits into
mainfrom
feat/ocel-import-export-traits-improved-memory
Jun 23, 2026
Merged

Improved OCEL Import and Memory Usage + Misc Bug Fixes#57
aarkue merged 13 commits into
mainfrom
feat/ocel-import-export-traits-improved-memory

Conversation

@aarkue

@aarkue aarkue commented Jun 17, 2026

Copy link
Copy Markdown
Owner

This PR makes multiple bundled changes, mainly improving OCEL import and export, memory improvements for the SlimLinkedOCEL, plus some new analysis (bindings) functions.

  • New ReadableOCEL and AppendableOCEL traits; OCEL exporters (CSV, XML, SQL, JSON) and the JSON importer are generic over them
  • SlimLinkedOCEL implements AppendableOCEL, with auto-declare types, auto-grow attributes, and value coercion via new OCELAttributeValue::try_coerce_to; misordered streams are buffered and resolved on finalize
  • import_ocel_json_into and import_ocel_xml_into stream JSON / XML directly into any AppendableOCEL (e.g., SlimLinkedOCEL) without materializing an OCEL first; SlimLinkedOCEL::import_from_* uses the streaming paths automatically
  • ReadableOCEL::iter_events_of_type / iter_objects_of_type (default filters; SlimLinkedOCEL overrides via per-type indices, avoiding a full scan per type in SQL export)
  • New OCELAttributeType::as_type_str returns &'static str (cheaper than to_type_string)
  • EventIndex / ObjectIndex are now u32-backed; into_inner returns u32 (Breaking)
  • SlimLinkedOCEL, SlimOCELEvent, SlimOCELObject no longer derive Deserialize (still serialize); construct via Importable or AppendableOCEL (Breaking)
  • SlimOCELEvent::relationships and SlimOCELObject::relationships are now Vec<(QualifierIdx, ObjectIndex)> (was Vec<(String, ObjectIndex)>); resolve qualifier strings via SlimLinkedOCEL::qualifier_str (Breaking)
  • CSV exporter streams rows instead of buffering all rows; tracks (time, object_id) pairs in a HashSet to skip redundant object-attribute rows
  • SlimLinkedOCEL::from_ocel now goes through AppendableOCEL, so it shares attribute coercion, schema-grow, and duplicate-id detection with the streaming import paths. Behavior changes: events/objects with attribute names not in the declared type schema grow the schema (before they were silently dropped); duplicate event/object ids are skipped with a warning (before they were kept but unreachable); references to undeclared types auto-create the type (before they were dropped with warning)
  • try_json_to_ocel returning Result<OCEL, serde_json::Error> added alongside the existing panicking json_to_ocel
  • SlimLinkedOCEL::get_o2o_rev_obs_of_obtype / get_e2o_rev_evs_of_evtype: qualifier-optional reverse-relation getters filtered by type
  • New public object-centric analysis functions (also exposed as bindings): per-event sojourn and synchronization times with optional top_k (analysis::object_centric::oc_performance), E2O (event_type, object_type) counts and source -> target conversion rate (analysis::object_centric::oc_statistics), and per-object-type directly-follows graph and activity-trace variants (discovery::object_centric::dfg / variants)
  • Fix SQL export/import of floats and timestamps: floats are written as DOUBLE PRECISION (full f64 precision) and timestamps as naive UTC (avoids a double-applied timezone offset); import maps DOUBLE / DOUBLE PRECISION columns back to float, so round-trips no longer drop float attributes
  • New direct dependency on hashbrown for the slim per-id hash tables

Comment thread process_mining/src/core/event_data/case_centric/dataframe/mod.rs Outdated

@cpitsch cpitsch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 just some small questions :)

Comment thread process_mining/src/core/event_data/case_centric/utils/activity_projection.rs Outdated
Comment thread process_mining/src/core/event_data/case_centric/utils/activity_projection.rs Outdated
Comment thread process_mining/src/core/event_data/case_centric/utils/activity_projection.rs Outdated
Comment thread process_mining/src/core/event_data/object_centric/dataframe/mod.rs Outdated
Comment thread process_mining/src/core/event_data/object_centric/appendable.rs Outdated

@cpitsch cpitsch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@aarkue
aarkue merged commit 7dfebba into main Jun 23, 2026
3 checks passed
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