Пример #1
0
    def __init__(self):
        super().__init__("Cost", "cost",
                         urlparse("http://www.xes-standard.org/cost.xesext"))
        factory = XFactoryRegistry().current_default()

        self.ATTR_TOTAL = factory.create_attribute_continuous(
            "cost:total", 0.0, self)
        self.ATTR_CURRENCY = factory.create_attribute_literal(
            "cost:currency", "UNKNOWN", self)
        self.ATTR_AMOUNT = factory.create_attribute_continuous(
            "cost:amount", 0.0, self)
        self.ATTR_DRIVER = factory.create_attribute_literal(
            "cost:driver", "UNKNOWN", self)
        self.ATTR_TYPE = factory.create_attribute_literal(
            "cost:type", "UNKNOWN", self)

        self.get_trace_attributes().add(self.ATTR_TOTAL.clone())
        self.get_trace_attributes().add(self.ATTR_CURRENCY.clone())
        self.get_event_attributes().add(self.ATTR_TOTAL.clone())
        self.get_event_attributes().add(self.ATTR_CURRENCY.clone())
        self.get_event_attributes().add(self.ATTR_AMOUNT.clone())
        self.get_event_attributes().add(self.ATTR_DRIVER.clone())
        self.get_event_attributes().add(self.ATTR_TYPE.clone())

        XGlobalAttributeNameMap().register_mapping("EN", "cost:total",
                                                   "Total Cost")
        XGlobalAttributeNameMap().register_mapping("EN", "cost:currency",
                                                   "Currency of Cost")
        XGlobalAttributeNameMap().register_mapping("EN", "cost:amount",
                                                   "Cost Amount")
        XGlobalAttributeNameMap().register_mapping("EN", "cost:driver",
                                                   "Cost Driver")
        XGlobalAttributeNameMap().register_mapping("EN", "cost:type",
                                                   "Cost Type")
Пример #2
0
 def __init__(self):
     super().__init__(
         "Lifecycle", "lifecycle",
         urlparse("http://www.xes-standard.org/lifecycle.xesext"))
     factory = XFactoryRegistry().current_default()
     self.ATTR_MODEL = factory.create_attribute_literal(
         "lifecycle:model", "standart", self)
     self.ATTR_TRANSITION = factory.create_attribute_literal(
         "lifecycle:transition", XLifecycleExtension.StandardModel.COMPLETE,
         self)
     self.get_log_attributes().add(self.ATTR_MODEL.clone())
     self.get_event_attributes().add(self.ATTR_TRANSITION.clone())
     XGlobalAttributeNameMap().register_mapping("EN", "lifecycle:model",
                                                "Lifecycle Model")
     XGlobalAttributeNameMap().register_mapping("EN",
                                                "lifecycle:transition",
                                                "Lifecycle Transition")
     XGlobalAttributeNameMap().register_mapping("DE", "lifecycle:model",
                                                "Lebenszyklus-Model")
     XGlobalAttributeNameMap().register_mapping("DE",
                                                "lifecycle:transition",
                                                "Lebenszyklus-Transition")
     XGlobalAttributeNameMap().register_mapping("FR", "lifecycle:model",
                                                "Modèle du Cycle Vital")
     XGlobalAttributeNameMap().register_mapping(
         "FR", "lifecycle:transition", "Transition en Cycle Vital")
     XGlobalAttributeNameMap().register_mapping("ES", "lifecycle:model",
                                                "Modelo de Ciclo de Vida")
     XGlobalAttributeNameMap().register_mapping(
         "ES", "lifecycle:transition", "Transición en Ciclo de Vida")
     XGlobalAttributeNameMap().register_mapping("PT", "lifecycle:model",
                                                "Modelo do Ciclo de Vida")
     XGlobalAttributeNameMap().register_mapping(
         "PT", "lifecycle:transition", "Transição do Ciclo de Vida")
Пример #3
0
 def __init__(self):
     super().__init__(
         "Concept", "concept",
         urlparse("http://www.xes-standard.org/concept.xesext"))
     factory = XFactoryRegistry().current_default()
     self.ATTR_NAME = factory.create_attribute_literal(
         "concept:name", "UNKNOWN", self)
     self.ATTR_INSTANCE = factory.create_attribute_literal(
         "concept:instance", "UNKNOWN", self)
     self.get_log_attributes().add(self.ATTR_NAME.clone())
     self.get_trace_attributes().add(self.ATTR_NAME.clone())
     self.get_event_attributes().add(self.ATTR_NAME.clone())
     self.get_event_attributes().add(self.ATTR_INSTANCE.clone())
     XGlobalAttributeNameMap().register_mapping("EN", "concept:name",
                                                "Name")
     XGlobalAttributeNameMap().register_mapping("EN", "concept:instance",
                                                "Instance")
     XGlobalAttributeNameMap().register_mapping("DE", "concept:name",
                                                "Name")
     XGlobalAttributeNameMap().register_mapping("DE", "concept:instance",
                                                "Instanz")
     XGlobalAttributeNameMap().register_mapping("FR", "concept:name",
                                                "Appellation")
     XGlobalAttributeNameMap().register_mapping("FR", "concept:instance",
                                                "Entité")
     XGlobalAttributeNameMap().register_mapping("ES", "concept:name",
                                                "Nombre")
     XGlobalAttributeNameMap().register_mapping("ES", "concept:instance",
                                                "Instancia")
     XGlobalAttributeNameMap().register_mapping("PT", "concept:name",
                                                "Nome")
     XGlobalAttributeNameMap().register_mapping("PT", "concept:instance",
                                                "Instância")
