Improved OCEL Import and Memory Usage + Misc Bug Fixes#57
Merged
Conversation
…memory-efficient import/export
…ub.com:aarkue/rust4pm into feat/ocel-import-export-traits-improved-memory
cpitsch
reviewed
Jun 18, 2026
cpitsch
reviewed
Jun 18, 2026
cpitsch
left a comment
Collaborator
There was a problem hiding this comment.
Looks good 👍 just some small questions :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes multiple bundled changes, mainly improving OCEL import and export, memory improvements for the SlimLinkedOCEL, plus some new analysis (bindings) functions.
ReadableOCELandAppendableOCELtraits; OCEL exporters (CSV, XML, SQL, JSON) and the JSON importer are generic over themSlimLinkedOCELimplementsAppendableOCEL, with auto-declare types, auto-grow attributes, and value coercion via newOCELAttributeValue::try_coerce_to; misordered streams are buffered and resolved onfinalizeimport_ocel_json_intoandimport_ocel_xml_intostream JSON / XML directly into anyAppendableOCEL(e.g.,SlimLinkedOCEL) without materializing anOCELfirst;SlimLinkedOCEL::import_from_*uses the streaming paths automaticallyReadableOCEL::iter_events_of_type/iter_objects_of_type(default filters;SlimLinkedOCELoverrides via per-type indices, avoiding a full scan per type in SQL export)OCELAttributeType::as_type_strreturns&'static str(cheaper thanto_type_string)EventIndex/ObjectIndexare nowu32-backed;into_innerreturnsu32(Breaking)SlimLinkedOCEL,SlimOCELEvent,SlimOCELObjectno longer deriveDeserialize(still serialize); construct viaImportableorAppendableOCEL(Breaking)SlimOCELEvent::relationshipsandSlimOCELObject::relationshipsare nowVec<(QualifierIdx, ObjectIndex)>(wasVec<(String, ObjectIndex)>); resolve qualifier strings viaSlimLinkedOCEL::qualifier_str(Breaking)(time, object_id)pairs in aHashSetto skip redundant object-attribute rowsSlimLinkedOCEL::from_ocelnow goes throughAppendableOCEL, 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_ocelreturningResult<OCEL, serde_json::Error>added alongside the existing panickingjson_to_ocelSlimLinkedOCEL::get_o2o_rev_obs_of_obtype/get_e2o_rev_evs_of_evtype: qualifier-optional reverse-relation getters filtered by typetop_k(analysis::object_centric::oc_performance), E2O(event_type, object_type)counts andsource -> targetconversion rate (analysis::object_centric::oc_statistics), and per-object-type directly-follows graph and activity-trace variants (discovery::object_centric::dfg/variants)DOUBLE PRECISION(full f64 precision) and timestamps as naive UTC (avoids a double-applied timezone offset); import mapsDOUBLE/DOUBLE PRECISIONcolumns back to float, so round-trips no longer drop float attributeshashbrownfor the slim per-id hash tables