ocpa.objects.log package
Subpackages
Submodules
ocpa.objects.log.ocel module
Object-Centric Event Log
- class ocpa.objects.log.ocel.OCEL(log: ocpa.objects.log.variants.table.Table, obj: ocpa.objects.log.variants.obj.ObjectCentricEventLog, graph: ocpa.objects.log.variants.graph.EventGraph, parameters: Dict)
Bases:
objectCan be imported through the: 1)
CSV importer2)JSONOCEL importer3)JSONXML importerProperties are lazily instantiated upon calling their getter functions.
- get_object_attribute_value(o_id, attribute)
Returns the attribute value of an object attribute if the attribute table was provided.
The object id o_id refers to the object_id attribute of an object in the corresponding table that was passed. This function is the most efficient attribute value retrieval.
- Parameters
o_id (str) – object id of the targeted object
attribute (string) – attribute name of the targeted attribute, should be a column of the passed table
- Returns
any value
- Return type
anytype
- get_process_execution_graph(process_exec_id)
Returns the process execution graph of a process execution.
The process_exec_id refers to the index of the process execution in the list of process executions held by this class.
- Parameters
process_exec_id (int) – index of the targeted process execution
- Returns
process execution graph
- Return type
NetworkX Graph
- get_value(e_id, attribute)
Returns the attribute value of an event efficiently.
The event id e_id refers to the event_id attribute of an event, not the index of the event in the dataframe. This function is the most efficient attribute value retrieval.
- Parameters
e_id (int) – event id of the targeted event
attribute (string) – attribute name of the targeted attribute, should be a column of the initial dataframe (check event_ prefix)
- Returns
any value
- Return type
anytype
- property object_types
Stores the object types of the event log.
Set through the parameters in the import.
- Returns
list of object types
- Return type
list(str)
- parameters: Dict
- property process_execution_mappings
Storing the process executions of an event.
- Returns
Dictionary mapping events to the process executions that an event belong to, identified by their index in the process_execution list.
- Return type
Dict
- property process_execution_objects
Each process execution is identified by its index in the process_execution list. Using this index, one can retrieve this process execution’s associated objects through this list.
- Returns
List of the objects of an the executions. Equally indexed as the process_execution list.
- Return type
list(list(Tuple(string, string)))
- property process_executions
Stores the process executions (object-centric cases) of an object-centric event log. Each process execution is implicitly identified by its index in this list. At the corresponding index in this array, the events of the process execution are stored.
Process executions are extracted through the extraction technique in the parameters dict. These are probably already set in the import in one of the the importers:
CSV importerorJSONOCEL importerorJSONXML importer. Possible values for the parameter execution_extraction are:- Returns
List of process executions, where each process execution is a list of event ids
- Return type
list(list(int))
- property variant_frequencies
Each variant is identified by its index in the variants list. Using this index, one can retrieve this variants’s frequency through this list.
- Returns
List of the frequencies of the variants. Equally indexed as the variants list.
- Return type
list(float)
- property variant_graphs
Stores the graph of a variant.
- Returns
Dict mapping a variant identifier to this variant’s graph labeled with activity and object types
- Return type
Tuple(nx.DiGraph, list(Tuple(string, string)))
- property variants
Variants are calcuated through the variant calculation technique in the parameters dict. These are probably already set in the import in one of the the importers:
CSV importerorJSONOCEL importerorJSONXML importer. Possible values for the parameter variant_calculation are:- Returns
List of variants identified by a unique string
- Return type
list(str)
- property variants_dict
Stores the process_executions associated with a variant.
- Returns
Dict mapping a variant identifier to this variant’s process executions (as indexes of the process_execution list)
- Return type
Dict