Runtime
draftStatus of this Document
This report was published by the User Journal Graph Community Group . It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups .
Conformance
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, OPTIONAL, RECOMMENDED, REQUIRED, SHALL, SHALL NOT, SHOULD, and SHOULD NOT in this document are to be interpreted as described in [RFC2119] and [RFC8174] when, and only when, they appear in all capitals, as shown here.
1. Overview
This module defines the data model for recording actual user behavior as a causally ordered event chain. Ordering is established by explicit linkage between events, not by timestamps.
2. Terminology
JourneyExecution: A bounded container for events belonging to one logical trace.
RuntimeEvent: An atomic record of a single runtime moment.
Event Chain: A sequence where each event references its immediate predecessor via
previousId.
3. Event Chaining
3.1. Visual Model
graph LR
subgraph Execution [JourneyExecution]
direction LR
E1[Event A, id: e1<br/>previousId: null]
E2[Event B, id: e2<br/>previousId: e1]
E3[Event C, id: e3<br/>previousId: e2]
E1 -->|previousId| E2
E2 -->|previousId| E3
end 3.2. The JourneyExecution Object (The Container)
A JourneyExecution MUST include:
type:"JourneyExecution"id: non-empty string (unique within the containing [UJG Core] document)events: array of RuntimeEvent objects
3.3. The RuntimeEvent Object (The Atom)
A RuntimeEvent MUST include:
type:"RuntimeEvent"id: non-empty string (unique within the containing JourneyExecution)previousId: string or nullnull(or empty string) indicates the Root Eventotherwise MUST equal the
idof another event in the same JourneyExecution
stateRef: string (Journey Stateid)
A RuntimeEvent MAY include:
payload: object (domain-specific data)
4. Chain Validity Rules
Within a single JourneyExecution:
Uniqueness: No two events MAY share the same
id.Root: Exactly one event MUST be the Root Event (
previousIdisnullor empty string).Resolution: Every non-root
previousIdMUST match theidof an event in the sameevents[].Single Successor: An event
idMUST NOT be referenced aspreviousIdby more than one event. (No branching.)Acyclic: The chain MUST NOT contain cycles.
If any rule above is violated, the JourneyExecution is invalid.
5. Reconstruction
A Consumer reconstructing event order MUST:
Identify the Root Event.
Repeatedly select the unique event whose
previousIdequals the current event’sid.Continue until no successor exists.
Appendix: Combined JSON Example
{
"type": "UJGDocument",
"specVersion": "1.0",
"items": [
{
"type": "JourneyExecution",
"id": "urn:session:12345",
"events": [
{
"type": "RuntimeEvent",
"id": "evt-100",
"previousId": null,
"stateRef": "urn:ujg:state:product-page",
"payload": { "action": "view" }
},
{
"type": "RuntimeEvent",
"id": "evt-200",
"previousId": "evt-100",
"stateRef": "urn:ujg:state:cart",
"payload": { "item": "shoes" }
}
]
}
]
} {
"type": "UJGDocument",
"specVersion": "1.0",
"items": [
{
"type": "JourneyExecution",
"id": "urn:session:12345",
"events": [
{
"type": "RuntimeEvent",
"id": "evt-100",
"previousId": null,
"stateRef": "urn:ujg:state:product-page",
"payload": { "action": "view" }
},
{
"type": "RuntimeEvent",
"id": "evt-200",
"previousId": "evt-100",
"stateRef": "urn:ujg:state:cart",
"payload": { "item": "shoes" }
}
]
}
]
} References
Normative References
- [RFC2119]
- Key words for use in RFCs to Indicate Requirement Levels. S. Bradner, March 1997, Best Current Practice. IETF. https://datatracker.ietf.org/doc/html/rfc2119
- [RFC8174]
- Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba, May 2017, Best Current Practice. IETF. https://datatracker.ietf.org/doc/html/rfc8174