Пример #4
0
    def __init__(self):
        super().__init__(
            "Semantic", "semantic",
            urlparse("http://www.xes-standard.org/semantic.xesext"))
        factory = XFactoryRegistry().current_default()

        self.ATTR_MODELREFERENCE = factory.create_attribute_literal(
            "semantic:modelReference", "UNKNOWN", self)

        self.get_event_attributes().add(self.ATTR_MODELREFERENCE.clone())
        self.get_trace_attributes().add(self.ATTR_MODELREFERENCE.clone())
        self.get_log_attributes().add(self.ATTR_MODELREFERENCE.clone())
        self.get_meta_attributes().add(self.ATTR_MODELREFERENCE.clone())

        XGlobalAttributeNameMap().register_mapping("EN",
                                                   "semantic:modelReference",
                                                   "Ontology Model Reference")
        XGlobalAttributeNameMap().register_mapping("DE",
                                                   "semantic:modelReference",
                                                   "Ontologie-Modellreferenz")
        XGlobalAttributeNameMap().register_mapping(
            "FR", "semantic:modelReference", "Référence au Modèle Ontologique")
        XGlobalAttributeNameMap().register_mapping(
            "ES", "semantic:modelReference", "Referencia de Modelo Ontológico")
        XGlobalAttributeNameMap().register_mapping(
            "PT", "semantic:modelReference", "Referência de Modelo Ontológico")
Пример #5
0
 def __init__(self):
     super().__init__("Identity", "identity", urlparse("http://www.xes-standard.org/identity.xesext"))
     factory = XFactoryRegistry().current_default()
     self.ATTR_ID = factory.create_attribute_id("identity:id", XIDFactory.create_id(), self)
     self.get_log_attributes().add(self.ATTR_ID.clone())
     self.get_trace_attributes().add(self.ATTR_ID.clone())
     self.get_event_attributes().add(self.ATTR_ID.clone())
     self.get_meta_attributes().add(self.ATTR_ID.clone())
     XGlobalAttributeNameMap().register_mapping("EN", "identity:id", "Identity")
     XGlobalAttributeNameMap().register_mapping("DE", "identity:id", "Identität")
     XGlobalAttributeNameMap().register_mapping("FR", "identity:id", "Identité")
     XGlobalAttributeNameMap().register_mapping("ES", "identity:id", "Identidad")
     XGlobalAttributeNameMap().register_mapping("PT", "identity:id", "Identidade")
Пример #6
0
    def __init__(self):
        super().__init__("Time", "time",
                         urlparse("http://www.xes-standard.org/time.xesext"))
        factory = XFactoryRegistry().current_default()

        self.ATTR_TIMESTAMP = factory.create_attribute_timestamp(
            "time:timestamp", 0, self)

        self.get_event_attributes().add(self.ATTR_TIMESTAMP)

        XGlobalAttributeNameMap().register_mapping("EN", "time:timestamp",
                                                   "Timestamp")
        XGlobalAttributeNameMap().register_mapping("DE", "time:timestamp",
                                                   "Zeitstempel")
        XGlobalAttributeNameMap().register_mapping("FR", "time:timestamp",
                                                   "Horodateur")
        XGlobalAttributeNameMap().register_mapping("ES", "time:timestamp",
                                                   "Timestamp")
        XGlobalAttributeNameMap().register_mapping("PT", "time:timestamp",
                                                   "Timestamp")
Пример #7
0
    def __init__(self):
        super().__init__("Micro", "micro",
                         urlparse("http://www.xes-standard.org/micro.xesext"))
        factory = XFactoryRegistry().current_default()

        self.ATTR_LEVEL = factory.create_attribute_discrete(
            "micro:level", -1, self)
        self.ATTR_PID = factory.create_attribute_id("micro:parentId",
                                                    XIDFactory.create_id(),
                                                    self)
        self.ATTR_LENGTH = factory.create_attribute_discrete(
            "micro:length", -1, self)

        self.get_event_attributes().add(self.ATTR_LEVEL.clone())
        self.get_event_attributes().add(self.ATTR_PID.clone())
        self.get_event_attributes().add(self.ATTR_LENGTH.clone())

        XGlobalAttributeNameMap().register_mapping(
            "EN", "micro:level", "Micro level of this event")
        XGlobalAttributeNameMap().register_mapping(
            "EN", "micro:parentId", "Id of parent event of this event")
        XGlobalAttributeNameMap().register_mapping(
            "EN", "micro:length", "Number of child events for this event")
