Skip to content

JLD002 - Undefined Terms

Severity: Warning (Error in strict mode) Layer: JSON-LD Semantic

Description

One or more terms in the document are not defined in the @context. During JSON-LD expansion, undefined terms are dropped, which may indicate namespace pollution or typos.

Example

{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/"
  ],
  "type": ["DigitalProductPassport"],
  "customField": "This term is not in the context"
}

Warning: Term customField is not defined in @context and will be dropped during expansion.

Resolution

Either:

  1. Remove the undefined term if it's not needed
  2. Add a custom context that defines the term:
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/",
    {
      "customField": "https://example.com/vocab#customField"
    }
  ],
  "type": ["DigitalProductPassport"],
  "customField": "Now properly namespaced"
}