Need help to read an xes File

Hello Community I tried to read a self-created xes file in r, but I get an error message

Error: Each row of output must be identified by a unique combination of keys.
Keys are shared for 30 rows:
* 106, 111, 116
* 133, 138, 143
* 105, 110, 115
* 132, 137, 142
* 104, 109, 114
* 131, 136, 141
* 107, 112, 117
* 134, 139, 144
* 108, 113, 118
* 135, 140, 145

Thank you for your time and your help

it would make sense to me, that your odds of getting help will be increased by providing a sample of your self created xes file, and also the code you are using to read it (i.e. the code that triggers the error you posted)

Good luck


I dont know how to share the whole xes- file here...

here a part of the xes-file..

<?xml version="1.0" encoding="UTF-8"?>
<log xes.version="1.0" xes.features="arbitrary-depth" openxes.version="1.5" xmlns="http://code.deckfour.org/xes">
  <!-- Generated by the YAWL Engine 2021.03.11 18:59:45 -->
  <!-- and then merged with the Resource Service log -->
  <extension name="Lifecycle" prefix="lifecycle" uri="http://code.fluxicon.com/xes/lifecycle.xesext"/>
  <extension name="Time" prefix="time" uri="http://code.fluxicon.com/xes/time.xesext"/>
  <extension name="Concept" prefix="concept" uri="http://code.fluxicon.com/xes/concept.xesext"/>
  <extension name="Semantic" prefix="semantic" uri="http://code.fluxicon.com/xes/semantic.xesext"/>
  <extension name="Organizational" prefix="org" uri="http://code.fluxicon.com/xes/org.xesext"/>
  <global scope="trace">
    <string key="concept:name" value="UNKNOWN"/>
  </global>
  <global scope="event">
    <date key="time:timestamp" value="1970-01-01T00:00:00.000+01:00"/>
    <string key="concept:name" value="UNKNOWN"/>
    <string key="lifecycle:transition" value="UNKNOWN"/>
    <string key="concept:instance" value="UNKNOWN"/>
  </global>
  <classifier name="Activity classifier" keys="concept:name concept:instance lifecycle:transition"/>
  <string key="concept:name" value="Procure-to-pay - version 0.122"/>
  <trace>
    <string key="concept:name" value="1"/>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:53:27.574+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:53:27.716+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:53:27.745+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:53:27.756+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:53:27.774+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-1ee484e0-535b-4580-ab68-92255627fd2f"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:55:32.556+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="assign"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:55:32.734+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:55:32.880+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1.1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:55:32.917+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="start"/>
      <string key="concept:instance" value="1.1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:00.817+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="1.1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
      <string key="Requester" value="tom"/>
      <date key="End_date" value="2021-03-11T00:00:00"/>
      <string key="Rental_request_description" value="tom"/>
      <string key="Using_Time/trigger" value="OnExecuting"/>
      <string key="Using_Time/expiry" value="2017-12-22T10:40:39"/>
      <boolean key="Using_Time/workdays" value="true"/>
      <date key="Start_date" value="2021-03-11T00:00:00"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:00.950+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.346+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.371+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.433+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-c284c53b-9d66-4c67-8d9c-877cdf4d9780"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.435+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.442+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-686e7004-ac50-4872-a17d-e6063e99f40c"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:01.550+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:35.615+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="assign"/>
      <string key="concept:instance" value="1"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:35.830+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:35.845+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="1.2"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-03-11T18:56:35.879+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="start"/>
      <string key="concept:instance" value="1.2"/>
      <string key="org:resource" value="PA-85bb4006-0963-4563-9736-0b28521cb5b3"/>
      <string key="Catalog/Item/OrderNo" value="2035"/>
      <string key="Catalog/Item/Name" value="Truck"/>
      <string key="Catalog/Item/Description" value="Heavy truck."/>
      <string key="Catalog/Item/Price" value="1350"/>
      <string key="Catalog/Item/Supplier" value="supplier1"/>
      <string key="Catalog/Item/OrderNo" value="2433"/>
      <string key="Catalog/Item/Name" value="Excavator"/>
      <string key="Catalog/Item/Description" value="Small excavator"/>
      <string key="Catalog/Item/Price" value="450"/>
      <string key="Catalog/Item/Supplier" value="supplier1"/>
      <string key="Catalog/Item/OrderNo" value="3545"/>
      <string key="Catalog/Item/Name" value="Bulldozer"/>
      <string key="Catalog/Item/Description" value="Yellow bulldozer"/>
      <string key="Catalog/Item/Price" value="1230"/>
      <string key="Catalog/Item/Supplier" value="supplier2"/>
      <string key="Rental_request_description" value="tom"/>
      <date key="End_date" value="2021-03-11T00:00:00"/>
      <string key="Requester" value="tom"/>
      <string key="Comment" value="no comment"/>
      <date key="Start_date" value="2021-03-11T00:00:00"/>
    </event>

If its a self created xes file, is it not straightforward for you to create a tiny one ?
I always recommend starting small and working ones way up.
p.s. in the future please avoid screenshots when posting as text is an option.

Hi Faruk,

The provided XES file was almost perfect: only the last two lines must be appended to make it a valid XML file:

      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="23"/>
    </event>
  </trace>
</log> 

I was able to debug the issue and it's seems to be an issue which seems to be related as reported on Stackoverflow.

And indeed, in read_xes(), the line of code which fails contains the call to spread()

