pm4py.objects.ocel.util.ocel_to_dict_types_rel module#

PM4Py – A Process Mining Library for Python Copyright (C) 2026 Process Intelligence Solutions GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

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("\n")
    print(evt)
    print(table)
Parameters:

ocel (OCEL) – Object-centric event log.

Returns:

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).

Return type:

dict