Ex4pm.OCEL2 (ex4pm v26.9.9)

Copy Markdown View Source

OCEL 2.0 / Event-Knowledge-Graph-style semantics layered on top of the canonical Ex4pm.EventLog IR (Ex4pm.Event, Ex4pm.ObjectRef, Ex4pm.ObjectRelationship).

This module does not introduce a competing event/object representation — it derives EKG-shaped views (object traces, attribute-change history, qualifier-typed O2O edges) directly from the already-normalized %Ex4pm.EventLog{}, so every fact produced here stays traceable back to the canonical IR that Ex4pm.OCEL.normalize/1 admits.

Three capabilities:

  • object_trace/2 — the full, time-ordered event sequence for a single object id (an Event <-> Object many-to-many relation, recoverable from either side).
  • attribute_history/3 — the time-traceable value-change history for one dynamic object attribute, not just its current value.
  • object_relationships_for/2 — the qualifier-typed O2O edges touching one object, in either direction.

Summary

Functions

Returns the time-traceable change history for a single dynamic object attribute, reconstructed from every event in the object's trace that carries an updated value for attribute_name (looked up in the event's attributes map, falling back to the qualifier-scoped payload on the event's relationship for object_id when present).

Returns the qualifier-typed Object-to-Object relationships that touch object_id, in either direction (as source or as target), preserving the qualifier field on each %Ex4pm.ObjectRelationship{}-shaped map.

Returns the full ordered trace (event sequence) for a single object id: every event in log that references object_id via object_ids or an explicit relationship, sorted by {timestamp, id} the same way Ex4pm.OCEL.flatten/2 orders traces.

Functions

attribute_history(log, object_id, attribute_name)

Returns the time-traceable change history for a single dynamic object attribute, reconstructed from every event in the object's trace that carries an updated value for attribute_name (looked up in the event's attributes map, falling back to the qualifier-scoped payload on the event's relationship for object_id when present).

History is a chronologically ordered list of %Ex4pm.AttributeChange{}, one entry per event that actually changes the value (a repeated identical value does not add a new entry) — so the current value is always List.last(history).value, but the full history remains inspectable, unlike a plain current-value attribute map.

object_relationships_for(log, object_id)

Returns the qualifier-typed Object-to-Object relationships that touch object_id, in either direction (as source or as target), preserving the qualifier field on each %Ex4pm.ObjectRelationship{}-shaped map.

object_trace(log, object_id)

Returns the full ordered trace (event sequence) for a single object id: every event in log that references object_id via object_ids or an explicit relationship, sorted by {timestamp, id} the same way Ex4pm.OCEL.flatten/2 orders traces.