JSON
The OCEL 2.0 JSON format is designed from the ground-up to be efficient, idiomatic, and human-readable. On its top-level, it contains node collections of event-types, events, object-types, and objects.
Minimal Example
In the following minimal example, see all four top-level arrays with only a single item:
{
"eventTypes": [
{
"name": "create-order",
"attributes": [
{
"name": "total-items",
"type": "integer"
}
]
}
],
"objectTypes": [
{
"name": "order",
"attributes": [
{
"name": "item",
"type": "integer"
}
]
}
],
"events": [
{
"id": "e1",
"type": "create-order",
"time": "1970-01-01T00:00:00Z",
"attributes": [
{
"name": "total-items",
"value": 1
}
],
"relationships": [
{
"objectId": "o1",
"qualifier": "item"
}
]
}
],
"objects": [
{
"id": "o1",
"type": "order",
"attributes": [
{
"name": "item",
"time": "1970-01-01T00:00:00Z",
"value": 1
}
]
}
]
}
Note that the attribute item of object o1 is set to UNIX timestamp 0 (in ISO 8601).
Since we only have a single order, there are no object-to-object relationships. However, there is an event-to-object relationship from event e1 to object o1.
Attribute Types
Attribute types can have any value of:
- string
- time (ISO 8601 date and time string)
- integer
- float
- boolean (only valid values are
trueorfalse)
JSON Schema
We provide a JSON schema to download here. It can be used to validate your OCEL 2.0 JSON file.
File Extension
We do not prescribe any particular file extension apart from .json, but there are many who prefer .jsonocel.
Further Resources
All provided logs in the Event Logs section are available in the JSON format.