Core
OCEL ¶
High-level wrapper for an OCEL 2.0 event log.
This class provides a structured access layer over a PM4PY OCEL instance. It exposes convenient managers for objects, events, E2O relations, O2O relations, and extensions. It also supports reading, writing, and filtering OCEL logs.
Attributes:
| Name | Type | Description |
|---|---|---|
ocel | OCEL | The underlying PM4PY OCEL object containing the raw OCEL data (events, objects, relations). |
meta | OCELMeta | Metadata associated with this OCEL instance, including file path, unique ID, and any additional user-defined information. |
extensions | ExtensionManager | Manages all loaded OCEL extensions and handles exporting of extension data. |
objects | ObjectsManager | Provides structured access to all object-related information such as types, attributes, and object tables. |
events | EventsManager | Provides structured access to event-level information such as activities, event attributes, and event tables. |
e2o | E2OManager | Manages event-to-object relations, including typed relations and qualifier-based summaries. |
o2o | O2OManager | Manages object-to-object relations, providing typed lookups and relation-count summaries. |
Source code in src/ocelescope/src/ocelescope/ocel/core/ocel.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
filter ¶
Apply a sequence of filters to this OCEL instance.
Filters are executed in sequence, and their boolean masks are merged to produce a refined subset of events and objects. A new OCEL instance is returned containing only the items that satisfy all filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline | list[BaseFilter] | A list of filter objects, each implementing a | required |
Returns:
| Name | Type | Description |
|---|---|---|
OCEL | OCEL | A new OCEL instance representing the filtered view of the log. |
Source code in src/ocelescope/src/ocelescope/ocel/core/ocel.py
read staticmethod ¶
Read an OCEL file (.jsonocel, .xmlocel, or .sqlite) from disk.
Automatically detects the file format based on extension and loads the OCEL into a structured wrapper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path | Path to the OCEL file on disk. | required |
meta | dict[str, Any] | Additional metadata to attach to the OCELMeta container. | {} |
Returns:
| Name | Type | Description |
|---|---|---|
OCEL | OCEL | A fully constructed OCEL wrapper instance. |
Source code in src/ocelescope/src/ocelescope/ocel/core/ocel.py
write ¶
Write the OCEL log and all registered extensions to disk.
The output format is inferred from the file extension. Supported file types are: - .jsonocel - .xmlocel - .sqlite
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path | Destination file path. | required |
Raises:
| Type | Description |
|---|---|
ValueError | If the file extension is not supported. |
Source code in src/ocelescope/src/ocelescope/ocel/core/ocel.py
OCELMeta dataclass ¶
Metadata for an OCEL instance.
Attributes:
| Name | Type | Description |
|---|---|---|
id | str | Unique identifier for this metadata/log instance. |
path | Path | None | Filesystem path from which this OCEL was loaded. |
extra | dict[str, Any] | Free-form metadata for user-defined fields. |