Core
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 shared Core artifacts for UJG documents.
The Core module is published under https://ujg.specs.openuji.org/ed/ns/. Implementations should use these canonical URLs when referencing the Core vocabulary, JSON-LD context, and SHACL validation shape.
The Core module consists of:
core.ttl: the ontology for Core classes and properties, published athttps://ujg.specs.openuji.org/ed/ns/corecore.context.jsonld: the JSON-LD context for compact JSON-LD documents, published athttps://ujg.specs.openuji.org/ed/ns/core.context.jsonldcore.shape.ttl: the SHACL shape used for Core validation, published athttps://ujg.specs.openuji.org/ed/ns/core.shape
2. Terminology
UJGDocument: The Core document class for a JSON-LD bundle.
Node: The base Core class for addressable objects that may appear in
nodes.
3. Ontology
The normative Core ontology is defined in the Turtle document below and is published at https://ujg.specs.openuji.org/ed/ns/core. It declares the UJGDocument and Node classes together with the Core properties used by this module.
@prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<https://ujg.specs.openuji.org/ed/ns/core#> a owl:Ontology ;
rdfs:label "UJG Core Editor's Draft Vocabulary"@en ;
dct:description "UJG Ontology declaration" .
### Classes
ujg:UJGDocument a owl:Class .
ujg:Node a owl:Class .
ujg:documentImports a owl:ObjectProperty ;
rdfs:domain ujg:UJGDocument ;
rdfs:range ujg:UJGDocument .
ujg:documentNodes a owl:ObjectProperty;
rdfs:domain ujg:UJGDocument ;
rdfs:range ujg:Node .
### Properties
ujg:specVersion a owl:DatatypeProperty ;
rdfs:domain ujg:UJGDocument ;
rdfs:range xsd:string .
ujg:extensions a owl:DatatypeProperty ;
rdfs:domain ujg:Node ;
rdfs:range rdf:JSON . @prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<https://ujg.specs.openuji.org/ed/ns/core#> a owl:Ontology ;
rdfs:label "UJG Core Editor's Draft Vocabulary"@en ;
dct:description "UJG Ontology declaration" .
### Classes
ujg:UJGDocument a owl:Class .
ujg:Node a owl:Class .
ujg:documentImports a owl:ObjectProperty ;
rdfs:domain ujg:UJGDocument ;
rdfs:range ujg:UJGDocument .
ujg:documentNodes a owl:ObjectProperty;
rdfs:domain ujg:UJGDocument ;
rdfs:range ujg:Node .
### Properties
ujg:specVersion a owl:DatatypeProperty ;
rdfs:domain ujg:UJGDocument ;
rdfs:range xsd:string .
ujg:extensions a owl:DatatypeProperty ;
rdfs:domain ujg:Node ;
rdfs:range rdf:JSON . 4. JSON-LD Context
The normative Core JSON-LD context is defined below and is published at https://ujg.specs.openuji.org/ed/ns/core.context.jsonld. Examples in this section use the compact terms from this context, including @id, @type, specVersion, imports, nodes, and extensions.
{
"@context": {
"@version": 1.1,
"ujg": "https://ujg.specs.openuji.org/ed/ns/core#",
"@vocab": "https://ujg.specs.openuji.org/ed/ns/core#",
"specVersion": "ujg:specVersion",
"imports": {
"@id": "ujg:documentImports", "@type": "@id", "@container": "@set"
},
"nodes": {
"@id": "ujg:documentNodes", "@container": "@set"
},
"extensions": {
"@id": "ujg:extensions", "@type": "@json"
}
}
} {
"@context": {
"@version": 1.1,
"ujg": "https://ujg.specs.openuji.org/ed/ns/core#",
"@vocab": "https://ujg.specs.openuji.org/ed/ns/core#",
"specVersion": "ujg:specVersion",
"imports": {
"@id": "ujg:documentImports", "@type": "@id", "@container": "@set"
},
"nodes": {
"@id": "ujg:documentNodes", "@container": "@set"
},
"extensions": {
"@id": "ujg:extensions", "@type": "@json"
}
}
} 4.1. Context Composition
A compact UJG JSON-LD document MUST include the Core JSON-LD context.
A specification that defines compact terms not defined by Core MUST normatively identify the published URL of the JSON-LD context that defines those terms.
A compact UJG JSON-LD document that uses terms not defined by Core MUST compose the Core context with the published contexts that define those terms.
When a compact UJG JSON-LD document uses terms not defined by Core, its @context MUST reference the published URLs of the contexts that define those terms.
Specifications or deployments MAY publish convenience aggregate contexts that compose the Core context with additional contexts, but such aggregate contexts are outside the scope of Core.
A composed context is expressed as a JSON-LD @context array in which the Core context appears together with one or more additional contexts required by the document and published at https://ujg.specs.openuji.org/ed/ns/context.jsonld
4.1.1. Composed Context 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"
]
} {
"@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"
]
} 4.2. Extensions
extensions MAY appear on any Node.
extensions MUST NOT appear on UJGDocument.
If present, extensions MUST be a JSON object.
Each top-level key in extensions MUST be a namespace string controlled by the extension author. Authors SHOULD use reverse-DNS names or URI-based identifiers.
Each top-level value in extensions MUST be a JSON object.
Consumers MUST preserve unknown extension entries during read-transform-write unless operating in an explicitly lossy mode.
Consumers MUST NOT let unknown extensions affect core identity, import resolution, or reference resolution.
Consumers MAY apply namespace-specific processing for recognized extensions.
4.3. Import Resolution
imports values MUST be IRI references.
An imports value MAY be an absolute IRI or a relative IRI reference.
Relative import references MUST be resolved against the location of the importing UJGDocument.
For a document retrieved via HTTP(S), the base for resolution is the document URL. For a document loaded from a file URL, the base for resolution is the file URL of the importing document.
Core does not define a manifest root, package root, or workspace root for import resolution.
If no stable document location is available, relative imports are implementation-specific and may not be portable.
5. Validation
The normative Core SHACL shape is defined below and is published at https://ujg.specs.openuji.org/ed/ns/core.shape. It constrains UJGDocument and Node instances and is the validation artifact for Core semantics.
@prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ujgshape: <https://ujg.specs.openuji.org/ed/ns/core.shape#> .
ujgshape:UJGDocumentShape a sh:NodeShape ;
sh:targetClass ujg:UJGDocument ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujg:specVersion ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujg:documentImports ;
sh:nodeKind sh:IRI ;
sh:minCount 0 ;
] ;
sh:property [
sh:path ujg:documentNodes ;
sh:nodeKind sh:IRI ;
sh:minCount 0 ;
] ;
sh:property [
sh:path ujg:extensions ;
sh:maxCount 0 ;
] .
ujgshape:NodeShape a sh:NodeShape ;
sh:targetClass ujg:Node ;
sh:targetObjectsOf ujg:documentNodes ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujg:extensions ;
sh:datatype rdf:JSON ;
sh:maxCount 1 ;
] . @prefix ujg: <https://ujg.specs.openuji.org/ed/ns/core#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ujgshape: <https://ujg.specs.openuji.org/ed/ns/core.shape#> .
ujgshape:UJGDocumentShape a sh:NodeShape ;
sh:targetClass ujg:UJGDocument ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujg:specVersion ;
sh:datatype xsd:string ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ujg:documentImports ;
sh:nodeKind sh:IRI ;
sh:minCount 0 ;
] ;
sh:property [
sh:path ujg:documentNodes ;
sh:nodeKind sh:IRI ;
sh:minCount 0 ;
] ;
sh:property [
sh:path ujg:extensions ;
sh:maxCount 0 ;
] .
ujgshape:NodeShape a sh:NodeShape ;
sh:targetClass ujg:Node ;
sh:targetObjectsOf ujg:documentNodes ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path ujg:extensions ;
sh:datatype rdf:JSON ;
sh:maxCount 1 ;
] . 6. Examples
The examples below are informative. Each example uses https://ujg.specs.openuji.org/ed/ns/core.context.jsonld as its JSON-LD context and stays within the Core vocabulary. extensions appears only on node objects; document-level extensions is invalid in Core.
6.1. Minimal Document
{
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/core/minimal.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0"
} {
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/core/minimal.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0"
} 6.2. Document With Relative Imports
{
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/flows/order/main.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"imports": [
"./shared/states.jsonld",
"../runtime/events.jsonld",
"https://example.com/ujg/common/errors.jsonld"
]
} {
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/flows/order/main.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"imports": [
"./shared/states.jsonld",
"../runtime/events.jsonld",
"https://example.com/ujg/common/errors.jsonld"
]
} Resolved imports:
./shared/states.jsonld→https://example.com/ujg/flows/order/shared/states.jsonld../runtime/events.jsonld→https://example.com/ujg/flows/runtime/events.jsonldhttps://example.com/ujg/common/errors.jsonld→ unchanged
This follows [RFC3986] relative-reference resolution and the [JSON-LD 1.1.] rule that relative IRI references resolve from the document base IRI.
6.3. Document With Nodes
{
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/core/nodes.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"nodes": [
{
"@id": "urn:ujg:node:alpha",
"@type": "Node"
},
{
"@id": "urn:ujg:node:beta",
"@type": "Node",
"extensions": {
"com.example.audit": {
"checksum": "sha256:abc123"
}
}
}
]
} {
"@context": "https://ujg.specs.openuji.org/ed/ns/core.context.jsonld",
"@id": "https://example.com/ujg/core/nodes.jsonld",
"@type": "UJGDocument",
"specVersion": "1.0",
"nodes": [
{
"@id": "urn:ujg:node:alpha",
"@type": "Node"
},
{
"@id": "urn:ujg:node:beta",
"@type": "Node",
"extensions": {
"com.example.audit": {
"checksum": "sha256:abc123"
}
}
}
]
}