opyenxes.model package

Submodules

opyenxes.model.XAttributable module

class opyenxes.model.XAttributable.XAttributable(attribute=None)[source]

Bases: object

This class is implemented by all elements of the log hierarchy, which can be equipped with attributes

Parameters:attribute (XAttributeMap) – A XAttributeMap with the attribute for this class.
get_attributes()[source]

Retrieves the attributes set for this element.

Returns:A map of attributes.
Return type:XAttributeMap
get_extensions()[source]

Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself

Returns:A set of extensions
Return type:set(XExtension)
has_attributes()[source]

Checks for the existence of attributes

Returns:True if this element has any attributes; False otherwise.
Return type:bool
set_attributes(attributes)[source]

Sets the map of attributes for this element.

Parameters:attributes (XAttributeMap) – A map of attributes

opyenxes.model.XAttribute module

class opyenxes.model.XAttribute.XAttribute(key, extension=None)[source]

Bases: opyenxes.model.XAttributable.XAttributable

This class defines attributes used for describing meta-information about event log hierarchy elements. Attributes have a name (i.e., a key), which is string-based

Parameters:
  • key (str) – The key of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
compare_to(other)[source]

Helper method to compares this object with the specified object for order.

Parameters:other (XAttribute) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_extension()[source]

Retrieves the extension defining this attribute.

Returns:The extension of this attribute. May return null, if there is no extension defining this attribute.
Return type:XExtension or None
get_key()[source]

Retrieves the key, i.e. unique identifier, of this attribute

Returns:The key of this attribute, as a string.
Return type:str

opyenxes.model.XAttributeBoolean module

class opyenxes.model.XAttributeBoolean.XAttributeBoolean(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with boolean type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (bool) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeBoolean
compare_to(obj)[source]

Compares this object with the specified object for order.

Parameters:obj (XAttributeBoolean) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the boolean value of this attribute

Returns:Value of this attribute
Return type:bool
set_value(value)[source]

Assigns the boolean value of this attribute.

Parameters:value (bool) – Value of the attribute.

opyenxes.model.XAttributeCollection module

class opyenxes.model.XAttributeCollection.XAttributeCollection(key, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

This Class is implemented by all attribute that contain more attributes, for example list and container.

Parameters:
  • key (str) – The key of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
add_to_collection(attribute)[source]

Add attribute in the collection of this object.

Parameters:attribute (XAttribute) – The attribute to add in the collection
get_collection()[source]

Retrieves the list with the attribute of this object.

Returns:List of attributes
Return type:list(XAttribute)

opyenxes.model.XAttributeContainer module

class opyenxes.model.XAttributeContainer.XAttributeContainer(key, extension=None)[source]

Bases: opyenxes.model.XAttributeCollection.XAttributeCollection

Attribute with child attributes. Theses child attributes are not ordered.

Parameters:
  • key (str) – The key of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)

opyenxes.model.XAttributeContinuous module

class opyenxes.model.XAttributeContinuous.XAttributeContinuous(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with float type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (float) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeContinuous
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeContinuous) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the float value of this attribute

Returns:Value of this attribute
Return type:float
set_value(value)[source]

Assigns the float value of this attribute.

Parameters:value (float) – Value of the attribute.

opyenxes.model.XAttributeDiscrete module

class opyenxes.model.XAttributeDiscrete.XAttributeDiscrete(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with integer type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (int) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeDiscrete
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeDiscrete) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the integer value of this attribute

Returns:Value of this attribute
Return type:int
set_value(value)[source]

Assigns the integer value of this attribute.

Parameters:value (int) – Value of the attribute.

opyenxes.model.XAttributeID module

class opyenxes.model.XAttributeID.XAttributeID(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with ID type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (XID) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeID
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeID) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the ID value of this attribute

Returns:Value of this attribute
Return type:XID
set_value(value)[source]

Assigns the ID value of this attribute.

Parameters:value (XID) – Value of the attribute.

opyenxes.model.XAttributeList module

class opyenxes.model.XAttributeList.XAttributeList(key, extension=None)[source]

Bases: opyenxes.model.XAttributeCollection.XAttributeCollection

Attribute with child attributes. Theses child attributes are ordered.

Parameters:
  • key (str) – The key of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)

opyenxes.model.XAttributeLiteral module

class opyenxes.model.XAttributeLiteral.XAttributeLiteral(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with string type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (str) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeLiteral
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeDiscrete) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the string value of this attribute

Returns:Value of this attribute
Return type:str
set_value(value)[source]

Assigns the string value of this attribute.

Parameters:value (str) – Value of the attribute.

opyenxes.model.XAttributeMap module

class opyenxes.model.XAttributeMap.XAttributeMap(dictionary=None)[source]

Bases: dict

An attribute map is used to hold a set of attributes, indexed by their key strings, for event log hierarchy elements

Parameters:dictionary (dict or None) – Dictionary with attributes for add in this object.
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeMap
is_empty()[source]