Пример #8
0
    def __init__(self):
        super().__init__("Organizational", "org", urlparse("http://www.xes-standard.org/org.xesext"))
        factory = XFactoryRegistry().current_default()

        self.ATTR_RESOURCE = factory.create_attribute_literal("org:resource", "UNKNOWN", self)
        self.ATTR_ROLE = factory.create_attribute_literal("org:role", "UNKNOWN", self)
        self.ATTR_GROUP = factory.create_attribute_literal("org:group", "UNKNOWN", self)

        self.get_event_attributes().add(self.ATTR_RESOURCE.clone())
        self.get_event_attributes().add(self.ATTR_ROLE.clone())
        self.get_event_attributes().add(self.ATTR_GROUP.clone())
        XGlobalAttributeNameMap().register_mapping("EN", "org:resource", "Resource")
        XGlobalAttributeNameMap().register_mapping("EN", "org:role", "Role")
        XGlobalAttributeNameMap().register_mapping("EN", "org:group", "Group")
        XGlobalAttributeNameMap().register_mapping("DE", "org:resource", "Akteur")
        XGlobalAttributeNameMap().register_mapping("DE", "org:role", "Rolle")
        XGlobalAttributeNameMap().register_mapping("DE", "org:group", "Gruppe")
        XGlobalAttributeNameMap().register_mapping("FR", "org:resource", "Agent")
        XGlobalAttributeNameMap().register_mapping("FR", "org:role", "Rôle")
        XGlobalAttributeNameMap().register_mapping("FR", "org:group", "Groupe")
        XGlobalAttributeNameMap().register_mapping("ES", "org:resource", "Recurso")
        XGlobalAttributeNameMap().register_mapping("ES", "org:role", "Papel")
        XGlobalAttributeNameMap().register_mapping("ES", "org:group", "Grupo")
        XGlobalAttributeNameMap().register_mapping("PT", "org:resource", "Recurso")
        XGlobalAttributeNameMap().register_mapping("PT", "org:role", "Papel")
        XGlobalAttributeNameMap().register_mapping("PT", "org:group", "Grupo")
Пример #9
0
        def startElement(self, name, attributes):
            """ Overrides startElement in class ContentHandler

            :param name:  Contains the raw XML 1.0 name of the element type
            :type name: str
            :param attributes: An instance of the Attributes class containing
             the attributes of the element
            :type attributes: xml.sax.xmlreader.AttributesImpl
            """
            tag_name = name

            if tag_name.lower() == "xesextension":
                mapping = attributes.getValue("name")
                name = attributes.getValue("prefix")
                x_uri = parse.urlparse(attributes.getValue("uri"))
                try:
                    request.urlopen(attributes.getValue("uri"))
                except error.URLError:
                    return

                self.__extension = XExtension(mapping, name, x_uri)

            elif tag_name.lower() == "log":
                self.__xAttributes = self.__extension.get_log_attributes()
            elif tag_name.lower() == "trace":
                self.__xAttributes = self.__extension.get_trace_attributes()
            elif tag_name.lower() == "event":
                self.__xAttributes = self.__extension.get_event_attributes()
            elif tag_name.lower() == "meta":
                self.__xAttributes = self.__extension.get_meta_attributes()

            elif tag_name.lower() == "string":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_literal(
                    mapping, "DEFAULT", self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif tag_name.lower() == "date":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_timestamp(
                    mapping, 0, self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif tag_name.lower() == "int":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_discrete(
                    mapping, 0, self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif tag_name.lower() == "float":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_continuous(
                    mapping, 0.0, self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif tag_name.lower() == "boolean":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_boolean(
                    mapping, False, self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif tag_name.lower() == "id":
                self.__xAttributes = self.__extension.get_log_attributes()
                mapping = self.__extension.get_prefix(
                ) + ':' + attributes.getValue("key")
                self.__currentAttribute = self.__factory.create_attribute_id(
                    mapping, XIDFactory.create_id(), self.__extension)
                self.__xAttributes.add(self.__currentAttribute)

            elif self.__currentAttribute is not None and tag_name.lower(
            ) == "alias":
                mapping = attributes.getValue("mapping")
                name = attributes.getValue("name")
                XGlobalAttributeNameMap().register_mapping(
                    mapping, self.__currentAttribute.get_key(), name)