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 .
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. Normative Artifacts
This module is published through the following artifacts:
runtime.ttl: ontology, published athttps://ujg.specs.openuji.org/ed/ns/runtimeruntime.context.jsonld: JSON-LD term mappings, published athttps://ujg.specs.openuji.org/ed/ns/runtime.context.jsonldruntime.shape.ttl: SHACL validation rules, published athttps://ujg.specs.openuji.org/ed/ns/runtime.shape
Examples in this page use an explicit context array composed from the published module contexts. The same composition is also published as the convenience context https://ujg.specs.openuji.org/ed/context.jsonld.
3. 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.
4. Event Chaining
4.1. Visual Model
graph LR
subgraph Execution [JourneyExecution]
direction LR
E1[Event A, id: e1]
E2[Event B, id: e2<br/>previousId: e1]
E3[Event C, id: e3<br/>previousId: e2]
E1 -->|previousId| E2
E2 -->|previousId| E3
end A JourneyExecution groups the RuntimeEvents for one logical trace. A RuntimeEvent records one runtime moment and may reference its immediate predecessor via previousId; if previousId is omitted, the event is the Root Event.
5. Ontology
The normative Runtime ontology is defined below and is published at https://ujg.specs.openuji.org/ed/ns/runtime. It is the authoritative structural definition for JourneyExecution, RuntimeEvent, and the properties that connect them.
@prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgruntime: <https://ujg.specs.openuji.org/ed/ns/runtime#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
<https://ujg.specs.openuji.org/ed/ns/runtime#> a owl:Ontology ;
rdfs:label "UJG Runtime Editor's Draft Vocabulary"@en ;
dct:description "UJG Runtime ontology declaration" .
### Classes
ujgruntime:JourneyExecution a owl:Class ;
rdfs:subClassOf ujg:Node .
ujgruntime:RuntimeEvent a owl:Class ;
rdfs:subClassOf ujg:Node .
### Properties
ujgruntime:eventRefs a owl:ObjectProperty ;
rdfs:domain ujgruntime:JourneyExecution ;
rdfs:range ujgruntime:RuntimeEvent .
ujgruntime:executionId a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujgruntime:JourneyExecution .
ujgruntime:previousId a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujgruntime:RuntimeEvent .
ujgruntime:stateRef a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujggraph:State .
ujgruntime:payload a owl:DatatypeProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range rdf:JSON . @prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgruntime: <https://ujg.specs.openuji.org/ed/ns/runtime#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dct: <http://purl.org/dc/terms/> .
<https://ujg.specs.openuji.org/ed/ns/runtime#> a owl:Ontology ;
rdfs:label "UJG Runtime Editor's Draft Vocabulary"@en ;
dct:description "UJG Runtime ontology declaration" .
### Classes
ujgruntime:JourneyExecution a owl:Class ;
rdfs:subClassOf ujg:Node .
ujgruntime:RuntimeEvent a owl:Class ;
rdfs:subClassOf ujg:Node .
### Properties
ujgruntime:eventRefs a owl:ObjectProperty ;
rdfs:domain ujgruntime:JourneyExecution ;
rdfs:range ujgruntime:RuntimeEvent .
ujgruntime:executionId a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujgruntime:JourneyExecution .
ujgruntime:previousId a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujgruntime:RuntimeEvent .
ujgruntime:stateRef a owl:ObjectProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range ujggraph:State .
ujgruntime:payload a owl:DatatypeProperty ;
rdfs:domain ujgruntime:RuntimeEvent ;
rdfs:range rdf:JSON . 6. JSON-LD Context
The normative Runtime JSON-LD context is defined below and is published at https://ujg.specs.openuji.org/ed/ns/runtime.context.jsonld. It provides the compact JSON-LD term mappings for Runtime examples, including IRI-valued references and opaque JSON payload values.
{
"@context": {
"@version": 1.1,
"ujgruntime": "https://ujg.specs.openuji.org/ed/ns/runtime#",
"JourneyExecution": "ujgruntime:JourneyExecution",
"RuntimeEvent": "ujgruntime:RuntimeEvent",
"eventRefs": {
"@id": "ujgruntime:eventRefs",
"@type": "@id",
"@container": "@set"
},
"executionId": {
"@id": "ujgruntime:executionId",
"@type": "@id"
},
"previousId": {
"@id": "ujgruntime:previousId",
"@type": "@id"
},
"stateRef": {
"@id": "ujgruntime:stateRef",
"@type": "@id"
},
"payload": {
"@id": "ujgruntime:payload",
"@type": "@json"
}
}
} {
"@context": {
"@version": 1.1,
"ujgruntime": "https://ujg.specs.openuji.org/ed/ns/runtime#",
"JourneyExecution": "ujgruntime:JourneyExecution",
"RuntimeEvent": "ujgruntime:RuntimeEvent",
"eventRefs": {
"@id": "ujgruntime:eventRefs",
"@type": "@id",
"@container": "@set"
},
"executionId": {
"@id": "ujgruntime:executionId",
"@type": "@id"
},
"previousId": {
"@id": "ujgruntime:previousId",
"@type": "@id"
},
"stateRef": {
"@id": "ujgruntime:stateRef",
"@type": "@id"
},
"payload": {
"@id": "ujgruntime:payload",
"@type": "@json"
}
}
} 7. Validation
The normative Runtime SHACL shape is defined below and is published at https://ujg.specs.openuji.org/ed/ns/runtime.shape. It is the authoritative validation artifact for Runtime structural constraints.
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgruntime: <https://ujg.specs.openuji.org/ed/ns/runtime#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ujgruntimeshape: <https://ujg.specs.openuji.org/ed/ns/runtime.shape#> .
ujgruntimeshape:StateLikeShape a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:or (
[ sh:class ujggraph:State ]
[ sh:class ujggraph:CompositeState ]
) .
ujgruntimeshape:JourneyExecutionShape a sh:NodeShape ;
sh:targetClass ujgruntime:JourneyExecution ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgruntime:eventRefs ;
sh:class ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
] .
ujgruntimeshape:RuntimeEventShape a sh:NodeShape ;
sh:targetClass ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgruntime:executionId ;
sh:class ujgruntime:JourneyExecution ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:previousId ;
sh:class ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:stateRef ;
sh:node ujgruntimeshape:StateLikeShape ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:payload ;
sh:datatype rdf:JSON ;
sh:maxCount 1 ;
] . @prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgruntime: <https://ujg.specs.openuji.org/ed/ns/runtime#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ujgruntimeshape: <https://ujg.specs.openuji.org/ed/ns/runtime.shape#> .
ujgruntimeshape:StateLikeShape a sh:NodeShape ;
sh:nodeKind sh:IRI ;
sh:or (
[ sh:class ujggraph:State ]
[ sh:class ujggraph:CompositeState ]
) .
ujgruntimeshape:JourneyExecutionShape a sh:NodeShape ;
sh:targetClass ujgruntime:JourneyExecution ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgruntime:eventRefs ;
sh:class ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
] .
ujgruntimeshape:RuntimeEventShape a sh:NodeShape ;
sh:targetClass ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgruntime:executionId ;
sh:class ujgruntime:JourneyExecution ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:previousId ;
sh:class ujgruntime:RuntimeEvent ;
sh:nodeKind sh:IRI ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:stateRef ;
sh:node ujgruntimeshape:StateLikeShape ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujgruntime:payload ;
sh:datatype rdf:JSON ;
sh:maxCount 1 ;
] . The rules below define additional causal constraints on event chains beyond the structural constraints captured by the SHACL shape.
Within a single execution (events where executionId equals the JourneyExecution id):
Root: Exactly one event MUST be the Root Event.
Resolution: Every present
previousIdMUST match the@idof an event in the same execution.Single Successor: An event
@idMUST NOT be referenced aspreviousIdby more than one event in the same execution.Acyclic: The chain MUST NOT contain cycles.
If any rule above is violated, the JourneyExecution is invalid.
8. Reconstruction
A Consumer reconstructing event order MUST:
Identify the Root Event.
Repeatedly select the unique event whose
previousIdequals the current event’s@id.Continue until no successor exists.
9. Appendix: Combined JSON Example
{
"@context": [
"https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/graph.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/runtime.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/experience.context.jsonld"
],
"@id": "https://example.com/ujg/runtime/execution-12345.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"nodes": [
{
"@type": "JourneyExecution",
"@id": "urn:ujg:execution:12345",
"eventRefs": ["urn:ujg:event:12345:100", "urn:ujg:event:12345:200"]
},
{
"@type": "RuntimeEvent",
"@id": "urn:ujg:event:12345:100",
"executionId": "urn:ujg:execution:12345",
"stateRef": "urn:ujg:state:product-page",
"payload": { "action": "view" }
},
{
"@type": "RuntimeEvent",
"@id": "urn:ujg:event:12345:200",
"executionId": "urn:ujg:execution:12345",
"previousId": "urn:ujg:event:12345:100",
"stateRef": "urn:ujg:state:cart",
"payload": { "item": "shoes" }
}
]
} {
"@context": [
"https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/graph.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/runtime.context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/experience.context.jsonld"
],
"@id": "https://example.com/ujg/runtime/execution-12345.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"nodes": [
{
"@type": "JourneyExecution",
"@id": "urn:ujg:execution:12345",
"eventRefs": ["urn:ujg:event:12345:100", "urn:ujg:event:12345:200"]
},
{
"@type": "RuntimeEvent",
"@id": "urn:ujg:event:12345:100",
"executionId": "urn:ujg:execution:12345",
"stateRef": "urn:ujg:state:product-page",
"payload": { "action": "view" }
},
{
"@type": "RuntimeEvent",
"@id": "urn:ujg:event:12345:200",
"executionId": "urn:ujg:execution:12345",
"previousId": "urn:ujg:event:12345:100",
"stateRef": "urn:ujg:state:cart",
"payload": { "item": "shoes" }
}
]
}