The Inferal JSON Values Ontology defines RDF terms for representing actual JSON values as RDF resources. It covers JSON objects, arrays, strings, numbers, booleans, null, object member occurrences, and array element occurrences without projecting JSON field names into RDF predicate IRIs.

This is an unofficial 0.1 Editor's Draft maintained in the Inferal ontology repository.

Feedback should be sent to contact@inferal.com.

This specification defines three conformance classes: JSON value data graph, JSON value producer, and JSON value consumer.

A JSON value data graph is an RDF graph that uses terms from this specification consistently with the term definitions and validation expectations below.

A JSON value producer is software or an authoring process that emits RDF resources representing JSON values, object members, array elements, and scalar value literals.

A JSON value consumer is software that reads JSON value graphs and reconstructs, displays, validates, maps, or otherwise processes the represented JSON value.

Namespaces

Prefix IRI
json https://ontology.inferal.com/modules/json-values/

The JSON values namespace is dependency-free. It models values described by the JSON data model [[!RFC8259]] using RDF, OWL, and SHACL terms. JSON Schema vocabularies, JSON-LD contexts, and domain-specific projections may reference these value resources, but they are outside this module's scope.

Term Index

Term Kind Normative role
json:Value Class Any JSON value: object, array, string, number, boolean, or null.
json:Object Class A JSON object represented through explicit member occurrences.
json:Array Class A JSON array represented through indexed element occurrences.
json:String Class A JSON string value.
json:Number Class A JSON number represented by its JSON lexical form.
json:Boolean Class A JSON boolean value.
json:Null Class The JSON null value kind.
json:Member Class A first-class object name/value pair occurrence.
json:Element Class A first-class array index/value occurrence.
json:null Individual The singleton individual representing JSON null.
json:hasMember Object property Links a JSON object to a member occurrence.
json:memberOfObject Object property Links a member occurrence to its containing object.
json:memberName Datatype property The object member name.
json:memberValue Object property The JSON value associated with a member occurrence.
json:memberIndex Datatype property Optional zero-based source-order index for an object member.
json:hasElement Object property Links a JSON array to an element occurrence.
json:elementOfArray Object property Links an element occurrence to its containing array.
json:elementIndex Datatype property The zero-based array element index.
json:elementValue Object property The JSON value associated with an element occurrence.
json:stringValue Datatype property The Unicode character content of a JSON string.
json:numberLexicalForm Datatype property The JSON grammar lexical form of a JSON number.
json:booleanValue Datatype property The boolean literal value of a JSON boolean.

Value Model

A JSON value graph represents JSON values as RDF resources. A value resource MUST be an instance of exactly one of json:Object, json:Array, json:String, json:Number, json:Boolean, or json:Null. The ontology declares these classes as the disjoint union of json:Value.

Conforming source graphs MUST state structural containment in both directions. A member occurrence linked from an object with json:hasMember MUST point back to that object with json:memberOfObject, and each json:memberOfObject assertion MUST be backed by the corresponding json:hasMember assertion. Array element links follow the same rule for json:hasElement and json:elementOfArray. The OWL addendum declares these property pairs as inverses for reasoning consumers, but the SHACL profile validates the explicit source graph.

The ontology also declares json:Value, json:Member, and json:Element as disjoint classes. Member and element occurrences are structural nodes in the RDF representation; they are not themselves JSON values.

JSON value containment MUST be acyclic. Following zero or more object member values and array element values from a JSON value MUST NOT return to the same value resource.

Object member names are data, not RDF predicates. Producers MUST NOT mint predicate IRIs from JSON member names when their goal is to encode the JSON value itself. Domain projections MAY map selected member names to domain predicates in a separate graph or module.

JSON null MUST be represented as json:null. Producers MUST NOT mint additional individuals of json:Null unless they are modeling something other than the JSON null value itself.

Objects

A json:Object has zero or more json:Member occurrences. Each member occurrence MUST have exactly one json:memberOfObject, exactly one json:memberName, and exactly one json:memberValue. A member occurrence MAY have one json:memberIndex to preserve source order. If one member of an object has json:memberIndex, every member of that object MUST have one. Member indexes MUST be unique within the object.

JSON applications typically treat object member names as unique, but source JSON texts can contain repeated member names. This ontology does not prohibit repeated json:memberName values; stricter profiles MAY add a uniqueness constraint when duplicate names are not allowed.

The ontology declares an OWL key for json:Member over json:memberOfObject and json:memberIndex. This supports identity reasoning for source-positioned member occurrences without treating member names as identity keys. Under OWL 2 DL, key semantics apply to named individuals; blank-node value graphs should use the SHACL uniqueness constraints for validation.

Arrays

A json:Array has zero or more json:Element occurrences. Each element occurrence MUST have exactly one json:elementOfArray, exactly one json:elementIndex, and exactly one json:elementValue. Indexes are zero-based and MUST be unique and contiguous for a given array.

The ontology declares an OWL key for json:Element over json:elementOfArray and json:elementIndex. This mirrors JSON array identity by container and zero-based position. Under OWL 2 DL, key semantics apply to named individuals; blank-node value graphs should use the SHACL uniqueness constraints for validation.

Scalars

A json:String MUST have exactly one json:stringValue. A json:Boolean MUST have exactly one json:booleanValue. A json:Number MUST have exactly one json:numberLexicalForm that conforms to the JSON number grammar in [[!RFC8259]].

Consumers MAY interpret json:numberLexicalForm as a decimal, floating-point number, arbitrary precision number, or application numeric type. This specification does not require one numeric interpretation.

json:stringValue uses RDF xsd:string literals. JSON texts that depend on unpaired UTF-16 surrogate escape sequences need an application extension if those source code units must be preserved exactly.

Examples

Validation

The colocated SHACL shapes define a source-authoring profile for JSON value graphs. The shapes require object members and array elements to be attached to exactly one container, require scalar value classes to carry their scalar literal, validate JSON number lexical syntax, require object member indexes to be all-or-none and unique, require array indexes to be unique and contiguous, reject cyclic value containment, and require json:Null to be represented by json:null.

SHACL validation does not impose uniqueness of object member names. A profile that wants interoperable object semantics without duplicate names SHOULD add a profile-specific uniqueness constraint over json:memberName within each json:Object.