pm4py.objects.ocel.util.ocel_to_dict_types_rel module#

pm4py.objects.ocel.util.ocel_to_dict_types_rel.apply(ocel: OCEL) Dict[str, Dict[str | Tuple[str, str], DataFrame]][source]#

Gets from an object-centric event log (OCEL) a dictionary associating to every event/object/e2o/o2o/change type a dataframe containing the associated information. This effectively splits the information of different event/object types in dense dataframes.

Running example:

import pm4py from pm4py.objects.ocel.util import ocel_to_dict_types_rel

ocel = pm4py.read_ocel(“tests/input_data/ocel/example_log.jsonocel”) dct_types_rel = ocel_to_dict_types_rel.apply(ocel)

# prints the dense dataframes for every event type of the log for evt, table in dct_types_rel[“ev_types”].items():

print(”

“)

print(evt) print(table)

ocel

Object-centric event log

dct_types_rel

Dictionary associating to every type the corresponding dense table.

Keys at the first level: - ev_types: pointing to the different event types of the object-centric event log - obj_types: pointing to the different object types of the object-centric event log - e2o: pointing to the different event-object relationships of the object-centric event log - o2o: pointing to the different object-object relationships of the object-centric event log - object_changes: pointing to temporal changes in the attributes of the different object types of an OCEL

Keys at the second level: - for “ev_types”, “obj_types” and “object_changes”: the name of the event/object type related to the dense table - for “e2o”: a tuple in which the first element is an event type, and the second element is an object type - for “o2o”: a tuple in which the two elements are interconnected object types

Value: a Pandas dataframe (dense table).