UJG / Editor's Draft /
GitHub
Table of Contents
  • 1Overview
  • 2Normative Artifacts
  • 3Terminology
  • 4Attachment Model
  • 5Ontology
  • 6JSON-LD Context
  • 7Validation
  • 8Minimal Example
W3C Community Group Draft Report

State Data

incubating

Status 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 .

Last Update
2026-06-18
Editors
  • Seva Dolgopolov
Group
User Journal Graph Community Group
Repository
View Source
License
W3C-Software-and-Document

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 at https://ujg.specs.openuji.org/ed/ns/state-data

  • state-data.context.jsonld: JSON-LD term mappings, published at https://ujg.specs.openuji.org/ed/ns/state-data.context.jsonld

  • state-data.shape.ttl: SHACL validation rules, published at https://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:stateDataRef links a Graph State or CompositeState to StateData.

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.

turtle
@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.

json-ld
{
  "@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.

turtle
@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.

  1. 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.

  2. Shared state data identity: Multiple state-like nodes MAY reference the same StateData resource when they intentionally share a data context or binding identity.

  3. Graph preservation: stateDataRef MUST NOT change Graph topology or traversal semantics.

  4. Artifact boundary: StateData MUST NOT be interpreted as a produced, consumed, or exchanged resource. Use Artifact for portable resource identity.

  5. 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.

  6. Private lifecycle details: Fetch policy, cache behavior, lifecycle status, and reactive-store bindings SHOULD remain in Core extensions unless a future optional module defines them as interoperable vocabulary.

8. Minimal Example

json
{
  "@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"
    }
  ]
}

Copyright © 2026 the Contributors to the ujg/modules/state-data, published by the User Journal Graph Community Group under the W3C Community Contributor License Agreement (CLA) . A human-readable summary is available.

generated by Speculator