Skip to content

JSON-LD serialization: Recommend putting NamespaceMap at the root level and the beginning of the file #1339

@bact

Description

@bact

From 14 Jan 2026 Implementers call, regarding the processing of JSON-LD namespaces, we would like to propose a specification update. This change aims to support one-pass streaming and the handling of large SPDX documents.

We propose that nodes containing namespace mapping information be located at the root level (structurally) and the beginning of the file (sequentially):

  • @context (JSON-LD native)
  • NamespaceMap (SPDX 3 mechanism)

While strongly recommended, this is not a strict requirement, as some SPDX producers cannot easily control the output order.

This ordering preference may be extended to type / @type within a node, as early placement helps the processor identify the node's schema more efficiently.

A natural location for this recommendation is the 'Serializations' section of the specification:
https://github.com/spdx/spdx-spec/blob/develop/docs/serializations.md
(the spec already requires that "a reference to the SPDX global context file at the top level" but the text may not be extended to other contexts).

Metadata

Metadata

Assignees

No one assigned

    Labels

    doc improvementArea where the project documentation needs improvementserializationRepresentation of data in bytes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions