pm4py.objects.ocel.util package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

Submodules#

pm4py.objects.ocel.util.attributes_names module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.attributes_names.get_attribute_names(ocel: OCEL, parameters: Dict[Any, Any] | None = None) List[str][source]#

Gets the list of attributes at the event and the object level of an object-centric event log (e.g. [“cost”, “amount”, “name”])

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm

Returns#

attributes_list

List of attributes at the event and object level (e.g. [“cost”, “amount”, “name”])

pm4py.objects.ocel.util.attributes_per_type module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.attributes_per_type.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ACTIVITY = 'param:event:activity'#
OBJECT_TYPE = 'param:object:type'#
pm4py.objects.ocel.util.attributes_per_type.get(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

pm4py.objects.ocel.util.convergence_divergence_diagnostics module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.convergence_divergence_diagnostics.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

Reports the activities and the object types for which the convergence / divergence problems occur.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm

Returns#

ret

Dictionary with two keys (“convergence” and “divergence”). Each key is associated to a set of (activity, object_type) for which the specific problem occurs. An activity/object type which does not appear neither in the “convergence” and “divergence” section does not suffer of convergence and divergence problems.

pm4py.objects.ocel.util.e2o_qualification module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.e2o_qualification.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

CONCATENER = 'concatener'#
CONCAT_COLUMN = 'concat_column'#
pm4py.objects.ocel.util.e2o_qualification.apply(ocel: OCEL, qualifier_type: str, parameters: Dict[Any, Any] | None = None) OCEL[source]#

pm4py.objects.ocel.util.ev_att_to_obj_type module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.ev_att_to_obj_type.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
EVENT_ACTIVITY = 'param:event:activity'#
EVENT_TIMESTAMP = 'param:event:timestamp'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
INTERNAL_INDEX = 'param:internal:index'#
pm4py.objects.ocel.util.ev_att_to_obj_type.apply(ocel: OCEL, param: str, parameters: Dict[Any, Any] | None = None)[source]#

Transforms an event attribute to an object type.

Parameters#

ocel

Object-centric event log

param

Event attribute that should be moved at the event level

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier column - Parameters.EVENT_ACTIVITY => the event activity column - Parameters.EVENT_TIMESTAMP => the event timestamp column - Parameters.OBJECT_ID => the object identifier column - Parameters.OBJECT_TYPE => the object type column - Parameters.INTERNAL_INDEX => the internal index

Returns#

new_ocel

OCEL in which the attribute has been moved to the object type level.

pm4py.objects.ocel.util.event_prefix_suffix_per_obj module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.event_prefix_suffix_per_obj.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

PREFIX_OR_SUFFIX = 'prefix_or_suffix'#
INDEX_ATTRIBUTE = 'index_attribute'#
LEFT_SUFFIX = 'left_suffix'#
RIGHT_SUFFIX = 'right_suffix'#
pm4py.objects.ocel.util.event_prefix_suffix_per_obj.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

Gets for each event and each one of the related objects, the prefix or the suffix. E.g. if there is an object “o1” with lifecycle “e1”, “e2”, “e3”, then:

The prefix of “e1” for “o1” is empty. The prefix of “e2” for “o1” is [“e1”]. The prefix of “e3” for “o1” is [“e1”, “e2”].

The suffix of “e1” for “o1” is [“e2”, “e3”]. The suffix of “e2” for “o1” is [“o3”]. The suffix of “e3” for “o1” is empty.

Parameters#

ocel

Object-centric event log

parameters
Parameters of the algorithm, including:
  • Parameters.PREFIX_OR_SUFFIX => establishes if the prefix or the suffix of the event per object is
    needed. Possible values:
    • “prefix”

    • “suffix”

  • Parameters.INDEX_ATTRIBUTE => the index attribute which is artificially inserted in the relations df.

  • Parameters.LEFT_SUFFIX => the suffix for the left-part of the merge.

  • Parameters.RIGHT_SUFFIX => the suffix for the right-part of the merge

Returns#

ret

A dictionary where the first key is the event, the second key is the object, and the value is a list of events which are the object-specific prefix or suffix of the event.

pm4py.objects.ocel.util.events_per_object_type module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.events_per_object_type.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.objects.ocel.util.events_per_object_type.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

Returns for each object type the number of events related to at least one object of the given type.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier - Parameters.OBJECT_TYPE => the object type column

Returns#

dictio

Dictionary associating to each object type the number of events related to at least one object of the given type.

pm4py.objects.ocel.util.events_per_type_per_activity module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.events_per_type_per_activity.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
EVENT_ACTIVITY = 'param:event:activity'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.objects.ocel.util.events_per_type_per_activity.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, float]][source]#

