ocelescope-module-filter 0.1.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.
- ocelescope_module_filter-0.1.0/PKG-INFO +35 -0
- ocelescope_module_filter-0.1.0/README.md +26 -0
- ocelescope_module_filter-0.1.0/pyproject.toml +21 -0
- ocelescope_module_filter-0.1.0/src/ocelescope_module_filter/__init__.py +0 -0
- ocelescope_module_filter-0.1.0/src/ocelescope_module_filter/models.py +58 -0
- ocelescope_module_filter-0.1.0/src/ocelescope_module_filter/module.py +19 -0
- ocelescope_module_filter-0.1.0/src/ocelescope_module_filter/routes.py +33 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: ocelescope-module-filter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ocelescope backend module providing basic filtering of OCELs
|
|
5
|
+
Requires-Dist: fastapi
|
|
6
|
+
Requires-Dist: ocelescope-backend
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# ocelescope-module-filter
|
|
11
|
+
|
|
12
|
+
The backend module providing basic filtering functionality for object-centric
|
|
13
|
+
event logs in Ocelescope.
|
|
14
|
+
|
|
15
|
+
This package provides the FastAPI routes consumed by the
|
|
16
|
+
[`@ocelescope/filter`](https://www.npmjs.com/package/@ocelescope/filter)
|
|
17
|
+
frontend module.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install ocelescope-module-filter
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The module registers itself with the host through the
|
|
26
|
+
`ocelescope_backend.modules` entry point and is discovered automatically once
|
|
27
|
+
[`ocelescope-backend`](../../ocelescope-backend) is running.
|
|
28
|
+
|
|
29
|
+
## About
|
|
30
|
+
|
|
31
|
+
Part of [Ocelescope](https://github.com/promi4s/ocelescope), a framework for
|
|
32
|
+
working with Object-Centric Event Logs developed at the Chair of Process and
|
|
33
|
+
Data Science (PADS), RWTH Aachen University.
|
|
34
|
+
|
|
35
|
+
📖 Documentation: <https://www.ocelescope.org>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ocelescope-module-filter
|
|
2
|
+
|
|
3
|
+
The backend module providing basic filtering functionality for object-centric
|
|
4
|
+
event logs in Ocelescope.
|
|
5
|
+
|
|
6
|
+
This package provides the FastAPI routes consumed by the
|
|
7
|
+
[`@ocelescope/filter`](https://www.npmjs.com/package/@ocelescope/filter)
|
|
8
|
+
frontend module.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install ocelescope-module-filter
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The module registers itself with the host through the
|
|
17
|
+
`ocelescope_backend.modules` entry point and is discovered automatically once
|
|
18
|
+
[`ocelescope-backend`](../../ocelescope-backend) is running.
|
|
19
|
+
|
|
20
|
+
## About
|
|
21
|
+
|
|
22
|
+
Part of [Ocelescope](https://github.com/promi4s/ocelescope), a framework for
|
|
23
|
+
working with Object-Centric Event Logs developed at the Chair of Process and
|
|
24
|
+
Data Science (PADS), RWTH Aachen University.
|
|
25
|
+
|
|
26
|
+
📖 Documentation: <https://www.ocelescope.org>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "ocelescope-module-filter"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Ocelescope backend module providing basic filtering of OCELs"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = ["fastapi", "ocelescope-backend"]
|
|
8
|
+
|
|
9
|
+
[project.entry-points."ocelescope_backend.modules"]
|
|
10
|
+
filterV1 = "ocelescope_module_filter.module:Filter"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = ["uv_build>=0.11.21,<0.12.0"]
|
|
15
|
+
build-backend = "uv_build"
|
|
16
|
+
|
|
17
|
+
[tool.uv]
|
|
18
|
+
package = true
|
|
19
|
+
|
|
20
|
+
[tool.uv.sources]
|
|
21
|
+
ocelescope-backend = { workspace = true }
|
|
File without changes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from typing import Annotated, Literal
|
|
2
|
+
|
|
3
|
+
from ocelescope_backend.app.modules import ModuleFilter
|
|
4
|
+
from pydantic import Field
|
|
5
|
+
|
|
6
|
+
from ocelescope import (
|
|
7
|
+
E2OCountFilter,
|
|
8
|
+
EventAttributeFilter,
|
|
9
|
+
EventTypeFilter,
|
|
10
|
+
O2OCountFilter,
|
|
11
|
+
ObjectAttributeFilter,
|
|
12
|
+
ObjectTypeFilter,
|
|
13
|
+
TimeFrameFilter,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class NativeFilterBase(ModuleFilter):
|
|
18
|
+
OcelescopeModuleSource = "FilterV1"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class NativeE2OCountFilter(NativeFilterBase, E2OCountFilter):
|
|
22
|
+
type: Literal["e2o_count"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class NativeO2OCountFilter(NativeFilterBase, O2OCountFilter):
|
|
26
|
+
type: Literal["o2o_count"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class NativeActivityFilter(NativeFilterBase, EventTypeFilter):
|
|
30
|
+
type: Literal["activity"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class NativeObjectTypeFilter(NativeFilterBase, ObjectTypeFilter):
|
|
34
|
+
type: Literal["object_type"]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class NativeEventAttributeFilter(NativeFilterBase, EventAttributeFilter):
|
|
38
|
+
type: Literal["event_attribute"]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class NativeObjectAttributeFilter(NativeFilterBase, ObjectAttributeFilter):
|
|
42
|
+
type: Literal["object_attribute"]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class NativeTimeFrameFilter(NativeFilterBase, TimeFrameFilter):
|
|
46
|
+
type: Literal["time_frame"]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
NativeFilter = Annotated[
|
|
50
|
+
NativeActivityFilter
|
|
51
|
+
| NativeObjectTypeFilter
|
|
52
|
+
| NativeTimeFrameFilter
|
|
53
|
+
| NativeEventAttributeFilter
|
|
54
|
+
| NativeObjectAttributeFilter
|
|
55
|
+
| NativeE2OCountFilter
|
|
56
|
+
| NativeO2OCountFilter,
|
|
57
|
+
Field(discriminator="type"),
|
|
58
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from fastapi import FastAPI
|
|
2
|
+
from ocelescope_backend.app.modules import Module, ModuleMeta
|
|
3
|
+
from packaging.version import Version
|
|
4
|
+
|
|
5
|
+
from ocelescope_module_filter.routes import router
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Filter(Module):
|
|
9
|
+
meta = ModuleMeta(key="filter", version=Version("1.0"))
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def create_app(cls) -> FastAPI:
|
|
13
|
+
app = FastAPI(
|
|
14
|
+
title="Filter", version=str(cls.meta.version), docs_url=None, redoc_url=None
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
app.include_router(router)
|
|
18
|
+
|
|
19
|
+
return app
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from typing import cast
|
|
2
|
+
|
|
3
|
+
from fastapi import APIRouter
|
|
4
|
+
from ocelescope_backend.app.dependencies import ApiSession
|
|
5
|
+
|
|
6
|
+
from ocelescope_module_filter.models import (
|
|
7
|
+
NativeFilter,
|
|
8
|
+
NativeFilterBase,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
router = APIRouter()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@router.get("/{ocel_id}/filter", operation_id="getFilter")
|
|
15
|
+
def getFilter(
|
|
16
|
+
ocel_id: str,
|
|
17
|
+
session: ApiSession,
|
|
18
|
+
) -> list[NativeFilter]:
|
|
19
|
+
|
|
20
|
+
native_filter_list = cast(
|
|
21
|
+
list[NativeFilter],
|
|
22
|
+
session.get_filter(ocel_id, NativeFilterBase.OcelescopeModuleSource),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
return native_filter_list
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@router.post("/{ocel_id}/filter", operation_id="setFilter")
|
|
29
|
+
def setFilter(ocel_id: str, body: list[NativeFilter], session: ApiSession):
|
|
30
|
+
return cast(
|
|
31
|
+
list[NativeFilter],
|
|
32
|
+
session.set_filter(ocel_id, NativeFilterBase.OcelescopeModuleSource, body),
|
|
33
|
+
)
|