eventlog <- all_attrs %>% unlist() %>% as_data_frame() %>% 
    mutate(type = rep(c("key", "value"), length = nrow(.)), 
      attr_id = rep(1:(nrow(.)/2), each = 2)) %>% spread(type, 
    value) %>% select(-attr_id) %>% bind_cols(eventlog) %>% 
    select(-n_attributes, -attr_id) %>% spread(key, value)

these is a smaller one, but that xes-file is possible to read in R ... i dont know why...

<?xml version="1.0" encoding="UTF-8"?>
<log xes.version="1.0" xes.features="arbitrary-depth" openxes.version="1.5" xmlns="http://code.deckfour.org/xes">
  <!-- Generated by the YAWL Engine 2021.02.21 18:03:00 -->
  <!-- and then merged with the Resource Service log -->
  <extension name="Lifecycle" prefix="lifecycle" uri="http://code.fluxicon.com/xes/lifecycle.xesext"/>
  <extension name="Time" prefix="time" uri="http://code.fluxicon.com/xes/time.xesext"/>
  <extension name="Concept" prefix="concept" uri="http://code.fluxicon.com/xes/concept.xesext"/>
  <extension name="Semantic" prefix="semantic" uri="http://code.fluxicon.com/xes/semantic.xesext"/>
  <extension name="Organizational" prefix="org" uri="http://code.fluxicon.com/xes/org.xesext"/>
  <global scope="trace">
    <string key="concept:name" value="UNKNOWN"/>
  </global>
  <global scope="event">
    <date key="time:timestamp" value="1970-01-01T00:00:00.000+01:00"/>
    <string key="concept:name" value="UNKNOWN"/>
    <string key="lifecycle:transition" value="UNKNOWN"/>
    <string key="concept:instance" value="UNKNOWN"/>
  </global>
  <classifier name="Activity classifier" keys="concept:name concept:instance lifecycle:transition"/>
  <string key="concept:name" value="Procure-to-pay - version 0.122"/>
  <trace>
    <string key="concept:name" value="4"/>
    <event>
      <date key="time:timestamp" value="2021-02-16T17:31:28.338+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="4"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-16T17:31:28.370+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="4"/>
      <string key="org:resource" value="system"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-16T17:33:21.112+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="4"/>
      <string key="org:resource" value="PA-9b25ab43-782e-4e2d-9da9-0cc1c9996126"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T17:50:07.380+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="assign"/>
      <string key="concept:instance" value="4"/>
      <string key="org:resource" value="PA-9b25ab43-782e-4e2d-9da9-0cc1c9996126"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T17:50:37.103+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="4.1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T17:50:37.105+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="start"/>
      <string key="concept:instance" value="4.1"/>
      <string key="org:resource" value="PA-9b25ab43-782e-4e2d-9da9-0cc1c9996126"/>
    </event>
  </trace>
  <trace>
    <string key="concept:name" value="5"/>
    <event>
      <date key="time:timestamp" value="2021-02-19T16:17:32.059+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="system"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-19T16:17:32.066+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:00:22.121+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:00:31.372+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="assign"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:00:37.502+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5.1"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:00:37.502+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="start"/>
      <string key="concept:instance" value="5.1"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.197+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="5.1"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
      <date key="Start_date" value="2021-02-21T00:00:00"/>
      <string key="Rental_request_description" value="TestWerkzeug"/>
      <date key="End_date" value="2021-02-21T00:00:00"/>
      <string key="Requester" value="TestFirma"/>
      <string key="Using_Time/trigger" value="OnExecuting"/>
      <string key="Using_Time/expiry" value="2017-12-22T10:40:39"/>
      <boolean key="Using_Time/workdays" value="false"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.199+0100"/>
      <string key="concept:name" value="Fill_in_equipment_rental_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.270+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.275+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="schedule"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.294+0100"/>
      <string key="concept:name" value="Select_equipment"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="system"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:01:48.329+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:19.990+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:28.638+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="assign"/>
      <string key="concept:instance" value="5"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:31.397+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:31.405+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="start"/>
      <string key="concept:instance" value="5.2"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:31.407+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="unknown"/>
      <string key="concept:instance" value="5.2"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:35.177+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="5"/>
    </event>
    <event>
      <date key="time:timestamp" value="2021-02-21T18:02:35.178+0100"/>
      <string key="concept:name" value="Cancel_request"/>
      <string key="lifecycle:transition" value="complete"/>
      <string key="concept:instance" value="5.2"/>
      <string key="org:resource" value="PA-355aa177-681a-4c9b-91ed-21b03187508e"/>
    </event>
  </trace>
</log>

@lars the xes-file was only a part of the whole file ... at the end i got that arguments

I've created an issue on Github so that the authors can have a look and provide feedback on this topic.

In the meantime, it appears that you have identical rows in your original dataset.

So, is it possible to remove them, create a new XES file and then see if that solves your issue?

i got identical rows too in the other xes- file wich I can import... I can't change it that some rows are identical because the YAWL engine create that xes file. I can do some processes different so that i got some events different but i can't avoid that some rows are identical

Within the Process Mining community , the IEEE Standard for XES (eXtensible Event Stream) is used for Achieving Interoperability in Event Logs and Event Streams. In other words, it is intended to exchange event logs between different tooling.

The provided XES file has been generated from a tool of Fluxicon: Disco. With the demo version of this tool, I was able to import your XES files without a problem.

To me, it appears that a possible improvement could be made within the bupaR package. But then again, I could also be completely on the wrong path.

Anyway, there are several workarounds feasible: one of them is to create yourself an event log with the bupaR package - in case you would have the raw data available in csv format.

Let's continue the discussion by email until we get you up-and-running with this topic in R and bupaR.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.