Provided statistics (mean, median, min, max) on the number of events of a given activity that are associated to objects of a given type.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier - Parameters.EVENT_ACTIVITY => the activity - Parameters.OBJECT_ID => the object identifier - Parameters.OBJECT_TYPE => the object type

Returns#

dictio

Dictionary in which the first key is the activity, the second key is the object type, and the value is a dictionary containing the statistic for the given activity and object type.

pm4py.objects.ocel.util.explode module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.explode.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Explode an OCEL: an event associated to N objects is “split” to N events, each one associated to one object.

Parameters#

ocel

Object-centric event log

parameters

Possible parameters of the algorithm

Returns#

ocel

Exploded object-centric event log

pm4py.objects.ocel.util.extended_table module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.extended_table.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

OBJECT_TYPE_PREFIX = 'param:object:type:prefix:extended'#
EVENT_ID = 'param:event:id'#
EVENT_ACTIVITY = 'param:event:activity'#
EVENT_TIMESTAMP = 'param:event:timestamp'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
INTERNAL_INDEX = 'param:internal:index'#
pm4py.objects.ocel.util.extended_table.parse_list(value)[source]#
pm4py.objects.ocel.util.extended_table.get_ocel_from_extended_table(df: DataFrame, objects_df: Dict[Any, Any] | None = None, parameters: Dict[Any, Any] | None = None) OCEL[source]#

