-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathREADME.txt
More file actions
73 lines (58 loc) · 2.53 KB
/
README.txt
File metadata and controls
73 lines (58 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
===========
XES
===========
This project is on Github: https://github.com/jsumrall/xes
This is a simple library which has methods for generating XES files.
With this library you will be able to take your raw event data and
generate an XES file with a standard header. From the XES-Standard web page,
"XES is an XML-based standard for event logs. Its purpose is to provide a
generally-acknowledged format for the interchange of event log data between
tools and application domains. Its primary purpose is for process mining,
i.e. the analysis of operational processes based on their event logs."
As usual, examples are the best way to see what this does.
Example usage looks like this::
#!/usr/bin/env python
import xes
traces = [
[
{"concept:name" : "Register", "org:resource" : "Bob"},
{"concept:name" : "Negotiate", "org:resource" : "Sally"},
{"concept:name" : "Negotiate", "org:resource" : "Sally"},
{"concept:name" : "Sign", "org:resource" : "Dan"},
{"concept:name" : "Sendoff", "org:resource" : "Mary"}
],
[
{"concept:name" : "Register", "org:resource" : "Bob"},
{"concept:name" : "Negotiate", "org:resource" : "Sally"},
{"concept:name" : "Sign", "org:resource" : "Dan"},
{"concept:name" : "Sendoff", "org:resource" : "Mary"}
],
[
{"concept:name" : "Register", "org:resource" : "Bob"},
{"concept:name" : "Negotiate", "org:resource" : "Sally"},
{"concept:name" : "Sign", "org:resource" : "Dan"},
{"concept:name" : "Negotiate", "org:resource" : "Sally"},
{"concept:name" : "Sendoff", "org:resource" : "Mary"}
],
[
{"concept:name" : "Register", "org:resource" : "Bob"},
{"concept:name" : "Sign", "org:resource" : "Dan"},
{"concept:name" : "Sendoff", "org:resource" : "Mary"}
]
]
log = xes.Log()
for trace in traces:
t = xes.Trace()
for event in trace:
e = xes.Event()
e.attributes = [
xes.Attribute(type="string", key="concept:name", value=event["concept:name"]),
xes.Attribute(type="string", key="org:resource", value=event["org:resource"])
]
t.add_event(e)
log.add_trace(t)
log.classifiers = [
xes.Classifier(name="org:resource",keys="org:resource"),
xes.Classifier(name="concept:name",keys="concept:name")
]
open("example.xes", "w").write(str(log))