backend.api.modules.log_skeleton_router

Contains the routes for handling log skeletons and related operations.

Attributes

Classes

Table

Type definition for a table structure.

Graph

Type definition for a graph structure.

EndpointReturnType

Type definition for the return type of the endpoint.

Functions

compute_log_skeleton() → Dict[str, str])

Computes the log skeleton and stores it.

get_equivalence(→ EndpointReturnType)

Retrieves the equivalence relations from the log skeleton.

get_equivalence_pql() → EndpointReturnType)

Retrieves the equivalence relations from the log skeleton via PQL.

get_always_after(→ EndpointReturnType)

Retrieves the always-after relations from the log skeleton.

get_always_after_pql() → EndpointReturnType)

Retrieves the always-after relations from the log skeleton via PQL.

get_always_before(→ EndpointReturnType)

Retrieves the always-before relations from the log skeleton.

get_always_before_pql() → EndpointReturnType)

Retrieves the always-before relations from the log skeleton via PQL.

get_never_together(→ EndpointReturnType)

Retrieves the never-together relations from the log skeleton.

get_never_together_pql() → EndpointReturnType)

Retrieves the never-together relations from the log skeleton via PQL.

get_directly_follows(→ EndpointReturnType)

Retrieves the directly-follows relations from the log skeleton.

get_directly_follows_pql() → EndpointReturnType)

Retrieves the directly-follows relations from the log skeleton via PQL.

get_activity_frequencies(→ EndpointReturnType)

Retrieves the activity frequencies from the log skeleton.

Module Contents

backend.api.modules.log_skeleton_router.router
backend.api.modules.log_skeleton_router.MODULE_NAME = 'log_skeleton'
class backend.api.modules.log_skeleton_router.Table

Bases: TypedDict

Type definition for a table structure.

headers: List[str]
rows: List[List[str]]
class backend.api.modules.log_skeleton_router.Graph

Bases: TypedDict

Type definition for a graph structure.

nodes: List[Dict[Literal['id'], str]]
edges: List[Dict[Literal['from', 'to', 'label'], str]]
class backend.api.modules.log_skeleton_router.EndpointReturnType

Bases: TypedDict

Type definition for the return type of the endpoint.

tables: List[Table]
graphs: List[Graph]
async backend.api.modules.log_skeleton_router.compute_log_skeleton(background_tasks: fastapi.BackgroundTasks, request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) Dict[str, str]

Computes the log skeleton and stores it.

The log skeleton is computed in the background and stored in the app state.

Parameters:
  • background_tasks – The background tasks object. This is used to schedule the computation of the log skeleton.

  • request – The FastAPI request object. This is used to access the application state via request.app.state.

  • celonis (optional) – The CelonisManager dependency injection. Defaults to Depends(get_celonis_connection).

Returns:

A dictionary containing the job ID of the scheduled task.

backend.api.modules.log_skeleton_router.get_equivalence(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the equivalence relations from the log skeleton.

Parameters:
  • job_id – The ID of the job for which to retrieve the equivalence relations.

  • request – The FastAPI request object.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_equivalence_pql(request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) EndpointReturnType

Retrieves the equivalence relations from the log skeleton via PQL.

Parameters:
  • request – The FastAPI request object.

  • celonis – The CelonisManager dependency injection.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_always_after(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the always-after relations from the log skeleton.

Returns:

A dictionary with a “tables” list and optional “graphs” list.

backend.api.modules.log_skeleton_router.get_always_after_pql(request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) EndpointReturnType

Retrieves the always-after relations from the log skeleton via PQL.

Parameters:
  • request – The FastAPI request object.

  • celonis – The CelonisManager dependency injection.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_always_before(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the always-before relations from the log skeleton.

backend.api.modules.log_skeleton_router.get_always_before_pql(request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) EndpointReturnType

Retrieves the always-before relations from the log skeleton via PQL.

Parameters:
  • request – The FastAPI request object.

  • celonis – The CelonisManager dependency injection.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_never_together(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the never-together relations from the log skeleton.

backend.api.modules.log_skeleton_router.get_never_together_pql(request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) EndpointReturnType

Retrieves the never-together relations from the log skeleton via PQL.

Parameters:
  • request – The FastAPI request object.

  • celonis – The CelonisManager dependency injection.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_directly_follows(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the directly-follows relations from the log skeleton.

backend.api.modules.log_skeleton_router.get_directly_follows_pql(request: fastapi.Request, celonis: backend.celonis_connection.celonis_connection_manager.CelonisConnectionManager = Depends(get_celonis_connection)) EndpointReturnType

Retrieves the directly-follows relations from the log skeleton via PQL.

Parameters:
  • request – The FastAPI request object.

  • celonis – The CelonisManager dependency injection.

Returns:

A JSON object with “tables” and “graphs” keys.

backend.api.modules.log_skeleton_router.get_activity_frequencies(job_id: str, request: fastapi.Request) EndpointReturnType

Retrieves the activity frequencies from the log skeleton.