pm4py.objects.ocel.util.filtering_utils module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.filtering_utils.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.objects.ocel.util.filtering_utils.propagate_event_filtering(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Propagates the filtering at the event level to the remaining parts of the OCEL structure (objects, relations)

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the column to be used as case identifier - Parameters.OBJECT_ID => the column to be used as object identifier - Parameters.OBJECT_TYPE => the column to be used as object type

Returns#

ocel

Object-centric event log with propagated filter

pm4py.objects.ocel.util.filtering_utils.propagate_object_filtering(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Propagates the filtering at the object level to the remaining parts of the OCEL structure (events, relations)

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the column to be used as case identifier - Parameters.OBJECT_ID => the column to be used as object identifier - Parameters.OBJECT_TYPE => the column to be used as object type

Returns#

ocel

Object-centric event log with propagated filter

pm4py.objects.ocel.util.filtering_utils.propagate_relations_filtering(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Propagates the filtering at the relations level to the remaining parts of the OCEL structure (events, objects)

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the column to be used as case identifier - Parameters.OBJECT_ID => the column to be used as object identifier - Parameters.OBJECT_TYPE => the column to be used as object type

Returns#

ocel

Object-centric event log with propagated filter

pm4py.objects.ocel.util.flattening module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.flattening.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ACTIVITY = 'param:event:activity'#
EVENT_TIMESTAMP = 'param:event:timestamp'#
pm4py.objects.ocel.util.flattening.flatten(ocel: OCEL, ot: str, parameters: Dict[Any, Any] | None = None) DataFrame[source]#

Flattens the object-centric event log to a traditional event log with the choice of an object type. In the flattened log, the objects of a given object type are the cases, and each case contains the set of events related to the object.

Parameters#

ocel

Object-centric event log

ot

Object type

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ACTIVITY - Parameters.EVENT_TIMESTAMP

Returns#

dataframe

Flattened log in the form of a Pandas dataframe

pm4py.objects.ocel.util.log_ocel module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.log_ocel.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

CASE_ID_KEY = 'pm4py:param:case_id_key'#
CASE_ATTRIBUTE_PREFIX = 'case:'#
ACTIVITY_KEY = 'pm4py:param:activity_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
TARGET_OBJECT_TYPE = 'target_object_type'#
TARGET_OBJECT_TYPE_2 = 'target_object_type_2'#
LEFT_INDEX = 'left_index'#
RIGHT_INDEX = 'right_index'#
DIRECTION = 'direction'#
pm4py.objects.ocel.util.log_ocel.from_traditional_log(log: EventLog, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Transforms an EventLog to an OCEL

Parameters#

log

Event log

parameters

Parameters of the algorithm, including: - Parameters.TARGET_OBJECT_TYPE => the name of the object type to which the cases should be mapped - Parameters.ACTIVITY_KEY => the attribute to use as activity - Parameters.TIMESTAMP_KEY => the attribute to use as timestamp - Parameters.CASE_ID_KEY => the attribute to use as case identifier

Returns#

ocel

OCEL (equivalent to the provided event log)

pm4py.objects.ocel.util.log_ocel.from_traditional_pandas(df: DataFrame, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Transforms a dataframe to an OCEL

Parameters#

df

Pandas dataframe

parameters

Parameters of the algorithm, including: - Parameters.TARGET_OBJECT_TYPE => the name of the object type to which the cases should be mapped - Parameters.ACTIVITY_KEY => the attribute to use as activity - Parameters.TIMESTAMP_KEY => the attribute to use as timestamp - Parameters.CASE_ID_KEY => the attribute to use as case identifier - Parameters.CASE_ATTRIBUTE_PREFIX => the prefix identifying the attributes at the case level

Returns#

ocel

OCEL (equivalent to the provided event log)

pm4py.objects.ocel.util.log_ocel.from_interleavings(df1: DataFrame, df2: DataFrame, interleavings: DataFrame, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Transforms a couple of dataframes, along with the interleavings between them, to an OCEL

Parameters#

df1

First of the two dataframes

df2

Second of the two dataframes

interleavings

Interleavings dataframe

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY => the attribute to use as activity - Parameters.TIMESTAMP_KEY => the attribute to use as timestamp - Parameters.CASE_ID_KEY => the attribute to use as case identifier - Parameters.CASE_ATTRIBUTE_PREFIX => the prefix identifying the attributes at the case level - Parameters.TARGET_OBJECT_TYPE => the name of the object type to which the cases of the first log should be mapped - Parameters.TARGET_OBJECT_TYPE_2 => the name of the object type to which the cases of the second log should be mapped - Parameters.LEFT_INDEX => the index column of the events of the first dataframe, in the interleavings dataframe - Parameters.RIGHT_INDEX => the index column of the events of the second dataframe, in the interleavings

dataframe.

  • Parameters.DIRECTION => the direction of the interleavings (LR or RL)

Returns#

ocel

OCEL (equivalent to the provided event log)

pm4py.objects.ocel.util.log_ocel.log_to_ocel_multiple_obj_types(log_obj: EventLog | EventStream | DataFrame, activity_column: str, timestamp_column: str, obj_types: Collection[str], obj_separator: str = ' AND ', additional_event_attributes: Collection[str] | None = None, additional_object_attributes: Dict[str, Collection[str]] | None = None) OCEL[source]#

Converts an event log to an object-centric event log with one or more than one object types.

Parameters#

log_obj

Log object

activity_column

Activity column

timestamp_column

Timestamp column

object_types

List of columns to consider as object types

obj_separator

Separator between different objects in the same column

additional_event_attributes

Additional attributes to be considered as event attributes in the OCEL

additional_object_attributes

Additional attributes per object type to be considered as object attributes in the OCEL (dictionary in which object types are associated to their attributes, i.e., {“order”: [“quantity”, “cost”], “invoice”: [“date”, “due date”]})

Returns#

ocel

Object-centric event log

pm4py.objects.ocel.util.names_stripping module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.names_stripping.apply(X: str, max_len: int = 100) str[source]#

pm4py.objects.ocel.util.objects_per_type_per_activity module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.objects_per_type_per_activity.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
EVENT_ACTIVITY = 'param:event:activity'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
pm4py.objects.ocel.util.objects_per_type_per_activity.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, float]][source]#

Provided statistics (mean, median, min, max) on the number of objects of a given type that are associated to events of a given activity.

Parameters#

ocel

Object-centric event log

parameters

Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier - Parameters.EVENT_ACTIVITY => the activity - Parameters.OBJECT_ID => the object identifier - Parameters.OBJECT_TYPE => the object type

Returns#

dictio

Dictionary in which the first key is the activity, the second key is the object type, and the value is a dictionary containing the statistic for the given activity and object type.

pm4py.objects.ocel.util.ocel_consistency module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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_consistency.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Forces the consistency of the OCEL, ensuring that the event/object identifier, event/object type are of type string and non-empty.

Parameters#

ocel

OCEL

parameters

Possible parameters of the method

Returns#

ocel

Consistent OCEL

pm4py.objects.ocel.util.ocel_iterator module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.ocel_iterator.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

OCEL_TYPE_PREFIX = 'param:object:type:prefix:extended'#
pm4py.objects.ocel.util.ocel_iterator.apply(ocel: OCEL, parameters: Dict[Any, Any] | None = None)[source]#

Creates an iterator over the events of an object-centric event log

Parameters#

ocel

OCEL

parameters

Parameters of the method, including: - Parameters.OCEL_TYPE_PREFIX => the prefix of the object types in the OCEL (default: ocel:type)

Returns#

yielded event

The events of the OCEL, one by one.

pm4py.objects.ocel.util.ocel_to_dict_types_rel module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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(”

“)

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

pm4py.objects.ocel.util.ocel_type_renaming module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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_type_renaming.remove_spaces_non_alphanumeric_characters_from_types(ocel: OCEL) OCEL[source]#

Creates a copy of the object-centric event log in which spaces and non-alphanumeric characters inside the event/object types are stripped

Parameters#

ocel

Object-centric event log

Returns#

ocel

Object-centric event log with stripped types

pm4py.objects.ocel.util.ocel_type_renaming.abbreviate_event_types(ocel: OCEL) OCEL[source]#

Creates a copy of the object-centric event log in which the event types are replaced by the letters of the alphabet (A being the most frequent event type, …). This is particularly useful to textually abstract the object-centric event log.

Parameters#

ocel

Object-centric event log

Returns#

ocel

Object-centric event log with alphabetical event types

pm4py.objects.ocel.util.parent_children_ref module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.parent_children_ref.apply(ocel: OCEL, child_obj_type: str, parent_obj_type: str, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Inserts an object attribute pointing to the parent of a child object, by looking at the related objects of the events of the log. This requires only the provision of the child object type and of the parent object type.

Parameters#

ocel

Object-centric event log

child_obj_type

Child object type (e.g. item)

parent_obj_type

Parent object type (e.g. parent)

parameters

Possible parameters of the algorithm

Returns#

ocel

Enriched object-centric event log

pm4py.objects.ocel.util.related_events module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.related_events.related_events_dct(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, List[str]]][source]#

pm4py.objects.ocel.util.related_objects module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.related_objects.related_objects_dct_per_type(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[str, List[str]]][source]#
pm4py.objects.ocel.util.related_objects.related_objects_dct_overall(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, List[str]][source]#

pm4py.objects.ocel.util.rename_objs_ot_tim_lex module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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.rename_objs_ot_tim_lex.apply(ocel: OCEL) OCEL[source]#

Rename objects given their object type, lifecycle start/end timestamps, and lexicographic order,

Parameters#

ocel

Object-centric event log

Returns#

renamed_ocel

Object-centric event log with renaming

pm4py.objects.ocel.util.sampling module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

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

class pm4py.objects.ocel.util.sampling.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

OBJECT_ID = 'param:object:id'#
EVENT_ID = 'param:event:id'#
NUM_ENTITIES = 'num_entities'#
pm4py.objects.ocel.util.sampling.sample_ocel_events(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Keeps a sample of the events of an object-centric event log

Parameters#

ocel

Object-centric event log

parameters
Parameters of the algorithm, including:
  • Parameters.EVENT_ID => event identifier

  • Parameters.NUM_ENTITIES => number of events

Returns#

sampled_ocel

Sampled object-centric event log

pm4py.objects.ocel.util.sampling.sample_ocel_objects(ocel: OCEL, parameters: Dict[Any, Any] | None = None) OCEL[source]#

Random samples the objects of the object-centric event log. Then, only the events related to at least one of these objects are filtered from the event log. As a note, the relationships between the different objects are probably going to be ruined by this sampling.

Parameters#

ocel

Object-centric event log

parameters
Parameters of the algorithm, including:
  • Parameters.OBJECT_ID => object identifier

  • Parameters.NUM_ENTITIES => number of objects to retain

Returns#

sampled_ocel

Sampled object-centric event log