State Data
incubatingStatus 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 optional module defines a minimal graph-native vocabulary for attaching state data context or
binding identity to Graph State and CompositeState nodes.
Without a state data primitive, implementations tend to invent incompatible state-management, data-context, and binding conventions inside opaque extensions. This module gives producers a shared place to say which addressable state data declaration belongs to a state-like node while leaving lifecycle and runtime details for later work.
This first version is intentionally small. It declares that a state-like node has an associated
StateData resource; it does not define schemas, reactive stores, fetch policies, cache
directives, lifecycle status, authentication context, or realtime behavior.
State Data is not the general resource primitive for UJG. Portable resources that are produced, consumed, or exchanged during a journey are modeled by the Artifact module.
2. Normative Artifacts
This module is published through the following artifacts:
state-data.ttl: ontology, published athttps://ujg.specs.openuji.org/ed/ns/state-datastate-data.context.jsonld: JSON-LD term mappings, published athttps://ujg.specs.openuji.org/ed/ns/state-data.context.jsonldstate-data.shape.ttl: SHACL validation rules, published athttps://ujg.specs.openuji.org/ed/ns/state-data.shape
Examples in this page compose the shared baseline context https://ujg.specs.openuji.org/ed/ns/context.jsonld
with the State Data context.
3. Terminology
StateData: An addressable declaration of data context or binding identity for a Graph state-like node.
State data attachment: The relation that assigns a state-like node to a state data declaration.
4. Attachment Model
The module introduces one canonical interoperable attachment:
stateData:stateDataReflinks a GraphStateorCompositeStatetoStateData.
A state without stateDataRef remains fully valid and traversable. Consumers MAY ignore this
module and still process the graph.
State Data and Artifact intentionally remain separate. Use StateData when a state-like graph node
needs a stable data-context or binding identity. Use Artifact when a file, archive, report,
invite, media object, token, protocol object, or other portable resource is produced, consumed, or
exchanged. If the same external thing is both the context behind a state and a transferred resource,
model separate StateData and Artifact nodes unless a future module defines an explicit
relationship between them.
5. Ontology
The normative State Data ontology is defined below and is published at
https://ujg.specs.openuji.org/ed/ns/state-data.
@prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgstatedata: <https://ujg.specs.openuji.org/ed/ns/state-data#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
<https://ujg.specs.openuji.org/ed/ns/state-data#> a owl:Ontology ;
rdfs:label "UJG State Data Editor's Draft Vocabulary"@en ;
dct:description "UJG State Data ontology declaration" .
### Classes
ujgstatedata:StateData a owl:Class ;
rdfs:subClassOf ujg:Node .
### Properties
ujgstatedata:stateDataRef a owl:ObjectProperty ;
rdfs:domain [
a owl:Class ;
owl:unionOf ( ujggraph:State ujggraph:CompositeState )
] ;
rdfs:range ujgstatedata:StateData . @prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgstatedata: <https://ujg.specs.openuji.org/ed/ns/state-data#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .
<https://ujg.specs.openuji.org/ed/ns/state-data#> a owl:Ontology ;
rdfs:label "UJG State Data Editor's Draft Vocabulary"@en ;
dct:description "UJG State Data ontology declaration" .
### Classes
ujgstatedata:StateData a owl:Class ;
rdfs:subClassOf ujg:Node .
### Properties
ujgstatedata:stateDataRef a owl:ObjectProperty ;
rdfs:domain [
a owl:Class ;
owl:unionOf ( ujggraph:State ujggraph:CompositeState )
] ;
rdfs:range ujgstatedata:StateData . 6. JSON-LD Context
The normative State Data JSON-LD context is defined below and is published at
https://ujg.specs.openuji.org/ed/ns/state-data.context.jsonld.
{
"@context": {
"@version": 1.1,
"ujgstatedata": "https://ujg.specs.openuji.org/ed/ns/state-data#",
"stateData": "https://ujg.specs.openuji.org/ed/ns/state-data#",
"StateData": "ujgstatedata:StateData",
"stateDataRef": {
"@id": "ujgstatedata:stateDataRef",
"@type": "@id"
}
}
} {
"@context": {
"@version": 1.1,
"ujgstatedata": "https://ujg.specs.openuji.org/ed/ns/state-data#",
"stateData": "https://ujg.specs.openuji.org/ed/ns/state-data#",
"StateData": "ujgstatedata:StateData",
"stateDataRef": {
"@id": "ujgstatedata:stateDataRef",
"@type": "@id"
}
}
} 7. Validation
The normative State Data SHACL shape is defined below and is published at
https://ujg.specs.openuji.org/ed/ns/state-data.shape.
@prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgstatedata: <https://ujg.specs.openuji.org/ed/ns/state-data#> .
@prefix ujgstatedatashape: <https://ujg.specs.openuji.org/ed/ns/state-data.shape#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
ujgstatedatashape:StateDataHostShape a sh:NodeShape ;
sh:targetClass ujggraph:State, ujggraph:CompositeState ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgstatedata:stateDataRef ;
sh:class ujgstatedata:StateData ;
sh:nodeKind sh:IRI ;
sh:maxCount 1 ;
] .
ujgstatedatashape:StateDataShape a sh:NodeShape ;
sh:targetClass ujgstatedata:StateData ;
sh:nodeKind sh:IRI . @prefix ujggraph: <https://ujg.specs.openuji.org/ed/ns/graph#> .
@prefix ujgstatedata: <https://ujg.specs.openuji.org/ed/ns/state-data#> .
@prefix ujgstatedatashape: <https://ujg.specs.openuji.org/ed/ns/state-data.shape#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
ujgstatedatashape:StateDataHostShape a sh:NodeShape ;
sh:targetClass ujggraph:State, ujggraph:CompositeState ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujgstatedata:stateDataRef ;
sh:class ujgstatedata:StateData ;
sh:nodeKind sh:IRI ;
sh:maxCount 1 ;
] .
ujgstatedatashape:StateDataShape a sh:NodeShape ;
sh:targetClass ujgstatedata:StateData ;
sh:nodeKind sh:IRI . The rules below define the remaining module semantics beyond the structural constraints captured by the SHACL shape.
Declaration only: State Data describes that a state-like node has associated state data identity; it does not define how the data is loaded, updated, cached, or observed.
Shared state data identity: Multiple state-like nodes MAY reference the same
StateDataresource when they intentionally share a data context or binding identity.Graph preservation:
stateDataRefMUST NOT change Graph topology or traversal semantics.Artifact boundary:
StateDataMUST NOT be interpreted as a produced, consumed, or exchanged resource. Use Artifact for portable resource identity.Graceful degradation: Consumers that do not implement this module MAY ignore State Data semantics, but SHOULD preserve recognized JSON-LD data during read-transform-write when possible.
Private lifecycle details: Fetch policy, cache behavior, lifecycle status, and reactive-store bindings SHOULD remain in Core
extensionsunless a future optional module defines them as interoperable vocabulary.
8. Minimal Example
{
"@context": [
"https://ujg.specs.openuji.org/ed/ns/context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/state-data.context.jsonld"
],
"@id": "https://example.com/ujg/state-data/checkout.jsonld",
"@type": "UJGDocument",
"nodes": [
{
"@id": "urn:state:payment",
"@type": "State",
"label": "Payment",
"stateDataRef": "urn:statedata:checkout-draft"
},
{
"@id": "urn:statedata:checkout-draft",
"@type": "StateData"
}
]
} {
"@context": [
"https://ujg.specs.openuji.org/ed/ns/context.jsonld",
"https://ujg.specs.openuji.org/ed/ns/state-data.context.jsonld"
],
"@id": "https://example.com/ujg/state-data/checkout.jsonld",
"@type": "UJGDocument",
"nodes": [
{
"@id": "urn:state:payment",
"@type": "State",
"label": "Payment",
"stateDataRef": "urn:statedata:checkout-draft"
},
{
"@id": "urn:statedata:checkout-draft",
"@type": "StateData"
}
]
}