Return if this map contains elements

Returns:Returns True if this map contains element, False otherwise.
Return type:bool

opyenxes.model.XAttributeTimestamp module

class opyenxes.model.XAttributeTimestamp.XAttributeTimestamp(key, value, extension=None)[source]

Bases: opyenxes.model.XAttribute.XAttribute

Attribute with datetime type value.

Parameters:
  • key (str) – The key of the attribute.
  • value (datetime or int) – The value of the attribute.
  • extension (XExtension or None) – The extension defining the attribute (set to None, if the attribute is not associated to an extension)
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XAttributeLiteral
compare_to(obj)[source]

Helper method to compares this object with the specified object for order.

Parameters:obj (XAttributeTimestamp) – the Object to be compared.
Returns:A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Return type:int
get_value()[source]

Retrieves the datetime value of this attribute

Returns:Value of this attribute
Return type:datetime
get_value_millis()[source]
set_value(value)[source]

Assigns the string value or datetime value of this attribute.

Parameters:value (datetime) – Value of the attribute.
set_value_millis(value)[source]

opyenxes.model.XElement module

class opyenxes.model.XElement.XElement(attribute={})[source]

Bases: opyenxes.model.XAttributable.XAttributable

This Class is implemented by all elements of an event log structure. It defines that all elements are attributable

Parameters:attribute (XAttributeMap) – A XAttributeMap with the attribute for this class.

opyenxes.model.XEvent module

class opyenxes.model.XEvent.XEvent(attributes=None, identity=None)[source]

Bases: opyenxes.model.XElement.XElement

An event is an element of an XES event log structure. Events are sequentially contained in traces. Events refer to something that has happened during the execution of a process, e.g. the execution of an activity.

Parameters:
  • attributes (XAttributeMap) – Map of attribute for the event.
  • identity (XID) – The unique id that represent this event.
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XEvent
get_id()[source]

Retrieves the id value of this event

Returns:id of this event
Return type:XID
set_id(idem)[source]

Assigns the id value of this event.

Parameters:idem (XID) – id of the event.

opyenxes.model.XLog module

class opyenxes.model.XLog.XLog(attributes)[source]

Bases: opyenxes.model.XElement.XElement, list

A log is an element of an XES event log structure. Logs are contained in archives. Any log is a list of traces. Logs represent a collection of traces, which are all representing executions of the same kind of process.

Parameters:attributes (XAttributeMap) – Map of attribute for the log.
append(p_object)[source]

Add only a trace object in the log.

Parameters:p_object (XTrace) – a Trace object to append for the log
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XLog
get_classifiers()[source]

This method returns the list of classifiers defined for this log. This list can be used for reading or writing, i.e., it must be supported to add further classifiers to this list.

Returns:The list of classifiers defined for this log.
Return type:list[XEventAttributeClassifier]
get_extensions()[source]

Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself

Returns:A set of extensions
Return type:set(XExtension)
get_features()[source]
Retrieves the features of the log for example version, encoding,
if have nested-attributes, etc
Returns:Dictionary with features
Return type:dict
get_global_event_attributes()[source]

This method returns a list of attributes which are global for all events, i.e. every event in the log is guaranteed to have these attributes.

Returns:List of ubiquitous trace attributes.
Return type:List[XAttribute]
get_global_trace_attributes()[source]

This method returns a list of attributes which are global for all traces, i.e. every trace in the log is guaranteed to have these attributes.

Returns:List of ubiquitous trace attributes.
Return type:List[XAttribute]
get_info(classifier)[source]

Returns the cached info for the given classifier, null if not available.

Parameters:classifier (XEventAttributeClassifier) – The given classifier
Returns:The cached info for the given classifier, null if not available
Return type:XLogInfo or None
set_features(key, values)[source]

Assigns the key with the value in de features dictionary.

Parameters:
  • key (str) – key of the feature.
  • values (Any) – data of that features
set_info(classifier, info)[source]

Adds the given info for the given classifier to the info cache.

Parameters:
  • classifier (XEventClassifier) – The given classifier.
  • info (XLogInfo) – The given info.

opyenxes.model.XTrace module

class opyenxes.model.XTrace.XTrace(attributes)[source]

Bases: opyenxes.model.XElement.XElement, list

A trace is an element of an XES event log structure. Traces are contained in logs. Any trace is a list of events. Traces describe sequences of events, as they have occurred during one execution of a process, in their given order.

Parameters:attributes (XAttributeMap) – Map of attribute for the trace.
append(p_object)[source]

Add only a event object in the log.

Parameters:p_object (XEvent) – a Event object to append for the log
clone()[source]

Creates and returns a copy of this object.

Returns:A clone of this instance.
Return type:XTrace
insert_ordered(event)[source]
Insert the event in an ordered manner, if timestamp information is
available in this trace.
Parameters:event (XEvent) – the event to be inserted.
Returns:index of the inserted event.
Return type:int

Module contents