JLD003 - Namespace Pollution¶
Severity: Warning Layer: JSON-LD Semantic
Description¶
Custom terms are used without proper namespacing. Terms should use a prefix
(e.g., ex:customField) or be explicitly defined in the context to avoid
collisions with standard vocabulary terms.
Example¶
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/",
{
"myField": "https://example.com/vocab#myField"
}
],
"type": ["DigitalProductPassport"],
"myField": "value",
"anotherUnprefixedTerm": "problematic"
}
Warning: Term anotherUnprefixedTerm lacks proper namespacing.
Resolution¶
Use prefixed terms or define all custom terms in the context:
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/",
{
"ex": "https://example.com/vocab#",
"myField": "ex:myField"
}
],
"type": ["DigitalProductPassport"],
"myField": "value",
"ex:anotherTerm": "properly prefixed"
}