r4pm 0.3.1__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {r4pm-0.3.1 → r4pm-0.4.0}/Cargo.lock +3 -3
- {r4pm-0.3.1 → r4pm-0.4.0}/Cargo.toml +1 -1
- {r4pm-0.3.1 → r4pm-0.4.0}/PKG-INFO +9 -9
- {r4pm-0.3.1 → r4pm-0.4.0}/README.md +8 -8
- {r4pm-0.3.1 → r4pm-0.4.0}/pyproject.toml +3 -1
- {r4pm-0.3.1 → r4pm-0.4.0}/r4pm/__init__.py +5 -16
- {r4pm-0.3.1 → r4pm-0.4.0}/r4pm/__init__.pyi +3 -117
- r4pm-0.4.0/r4pm/df/__init__.py +20 -0
- r4pm-0.4.0/r4pm/df/__init__.pyi +116 -0
- {r4pm-0.3.1/r4pm → r4pm-0.4.0/r4pm/df}/ocel_export.py +1 -1
- {r4pm-0.3.1/r4pm → r4pm-0.4.0/r4pm/df}/ocel_import.py +1 -1
- {r4pm-0.3.1/r4pm → r4pm-0.4.0/r4pm/df}/xes_export.py +1 -1
- {r4pm-0.3.1/r4pm → r4pm-0.4.0/r4pm/df}/xes_import.py +1 -1
- r4pm-0.4.0/simple_example.ipynb +206 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/src/ocel/from_dataframe.rs +0 -12
- {r4pm-0.3.1 → r4pm-0.4.0}/test_all.py +4 -4
- r4pm-0.3.1/simple_example.ipynb +0 -290
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python310.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python311.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python312.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python313.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python314.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python37.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python38.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.github/workflows/python39.yml +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/.gitignore +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/LICENSE-APACHE +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/LICENSE-MIT +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/build.rs +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/example.py +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/r4pm/py.typed +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/src/lib.rs +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/src/ocel/mod.rs +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/src/ocel/to_dataframe.rs +0 -0
- {r4pm-0.3.1 → r4pm-0.4.0}/test.xes +0 -0
|
@@ -1338,7 +1338,7 @@ dependencies = [
|
|
|
1338
1338
|
[[package]]
|
|
1339
1339
|
name = "macros_process_mining"
|
|
1340
1340
|
version = "0.1.0"
|
|
1341
|
-
source = "git+https://github.com/aarkue/rust4pm?branch=feat%2Foc-csv#
|
|
1341
|
+
source = "git+https://github.com/aarkue/rust4pm?branch=feat%2Foc-csv#8cd65e7d11534b150e3c94d5626f0090798bd1a5"
|
|
1342
1342
|
dependencies = [
|
|
1343
1343
|
"proc-macro2",
|
|
1344
1344
|
"quote",
|
|
@@ -2145,7 +2145,7 @@ dependencies = [
|
|
|
2145
2145
|
[[package]]
|
|
2146
2146
|
name = "process_mining"
|
|
2147
2147
|
version = "0.4.0"
|
|
2148
|
-
source = "git+https://github.com/aarkue/rust4pm?branch=feat%2Foc-csv#
|
|
2148
|
+
source = "git+https://github.com/aarkue/rust4pm?branch=feat%2Foc-csv#8cd65e7d11534b150e3c94d5626f0090798bd1a5"
|
|
2149
2149
|
dependencies = [
|
|
2150
2150
|
"chrono",
|
|
2151
2151
|
"csv",
|
|
@@ -2346,7 +2346,7 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|
|
2346
2346
|
|
|
2347
2347
|
[[package]]
|
|
2348
2348
|
name = "r4pm"
|
|
2349
|
-
version = "0.
|
|
2349
|
+
version = "0.4.0"
|
|
2350
2350
|
dependencies = [
|
|
2351
2351
|
"chrono",
|
|
2352
2352
|
"inventory",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: r4pm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -103,28 +103,28 @@ for item in r4pm.list_items():
|
|
|
103
103
|
|
|
104
104
|
## Simple Import/Export API
|
|
105
105
|
|
|
106
|
-
For direct DataFrame operations without the registry
|
|
106
|
+
For direct DataFrame operations without the registry, use the `df` submodule.
|
|
107
107
|
|
|
108
108
|
### XES
|
|
109
109
|
```python
|
|
110
110
|
import r4pm
|
|
111
111
|
|
|
112
112
|
# Import returns (DataFrame, log_attributes_json)
|
|
113
|
-
xes, attrs = r4pm.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
114
|
-
r4pm.export_xes(xes, "test_data/output.xes")
|
|
113
|
+
xes, attrs = r4pm.df.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
114
|
+
r4pm.df.export_xes(xes, "test_data/output.xes")
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
### OCEL
|
|
118
118
|
```python
|
|
119
119
|
# Returns dict with DataFrames: events, objects, relations, o2o, object_changes
|
|
120
|
-
ocel = r4pm.import_ocel("file.xml")
|
|
120
|
+
ocel = r4pm.df.import_ocel("file.xml")
|
|
121
121
|
print(ocel['events'].shape)
|
|
122
|
-
r4pm.export_ocel(ocel, "export.xml")
|
|
122
|
+
r4pm.df.export_ocel(ocel, "export.xml")
|
|
123
123
|
|
|
124
124
|
# PM4Py integration (requires pm4py)
|
|
125
|
-
ocel_pm4py = r4pm.import_ocel_pm4py("file.xml")
|
|
125
|
+
ocel_pm4py = r4pm.df.import_ocel_pm4py("file.xml")
|
|
126
126
|
print(ocel['events'].shape)
|
|
127
|
-
r4pm.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
127
|
+
r4pm.df.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
## Development
|
|
@@ -175,7 +175,7 @@ The test suite (`test_all.py`) covers:
|
|
|
175
175
|
- Automatic type conversion (positional & keyword arguments)
|
|
176
176
|
- Process discovery (DFG, OC-Declare)
|
|
177
177
|
- Registry operations (CRUD, DataFrames, export)
|
|
178
|
-
- Simple Import/Export DataFrame API
|
|
178
|
+
- Simple Import/Export DataFrame (`df`) API
|
|
179
179
|
- Edge cases and conversion caching
|
|
180
180
|
|
|
181
181
|
|
|
@@ -86,28 +86,28 @@ for item in r4pm.list_items():
|
|
|
86
86
|
|
|
87
87
|
## Simple Import/Export API
|
|
88
88
|
|
|
89
|
-
For direct DataFrame operations without the registry
|
|
89
|
+
For direct DataFrame operations without the registry, use the `df` submodule.
|
|
90
90
|
|
|
91
91
|
### XES
|
|
92
92
|
```python
|
|
93
93
|
import r4pm
|
|
94
94
|
|
|
95
95
|
# Import returns (DataFrame, log_attributes_json)
|
|
96
|
-
xes, attrs = r4pm.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
97
|
-
r4pm.export_xes(xes, "test_data/output.xes")
|
|
96
|
+
xes, attrs = r4pm.df.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
97
|
+
r4pm.df.export_xes(xes, "test_data/output.xes")
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
### OCEL
|
|
101
101
|
```python
|
|
102
102
|
# Returns dict with DataFrames: events, objects, relations, o2o, object_changes
|
|
103
|
-
ocel = r4pm.import_ocel("file.xml")
|
|
103
|
+
ocel = r4pm.df.import_ocel("file.xml")
|
|
104
104
|
print(ocel['events'].shape)
|
|
105
|
-
r4pm.export_ocel(ocel, "export.xml")
|
|
105
|
+
r4pm.df.export_ocel(ocel, "export.xml")
|
|
106
106
|
|
|
107
107
|
# PM4Py integration (requires pm4py)
|
|
108
|
-
ocel_pm4py = r4pm.import_ocel_pm4py("file.xml")
|
|
108
|
+
ocel_pm4py = r4pm.df.import_ocel_pm4py("file.xml")
|
|
109
109
|
print(ocel['events'].shape)
|
|
110
|
-
r4pm.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
110
|
+
r4pm.df.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
## Development
|
|
@@ -158,7 +158,7 @@ The test suite (`test_all.py`) covers:
|
|
|
158
158
|
- Automatic type conversion (positional & keyword arguments)
|
|
159
159
|
- Process discovery (DFG, OC-Declare)
|
|
160
160
|
- Registry operations (CRUD, DataFrames, export)
|
|
161
|
-
- Simple Import/Export DataFrame API
|
|
161
|
+
- Simple Import/Export DataFrame (`df`) API
|
|
162
162
|
- Edge cases and conversion caching
|
|
163
163
|
|
|
164
164
|
|
|
@@ -27,9 +27,11 @@ polars = [
|
|
|
27
27
|
features = ["pyo3/extension-module"]
|
|
28
28
|
# Include type stub files in the wheel
|
|
29
29
|
include = [
|
|
30
|
+
{ path = "r4pm/py.typed", format = "wheel" },
|
|
30
31
|
{ path = "r4pm/*.py", format = "wheel" },
|
|
31
32
|
{ path = "r4pm/*.pyi", format = "wheel" },
|
|
32
|
-
{ path = "r4pm/py
|
|
33
|
+
{ path = "r4pm/df/*.py", format = "wheel" },
|
|
34
|
+
{ path = "r4pm/df/*.pyi", format = "wheel" },
|
|
33
35
|
{ path = "r4pm/bindings/**/*.py", format = "wheel" },
|
|
34
36
|
{ path = "r4pm/bindings/**/*.pyi", format = "wheel" },
|
|
35
37
|
]
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
2
|
r4pm - Rust for process mining
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
- import_xes
|
|
6
|
-
- import_ocel_xml, import_ocel_json: OCEL2 object-centric logs
|
|
4
|
+
Simple DataFram API
|
|
5
|
+
- `df` with `import_xes`, `export_xes`, `import_ocel`, `import_ocel_pm4py`, etc.
|
|
7
6
|
|
|
8
7
|
Registry (for use with bindings):
|
|
9
8
|
- import_item, convert_item, export_item
|
|
@@ -15,19 +14,6 @@ Auto-generated bindings organized by module:
|
|
|
15
14
|
- Submodules: bindings.discovery, bindings.core, etc.
|
|
16
15
|
"""
|
|
17
16
|
|
|
18
|
-
from .xes_import import import_xes
|
|
19
|
-
from .xes_export import export_xes
|
|
20
|
-
from .ocel_import import (
|
|
21
|
-
import_ocel,
|
|
22
|
-
import_ocel_pm4py,
|
|
23
|
-
import_ocel_xml,
|
|
24
|
-
import_ocel_xml_pm4py,
|
|
25
|
-
import_ocel_json,
|
|
26
|
-
import_ocel_json_pm4py,
|
|
27
|
-
rs_ocel_to_pm4py
|
|
28
|
-
)
|
|
29
|
-
from .ocel_export import export_ocel, export_ocel_pm4py
|
|
30
|
-
|
|
31
17
|
from .r4pm import (
|
|
32
18
|
# Registry functions
|
|
33
19
|
import_item,
|
|
@@ -74,11 +60,14 @@ __all__ = [
|
|
|
74
60
|
# "export_xes_rs",
|
|
75
61
|
# "import_ocel_xml_rs",
|
|
76
62
|
# "import_ocel_json_rs",
|
|
63
|
+
# DataFrame submodule
|
|
64
|
+
"df",
|
|
77
65
|
# Bindings submodule
|
|
78
66
|
"bindings",
|
|
79
67
|
"__version__",
|
|
80
68
|
]
|
|
81
69
|
|
|
70
|
+
from . import df
|
|
82
71
|
# Import bindings submodule (auto-generated by build.rs during cargo build)
|
|
83
72
|
try:
|
|
84
73
|
from . import bindings
|
|
@@ -2,122 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
4
|
from typing import Any, Dict, List, Optional, Union
|
|
5
|
-
import polars as pl
|
|
6
|
-
|
|
7
|
-
# ============================================================================
|
|
8
|
-
# XES Import/Export
|
|
9
|
-
# ============================================================================
|
|
10
|
-
|
|
11
|
-
def import_xes(
|
|
12
|
-
path: str,
|
|
13
|
-
date_format: Optional[str] = None,
|
|
14
|
-
print_debug: Optional[bool] = None
|
|
15
|
-
) -> tuple[pl.DataFrame, str]:
|
|
16
|
-
"""
|
|
17
|
-
Import XES event log.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
path: Path to .xes or .xes.gz file
|
|
21
|
-
date_format: Optional date format for parsing (see chrono strftime)
|
|
22
|
-
print_debug: Enable debug output
|
|
23
|
-
|
|
24
|
-
Returns:
|
|
25
|
-
Tuple of (DataFrame with events, JSON string with log metadata)
|
|
26
|
-
"""
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
def export_xes(df: pl.DataFrame, path: str) -> None:
|
|
30
|
-
"""
|
|
31
|
-
Export DataFrame as XES file.
|
|
32
|
-
|
|
33
|
-
Args:
|
|
34
|
-
df: Polars DataFrame with event data
|
|
35
|
-
path: Output path (.xes or .xes.gz)
|
|
36
|
-
"""
|
|
37
|
-
...
|
|
38
|
-
|
|
39
|
-
# ============================================================================
|
|
40
|
-
# OCEL Import
|
|
41
|
-
# ============================================================================
|
|
42
|
-
|
|
43
|
-
def rs_ocel_to_pm4py(ocel_rs: Dict[str, pl.DataFrame]) -> Any:
|
|
44
|
-
"""
|
|
45
|
-
Convert Polars OCEL DataFrames to PM4PY OCEL object.
|
|
46
|
-
|
|
47
|
-
Args:
|
|
48
|
-
ocel_rs: Dict of DataFrames from import_ocel_xml/json
|
|
49
|
-
|
|
50
|
-
Returns:
|
|
51
|
-
PM4PY OCEL object
|
|
52
|
-
"""
|
|
53
|
-
...
|
|
54
|
-
|
|
55
|
-
def import_ocel_xml(path: str) -> Dict[str, pl.DataFrame]:
|
|
56
|
-
"""
|
|
57
|
-
Import OCEL2 from XML.
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
61
|
-
"""
|
|
62
|
-
...
|
|
63
|
-
|
|
64
|
-
def import_ocel_xml_pm4py(path: str) -> Any:
|
|
65
|
-
"""
|
|
66
|
-
Import OCEL2 XML and convert to PM4PY format.
|
|
67
|
-
"""
|
|
68
|
-
...
|
|
69
|
-
|
|
70
|
-
def import_ocel_json(path: str) -> Dict[str, pl.DataFrame]:
|
|
71
|
-
"""
|
|
72
|
-
Import OCEL2 from JSON.
|
|
73
|
-
|
|
74
|
-
Returns:
|
|
75
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
76
|
-
"""
|
|
77
|
-
...
|
|
78
|
-
|
|
79
|
-
def import_ocel_json_pm4py(path: str) -> Any:
|
|
80
|
-
"""
|
|
81
|
-
Import OCEL2 JSON and convert to PM4PY format.
|
|
82
|
-
"""
|
|
83
|
-
...
|
|
84
|
-
|
|
85
|
-
def import_ocel(path: str) -> dict[str, pl.DataFrame]:
|
|
86
|
-
"""
|
|
87
|
-
Import OCEL2 from File.
|
|
88
|
-
|
|
89
|
-
Returns:
|
|
90
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
91
|
-
"""
|
|
92
|
-
...
|
|
93
|
-
|
|
94
|
-
def import_ocel_pm4py(path: str):
|
|
95
|
-
"""Import OCEL2 JSON and convert to PM4PY format."""
|
|
96
|
-
...
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def export_ocel(ocel: dict[str, pl.DataFrame], path: str):
|
|
100
|
-
"""
|
|
101
|
-
Export Polars OCEL DataFrames to File
|
|
102
|
-
|
|
103
|
-
Args:
|
|
104
|
-
ocel: Dict of DataFrames from import_ocel_xml/json
|
|
105
|
-
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
106
|
-
|
|
107
|
-
"""
|
|
108
|
-
...
|
|
109
|
-
|
|
110
|
-
def export_ocel_pm4py(ocel, path: str):
|
|
111
|
-
"""
|
|
112
|
-
Export PM4Py OCEL to File
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
ocel: PM4Py OCEL object
|
|
116
|
-
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
117
|
-
|
|
118
|
-
"""
|
|
119
|
-
...
|
|
120
|
-
|
|
121
5
|
# ============================================================================
|
|
122
6
|
# Registry Functions
|
|
123
7
|
# ============================================================================
|
|
@@ -234,6 +118,8 @@ def call_binding(function_id: str, args_json: str) -> str:
|
|
|
234
118
|
# Bindings submodule (organized by Rust module structure)
|
|
235
119
|
from . import bindings as bindings
|
|
236
120
|
|
|
237
|
-
__all__: List[str]
|
|
238
121
|
|
|
122
|
+
from . import df as df
|
|
123
|
+
|
|
124
|
+
__all__: List[str]
|
|
239
125
|
__version__: str
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simple DataFrame API for r4pm
|
|
3
|
+
|
|
4
|
+
Import/Export:
|
|
5
|
+
- import_xes, export_xes: XES event logs
|
|
6
|
+
- import_ocel, import_ocel_pm4py, ...: OCEL2 object-centric logs
|
|
7
|
+
"""
|
|
8
|
+
from .ocel_import import (
|
|
9
|
+
import_ocel,
|
|
10
|
+
import_ocel_pm4py,
|
|
11
|
+
import_ocel_xml,
|
|
12
|
+
import_ocel_xml_pm4py,
|
|
13
|
+
import_ocel_json,
|
|
14
|
+
import_ocel_json_pm4py,
|
|
15
|
+
rs_ocel_to_pm4py
|
|
16
|
+
)
|
|
17
|
+
from .ocel_export import export_ocel, export_ocel_pm4py
|
|
18
|
+
|
|
19
|
+
from .xes_import import import_xes
|
|
20
|
+
from .xes_export import export_xes
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional
|
|
2
|
+
import polars as pl
|
|
3
|
+
|
|
4
|
+
# ============================================================================
|
|
5
|
+
# XES Import/Export
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
def import_xes(
|
|
9
|
+
path: str,
|
|
10
|
+
date_format: Optional[str] = None,
|
|
11
|
+
print_debug: Optional[bool] = None
|
|
12
|
+
) -> tuple[pl.DataFrame, str]:
|
|
13
|
+
"""
|
|
14
|
+
Import XES event log.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
path: Path to .xes or .xes.gz file
|
|
18
|
+
date_format: Optional date format for parsing (see chrono strftime)
|
|
19
|
+
print_debug: Enable debug output
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
Tuple of (DataFrame with events, JSON string with log metadata)
|
|
23
|
+
"""
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
def export_xes(df: pl.DataFrame, path: str) -> None:
|
|
27
|
+
"""
|
|
28
|
+
Export DataFrame as XES file.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
df: Polars DataFrame with event data
|
|
32
|
+
path: Output path (.xes or .xes.gz)
|
|
33
|
+
"""
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
# ============================================================================
|
|
37
|
+
# OCEL Import
|
|
38
|
+
# ============================================================================
|
|
39
|
+
|
|
40
|
+
def rs_ocel_to_pm4py(ocel_rs: Dict[str, pl.DataFrame]) -> Any:
|
|
41
|
+
"""
|
|
42
|
+
Convert Polars OCEL DataFrames to PM4PY OCEL object.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
ocel_rs: Dict of DataFrames from import_ocel_xml/json
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
PM4PY OCEL object
|
|
49
|
+
"""
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
def import_ocel_xml(path: str) -> Dict[str, pl.DataFrame]:
|
|
53
|
+
"""
|
|
54
|
+
Import OCEL2 from XML.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
58
|
+
"""
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
def import_ocel_xml_pm4py(path: str) -> Any:
|
|
62
|
+
"""
|
|
63
|
+
Import OCEL2 XML and convert to PM4PY format.
|
|
64
|
+
"""
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
def import_ocel_json(path: str) -> Dict[str, pl.DataFrame]:
|
|
68
|
+
"""
|
|
69
|
+
Import OCEL2 from JSON.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
73
|
+
"""
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
def import_ocel_json_pm4py(path: str) -> Any:
|
|
77
|
+
"""
|
|
78
|
+
Import OCEL2 JSON and convert to PM4PY format.
|
|
79
|
+
"""
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
def import_ocel(path: str) -> dict[str, pl.DataFrame]:
|
|
83
|
+
"""
|
|
84
|
+
Import OCEL2 from File.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
88
|
+
"""
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
def import_ocel_pm4py(path: str):
|
|
92
|
+
"""Import OCEL2 JSON and convert to PM4PY format."""
|
|
93
|
+
...
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def export_ocel(ocel: dict[str, pl.DataFrame], path: str):
|
|
97
|
+
"""
|
|
98
|
+
Export Polars OCEL DataFrames to File
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
ocel: Dict of DataFrames from import_ocel_xml/json
|
|
102
|
+
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
103
|
+
|
|
104
|
+
"""
|
|
105
|
+
...
|
|
106
|
+
|
|
107
|
+
def export_ocel_pm4py(ocel, path: str):
|
|
108
|
+
"""
|
|
109
|
+
Export PM4Py OCEL to File
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
ocel: PM4Py OCEL object
|
|
113
|
+
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
114
|
+
|
|
115
|
+
"""
|
|
116
|
+
...
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"metadata": {},
|
|
6
|
+
"source": [
|
|
7
|
+
"# r4pm - Process Mining Bindings\n",
|
|
8
|
+
"\n",
|
|
9
|
+
"This notebook demonstrates the key features of r4pm:\n",
|
|
10
|
+
"- Auto-generated bindings with full IDE support\n",
|
|
11
|
+
"- Automatic type conversion (no manual conversion needed!)\n",
|
|
12
|
+
"- Registry-based data management\n",
|
|
13
|
+
"- Fast XES/OCEL import/export"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"cell_type": "markdown",
|
|
18
|
+
"metadata": {},
|
|
19
|
+
"source": [
|
|
20
|
+
"## 1. Basic Example: Automatic Type Conversion\n",
|
|
21
|
+
"\n",
|
|
22
|
+
"The key feature - pass any data type to functions, conversion happens automatically!"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"cell_type": "code",
|
|
27
|
+
"execution_count": null,
|
|
28
|
+
"metadata": {},
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"source": [
|
|
31
|
+
"import r4pm.bindings as bindings\n",
|
|
32
|
+
"import r4pm\n",
|
|
33
|
+
"\n",
|
|
34
|
+
"# Load an OCEL file - returns a registry ID\n",
|
|
35
|
+
"ocel_id = r4pm.import_item('OCEL', 'test_data/order-management.xml')\n",
|
|
36
|
+
"print(f\"✓ Loaded OCEL: {ocel_id[:20]}...\")\n",
|
|
37
|
+
"\n",
|
|
38
|
+
"# Use it directly - automatic conversion!\n",
|
|
39
|
+
"# num_events expects IndexLinkedOCEL, but we pass OCEL - it converts automatically\n",
|
|
40
|
+
"num = bindings.num_events(ocel=ocel_id)\n",
|
|
41
|
+
"print(f\"✅ Number of events: {num}\")\n",
|
|
42
|
+
"\n",
|
|
43
|
+
"# Check registry - now has 2 items (original + converted)\n",
|
|
44
|
+
"items = r4pm.list_items()\n",
|
|
45
|
+
"print(f\"\\n📋 Registry now has {len(items)} items:\")\n",
|
|
46
|
+
"for item in items:\n",
|
|
47
|
+
" print(f\" {item['type']}: {item['id'][:30]}...\")"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"cell_type": "code",
|
|
52
|
+
"execution_count": null,
|
|
53
|
+
"metadata": {},
|
|
54
|
+
"outputs": [],
|
|
55
|
+
"source": [
|
|
56
|
+
"socel_id = r4pm.import_item('SlimLinkedOCEL', 'test_data/order-management.xml')\n",
|
|
57
|
+
"res = r4pm.bindings.discovery.object_centric.oc_declare.discover_oc_declare(socel_id)\n",
|
|
58
|
+
"print(f\"\\n🔍 OC-Declare discovery result:\\n{res}\")"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"cell_type": "markdown",
|
|
63
|
+
"metadata": {},
|
|
64
|
+
"source": [
|
|
65
|
+
"## 2. Process Discovery\n",
|
|
66
|
+
"\n",
|
|
67
|
+
"All discovery algorithms work with automatic conversion"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"cell_type": "code",
|
|
72
|
+
"execution_count": null,
|
|
73
|
+
"metadata": {},
|
|
74
|
+
"outputs": [],
|
|
75
|
+
"source": [
|
|
76
|
+
"# DFG from OCEL (auto-converts to IndexLinkedOCEL)\n",
|
|
77
|
+
"dfg = bindings.discover_dfg_from_locel(ocel_id)\n",
|
|
78
|
+
"object_types = list(dfg['object_type_to_dfg'].keys())\n",
|
|
79
|
+
"print(f\"✓ DFG for {len(object_types)} object types: {', '.join(object_types)}\")\n",
|
|
80
|
+
"\n",
|
|
81
|
+
"# OC-Declare (needs SlimLinkedOCEL - load directly)\n",
|
|
82
|
+
"slim_id = r4pm.import_item('SlimLinkedOCEL', 'test_data/order-management.xml')\n",
|
|
83
|
+
"options = {\n",
|
|
84
|
+
" \"noise_threshold\": 0.0,\n",
|
|
85
|
+
" \"o2o_mode\": \"None\",\n",
|
|
86
|
+
" \"counts_for_generation\": [1, None],\n",
|
|
87
|
+
" \"counts_for_filter\": [1, None],\n",
|
|
88
|
+
" \"reduction\": \"None\",\n",
|
|
89
|
+
" \"refinement\": False,\n",
|
|
90
|
+
" \"considered_arrow_types\": [\"AS\"]\n",
|
|
91
|
+
"}\n",
|
|
92
|
+
"constraints = bindings.discover_oc_declare(slim_id, options)\n",
|
|
93
|
+
"print(f\"✓ Discovered {len(constraints)} OC-Declare constraints\")"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"cell_type": "markdown",
|
|
98
|
+
"metadata": {},
|
|
99
|
+
"source": [
|
|
100
|
+
"## 3. Registry Operations\n",
|
|
101
|
+
"\n",
|
|
102
|
+
"Manual conversion and export when needed"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"cell_type": "code",
|
|
107
|
+
"execution_count": null,
|
|
108
|
+
"metadata": {},
|
|
109
|
+
"outputs": [],
|
|
110
|
+
"source": [
|
|
111
|
+
"# Get as DataFrames\n",
|
|
112
|
+
"ocel_dfs = r4pm.item_to_df(ocel_id)\n",
|
|
113
|
+
"print(f\"✓ DataFrames: {list(ocel_dfs.keys())}\")\n",
|
|
114
|
+
"print(f\" Events: {ocel_dfs['events'].shape}\")\n",
|
|
115
|
+
"print(f\" Objects: {ocel_dfs['objects'].shape}\")\n",
|
|
116
|
+
"\n",
|
|
117
|
+
"# Export to file\n",
|
|
118
|
+
"r4pm.export_item(ocel_id, \"test_data/output.xml\")\n",
|
|
119
|
+
"print(f\"\\n✓ Exported OCEL XML\")\n",
|
|
120
|
+
"r4pm.export_item(ocel_id, \"test_data/output.json\")\n",
|
|
121
|
+
"print(f\"\\n✓ Exported OCEL JSON\")\n",
|
|
122
|
+
"\n",
|
|
123
|
+
"# Clean up\n",
|
|
124
|
+
"for item in r4pm.list_items():\n",
|
|
125
|
+
" r4pm.remove_item(item['id'])\n",
|
|
126
|
+
"print(\"✓ Registry cleaned\")"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"cell_type": "code",
|
|
131
|
+
"execution_count": null,
|
|
132
|
+
"metadata": {},
|
|
133
|
+
"outputs": [],
|
|
134
|
+
"source": []
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"cell_type": "markdown",
|
|
138
|
+
"metadata": {},
|
|
139
|
+
"source": [
|
|
140
|
+
"## 4. Simple Import/Export API - Direct DataFrame Import\n",
|
|
141
|
+
"\n",
|
|
142
|
+
"For direct DataFrame operations without registry"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"cell_type": "code",
|
|
147
|
+
"execution_count": null,
|
|
148
|
+
"metadata": {},
|
|
149
|
+
"outputs": [],
|
|
150
|
+
"source": [
|
|
151
|
+
"# XES import - returns (DataFrame, attributes_json)\n",
|
|
152
|
+
"xes, attrs = r4pm.df.import_xes(\"test_data/Sepsis Cases - Event Log.xes.gz\")\n",
|
|
153
|
+
"print(f\"✓ XES shape: {xes.shape}\")\n",
|
|
154
|
+
"\n",
|
|
155
|
+
"# OCEL import - returns dict of DataFrames\n",
|
|
156
|
+
"ocel = r4pm.df.import_ocel_xml(\"test_data/order-management.xml\")\n",
|
|
157
|
+
"print(f\"✓ OCEL events: {ocel['events'].shape}\")\n",
|
|
158
|
+
"\n",
|
|
159
|
+
"# Export\n",
|
|
160
|
+
"r4pm.df.export_xes(xes, \"test_data/output.xes\")\n",
|
|
161
|
+
"print(\"✓ Exported XES\")"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"cell_type": "code",
|
|
166
|
+
"execution_count": null,
|
|
167
|
+
"metadata": {},
|
|
168
|
+
"outputs": [],
|
|
169
|
+
"source": [
|
|
170
|
+
"r4pm.bindings.test_some_inputs(\"Hello\",1,3,3.333,True)"
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"cell_type": "code",
|
|
175
|
+
"execution_count": null,
|
|
176
|
+
"metadata": {},
|
|
177
|
+
"outputs": [],
|
|
178
|
+
"source": [
|
|
179
|
+
"for f in r4pm.list_bindings():\n",
|
|
180
|
+
" print(f['name'])"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"metadata": {
|
|
185
|
+
"kernelspec": {
|
|
186
|
+
"display_name": "venv",
|
|
187
|
+
"language": "python",
|
|
188
|
+
"name": "python3"
|
|
189
|
+
},
|
|
190
|
+
"language_info": {
|
|
191
|
+
"codemirror_mode": {
|
|
192
|
+
"name": "ipython",
|
|
193
|
+
"version": 3
|
|
194
|
+
},
|
|
195
|
+
"file_extension": ".py",
|
|
196
|
+
"mimetype": "text/x-python",
|
|
197
|
+
"name": "python",
|
|
198
|
+
"nbconvert_exporter": "python",
|
|
199
|
+
"pygments_lexer": "ipython3",
|
|
200
|
+
"version": "3.13.7"
|
|
201
|
+
},
|
|
202
|
+
"orig_nbformat": 4
|
|
203
|
+
},
|
|
204
|
+
"nbformat": 4,
|
|
205
|
+
"nbformat_minor": 2
|
|
206
|
+
}
|
|
@@ -129,18 +129,6 @@ pub fn df_to_ocel(dfs: OCEL2DataFramesRef) -> Result<OCEL, PolarsError> {
|
|
|
129
129
|
.map(|c| c.to_string())
|
|
130
130
|
.collect();
|
|
131
131
|
|
|
132
|
-
// Build column type lookups for proper OCEL type inference
|
|
133
|
-
let event_col_types: HashMap<String, String> = event_attr_cols
|
|
134
|
-
.iter()
|
|
135
|
-
.filter_map(|col| {
|
|
136
|
-
dfs.events
|
|
137
|
-
.column(col.as_str())
|
|
138
|
-
.ok()
|
|
139
|
-
.map(|c| (col.clone(), dtype_to_ocel_type(c.dtype())))
|
|
140
|
-
})
|
|
141
|
-
.collect();
|
|
142
|
-
|
|
143
|
-
|
|
144
132
|
// Build E2O lookup: event_id -> [(object_id, qualifier)]
|
|
145
133
|
let mut e2o_map: HashMap<String, Vec<(String, String)>> = HashMap::new();
|
|
146
134
|
for i in 0..dfs.e2o.height() {
|
|
@@ -129,19 +129,19 @@ def test_simple_import_export_api():
|
|
|
129
129
|
print("="*60)
|
|
130
130
|
|
|
131
131
|
# XES import/export
|
|
132
|
-
xes, attrs = r4pm.import_xes('test.xes')
|
|
132
|
+
xes, attrs = r4pm.df.import_xes('test.xes')
|
|
133
133
|
print(f"✓ Imported XES: {xes.shape}")
|
|
134
134
|
|
|
135
|
-
r4pm.export_xes(xes, '/tmp/test-export.xes')
|
|
135
|
+
r4pm.df.export_xes(xes, '/tmp/test-export.xes')
|
|
136
136
|
print(f"✓ Exported XES")
|
|
137
137
|
|
|
138
138
|
# Verify round-trip
|
|
139
|
-
xes2, _ = r4pm.import_xes('/tmp/test-export.xes')
|
|
139
|
+
xes2, _ = r4pm.df.import_xes('/tmp/test-export.xes')
|
|
140
140
|
assert xes.shape == xes2.shape
|
|
141
141
|
print(f"✓ Round-trip successful")
|
|
142
142
|
|
|
143
143
|
# OCEL import
|
|
144
|
-
ocel = r4pm.import_ocel_xml('test_data/order-management.xml')
|
|
144
|
+
ocel = r4pm.df.import_ocel_xml('test_data/order-management.xml')
|
|
145
145
|
assert 'events' in ocel and 'objects' in ocel
|
|
146
146
|
print(f"✓ Imported OCEL: events={ocel['events'].shape}, objects={ocel['objects'].shape}")
|
|
147
147
|
print()
|
r4pm-0.3.1/simple_example.ipynb
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "markdown",
|
|
5
|
-
"metadata": {},
|
|
6
|
-
"source": [
|
|
7
|
-
"# r4pm - Process Mining Bindings\n",
|
|
8
|
-
"\n",
|
|
9
|
-
"This notebook demonstrates the key features of r4pm:\n",
|
|
10
|
-
"- Auto-generated bindings with full IDE support\n",
|
|
11
|
-
"- Automatic type conversion (no manual conversion needed!)\n",
|
|
12
|
-
"- Registry-based data management\n",
|
|
13
|
-
"- Fast XES/OCEL import/export"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"cell_type": "markdown",
|
|
18
|
-
"metadata": {},
|
|
19
|
-
"source": [
|
|
20
|
-
"## 1. Basic Example: Automatic Type Conversion\n",
|
|
21
|
-
"\n",
|
|
22
|
-
"The key feature - pass any data type to functions, conversion happens automatically!"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"cell_type": "code",
|
|
27
|
-
"execution_count": 1,
|
|
28
|
-
"metadata": {},
|
|
29
|
-
"outputs": [
|
|
30
|
-
{
|
|
31
|
-
"name": "stdout",
|
|
32
|
-
"output_type": "stream",
|
|
33
|
-
"text": [
|
|
34
|
-
"✓ Loaded OCEL: b35cf526-4497-47f3-a...\n",
|
|
35
|
-
"✅ Number of events: 21008\n",
|
|
36
|
-
"\n",
|
|
37
|
-
"📋 Registry now has 2 items:\n",
|
|
38
|
-
" IndexLinkedOCEL: b35cf526-4497-47f3-a1da-3da056...\n",
|
|
39
|
-
" OCEL: b35cf526-4497-47f3-a1da-3da056...\n"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"source": [
|
|
44
|
-
"import r4pm.bindings as bindings\n",
|
|
45
|
-
"import r4pm\n",
|
|
46
|
-
"\n",
|
|
47
|
-
"# Load an OCEL file - returns a registry ID\n",
|
|
48
|
-
"ocel_id = r4pm.import_item('OCEL', 'test_data/order-management.xml')\n",
|
|
49
|
-
"print(f\"✓ Loaded OCEL: {ocel_id[:20]}...\")\n",
|
|
50
|
-
"\n",
|
|
51
|
-
"# Use it directly - automatic conversion!\n",
|
|
52
|
-
"# num_events expects IndexLinkedOCEL, but we pass OCEL - it converts automatically\n",
|
|
53
|
-
"num = bindings.num_events(ocel=ocel_id)\n",
|
|
54
|
-
"print(f\"✅ Number of events: {num}\")\n",
|
|
55
|
-
"\n",
|
|
56
|
-
"# Check registry - now has 2 items (original + converted)\n",
|
|
57
|
-
"items = r4pm.list_items()\n",
|
|
58
|
-
"print(f\"\\n📋 Registry now has {len(items)} items:\")\n",
|
|
59
|
-
"for item in items:\n",
|
|
60
|
-
" print(f\" {item['type']}: {item['id'][:30]}...\")"
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"cell_type": "code",
|
|
65
|
-
"execution_count": 2,
|
|
66
|
-
"metadata": {},
|
|
67
|
-
"outputs": [
|
|
68
|
-
{
|
|
69
|
-
"name": "stdout",
|
|
70
|
-
"output_type": "stream",
|
|
71
|
-
"text": [
|
|
72
|
-
"\n",
|
|
73
|
-
"🔍 OC-Declare discovery result:\n",
|
|
74
|
-
"[{'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'create package', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'DP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'DF', 'counts': [1, None], 'from': 'create package', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'employees', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'employees', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'DP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'DP', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'customers', 'type': 'Simple'}, {'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'DF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'customers', 'type': 'Simple'}, {'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'item out of stock', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'DF', 'counts': [1, None], 'from': 'send package', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [{'object_type': 'employees', 'type': 'Simple'}], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'place order', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'pay order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'reorder item'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'confirm order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'employees', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'item out of stock'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'confirm order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'package delivered'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'AS', 'counts': [1, None], 'from': 'pay order', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'package delivered', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'create package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'pick item'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'pick item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'send package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'products', 'type': 'Simple'}], 'each': [{'object_type': 'items', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'send package', 'label': {'all': [], 'any': [{'object_type': 'items', 'type': 'Simple'}], 'each': [{'object_type': 'products', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'payment reminder', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'orders', 'type': 'Simple'}]}, 'to': 'place order'}, {'arc_type': 'EF', 'counts': [1, None], 'from': 'reorder item', 'label': {'all': [], 'any': [], 'each': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}]}, 'to': 'create package'}, {'arc_type': 'EP', 'counts': [1, None], 'from': 'failed delivery', 'label': {'all': [{'object_type': 'items', 'type': 'Simple'}, {'object_type': 'products', 'type': 'Simple'}], 'any': [], 'each': [{'object_type': 'packages', 'type': 'Simple'}]}, 'to': 'create package'}]\n"
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"source": [
|
|
79
|
-
"socel_id = r4pm.import_item('SlimLinkedOCEL', 'test_data/order-management.xml')\n",
|
|
80
|
-
"res = r4pm.bindings.discovery.object_centric.oc_declare.discover_oc_declare(socel_id)\n",
|
|
81
|
-
"print(f\"\\n🔍 OC-Declare discovery result:\\n{res}\")"
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"cell_type": "markdown",
|
|
86
|
-
"metadata": {},
|
|
87
|
-
"source": [
|
|
88
|
-
"## 2. Process Discovery\n",
|
|
89
|
-
"\n",
|
|
90
|
-
"All discovery algorithms work with automatic conversion"
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"cell_type": "code",
|
|
95
|
-
"execution_count": 3,
|
|
96
|
-
"metadata": {},
|
|
97
|
-
"outputs": [
|
|
98
|
-
{
|
|
99
|
-
"name": "stdout",
|
|
100
|
-
"output_type": "stream",
|
|
101
|
-
"text": [
|
|
102
|
-
"✓ DFG for 6 object types: customers, employees, items, orders, packages, products\n",
|
|
103
|
-
"✓ Discovered 154 OC-Declare constraints\n"
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
"source": [
|
|
108
|
-
"# DFG from OCEL (auto-converts to IndexLinkedOCEL)\n",
|
|
109
|
-
"dfg = bindings.discover_dfg_from_locel(ocel_id)\n",
|
|
110
|
-
"object_types = list(dfg['object_type_to_dfg'].keys())\n",
|
|
111
|
-
"print(f\"✓ DFG for {len(object_types)} object types: {', '.join(object_types)}\")\n",
|
|
112
|
-
"\n",
|
|
113
|
-
"# OC-Declare (needs SlimLinkedOCEL - load directly)\n",
|
|
114
|
-
"slim_id = r4pm.import_item('SlimLinkedOCEL', 'test_data/order-management.xml')\n",
|
|
115
|
-
"options = {\n",
|
|
116
|
-
" \"noise_threshold\": 0.0,\n",
|
|
117
|
-
" \"o2o_mode\": \"None\",\n",
|
|
118
|
-
" \"counts_for_generation\": [1, None],\n",
|
|
119
|
-
" \"counts_for_filter\": [1, None],\n",
|
|
120
|
-
" \"reduction\": \"None\",\n",
|
|
121
|
-
" \"refinement\": False,\n",
|
|
122
|
-
" \"considered_arrow_types\": [\"AS\"]\n",
|
|
123
|
-
"}\n",
|
|
124
|
-
"constraints = bindings.discover_oc_declare(slim_id, options)\n",
|
|
125
|
-
"print(f\"✓ Discovered {len(constraints)} OC-Declare constraints\")"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"cell_type": "markdown",
|
|
130
|
-
"metadata": {},
|
|
131
|
-
"source": [
|
|
132
|
-
"## 3. Registry Operations\n",
|
|
133
|
-
"\n",
|
|
134
|
-
"Manual conversion and export when needed"
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"cell_type": "code",
|
|
139
|
-
"execution_count": 4,
|
|
140
|
-
"metadata": {},
|
|
141
|
-
"outputs": [
|
|
142
|
-
{
|
|
143
|
-
"name": "stdout",
|
|
144
|
-
"output_type": "stream",
|
|
145
|
-
"text": [
|
|
146
|
-
"✓ DataFrames: ['object_changes', 'events', 'o2o', 'objects', 'relations']\n",
|
|
147
|
-
" Events: (21008, 3)\n",
|
|
148
|
-
" Objects: (10840, 2)\n",
|
|
149
|
-
"\n",
|
|
150
|
-
"✓ Exported OCEL XML\n",
|
|
151
|
-
"\n",
|
|
152
|
-
"✓ Exported OCEL JSON\n",
|
|
153
|
-
"✓ Registry cleaned\n"
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"source": [
|
|
158
|
-
"# Get as DataFrames\n",
|
|
159
|
-
"ocel_dfs = r4pm.item_to_df(ocel_id)\n",
|
|
160
|
-
"print(f\"✓ DataFrames: {list(ocel_dfs.keys())}\")\n",
|
|
161
|
-
"print(f\" Events: {ocel_dfs['events'].shape}\")\n",
|
|
162
|
-
"print(f\" Objects: {ocel_dfs['objects'].shape}\")\n",
|
|
163
|
-
"\n",
|
|
164
|
-
"# Export to file\n",
|
|
165
|
-
"r4pm.export_item(ocel_id, \"test_data/output.xml\")\n",
|
|
166
|
-
"print(f\"\\n✓ Exported OCEL XML\")\n",
|
|
167
|
-
"r4pm.export_item(ocel_id, \"test_data/output.json\")\n",
|
|
168
|
-
"print(f\"\\n✓ Exported OCEL JSON\")\n",
|
|
169
|
-
"\n",
|
|
170
|
-
"# Clean up\n",
|
|
171
|
-
"for item in r4pm.list_items():\n",
|
|
172
|
-
" r4pm.remove_item(item['id'])\n",
|
|
173
|
-
"print(\"✓ Registry cleaned\")"
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"cell_type": "code",
|
|
178
|
-
"execution_count": null,
|
|
179
|
-
"metadata": {},
|
|
180
|
-
"outputs": [],
|
|
181
|
-
"source": []
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"cell_type": "markdown",
|
|
185
|
-
"metadata": {},
|
|
186
|
-
"source": [
|
|
187
|
-
"## 4. Simple Import/Export API - Direct DataFrame Import\n",
|
|
188
|
-
"\n",
|
|
189
|
-
"For direct DataFrame operations without registry"
|
|
190
|
-
]
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"cell_type": "code",
|
|
194
|
-
"execution_count": 5,
|
|
195
|
-
"metadata": {},
|
|
196
|
-
"outputs": [
|
|
197
|
-
{
|
|
198
|
-
"name": "stdout",
|
|
199
|
-
"output_type": "stream",
|
|
200
|
-
"text": [
|
|
201
|
-
"✓ XES shape: (15214, 32)\n",
|
|
202
|
-
"✓ OCEL events: (21008, 3)\n",
|
|
203
|
-
"✓ Exported XES\n"
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
"source": [
|
|
208
|
-
"# XES import - returns (DataFrame, attributes_json)\n",
|
|
209
|
-
"xes, attrs = r4pm.import_xes(\"test_data/Sepsis Cases - Event Log.xes.gz\")\n",
|
|
210
|
-
"print(f\"✓ XES shape: {xes.shape}\")\n",
|
|
211
|
-
"\n",
|
|
212
|
-
"# OCEL import - returns dict of DataFrames\n",
|
|
213
|
-
"ocel = r4pm.import_ocel_xml(\"test_data/order-management.xml\")\n",
|
|
214
|
-
"print(f\"✓ OCEL events: {ocel['events'].shape}\")\n",
|
|
215
|
-
"\n",
|
|
216
|
-
"# Export\n",
|
|
217
|
-
"r4pm.export_xes(xes, \"test_data/output.xes\")\n",
|
|
218
|
-
"print(\"✓ Exported XES\")"
|
|
219
|
-
]
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"cell_type": "code",
|
|
223
|
-
"execution_count": 6,
|
|
224
|
-
"metadata": {},
|
|
225
|
-
"outputs": [
|
|
226
|
-
{
|
|
227
|
-
"data": {
|
|
228
|
-
"text/plain": [
|
|
229
|
-
"'s=Hello,n=1,i=3,f=3.333,b=true'"
|
|
230
|
-
]
|
|
231
|
-
},
|
|
232
|
-
"execution_count": 6,
|
|
233
|
-
"metadata": {},
|
|
234
|
-
"output_type": "execute_result"
|
|
235
|
-
}
|
|
236
|
-
],
|
|
237
|
-
"source": [
|
|
238
|
-
"r4pm.bindings.test_some_inputs(\"Hello\",1,3,3.333,True)"
|
|
239
|
-
]
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"cell_type": "code",
|
|
243
|
-
"execution_count": 7,
|
|
244
|
-
"metadata": {},
|
|
245
|
-
"outputs": [
|
|
246
|
-
{
|
|
247
|
-
"name": "stdout",
|
|
248
|
-
"output_type": "stream",
|
|
249
|
-
"text": [
|
|
250
|
-
"discover_dfg\n",
|
|
251
|
-
"index_link_ocel\n",
|
|
252
|
-
"num_objects\n",
|
|
253
|
-
"test_some_inputs\n",
|
|
254
|
-
"num_events\n",
|
|
255
|
-
"discover_alpha+++\n",
|
|
256
|
-
"discover_oc-declare\n",
|
|
257
|
-
"discover_dfg_from_locel\n",
|
|
258
|
-
"log_to_activity_projection\n"
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
],
|
|
262
|
-
"source": [
|
|
263
|
-
"for f in r4pm.list_bindings():\n",
|
|
264
|
-
" print(f['name'])"
|
|
265
|
-
]
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
"metadata": {
|
|
269
|
-
"kernelspec": {
|
|
270
|
-
"display_name": "venv",
|
|
271
|
-
"language": "python",
|
|
272
|
-
"name": "python3"
|
|
273
|
-
},
|
|
274
|
-
"language_info": {
|
|
275
|
-
"codemirror_mode": {
|
|
276
|
-
"name": "ipython",
|
|
277
|
-
"version": 3
|
|
278
|
-
},
|
|
279
|
-
"file_extension": ".py",
|
|
280
|
-
"mimetype": "text/x-python",
|
|
281
|
-
"name": "python",
|
|
282
|
-
"nbconvert_exporter": "python",
|
|
283
|
-
"pygments_lexer": "ipython3",
|
|
284
|
-
"version": "3.13.7"
|
|
285
|
-
},
|
|
286
|
-
"orig_nbformat": 4
|
|
287
|
-
},
|
|
288
|
-
"nbformat": 4,
|
|
289
|
-
"nbformat_minor": 2
|
|
290
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|