JLD004 - Context Resolution¶
Severity: Warning Layer: JSON-LD Semantic
Description¶
Failed to resolve a remote @context URL. This may be due to network issues,
the context server being unavailable, or an invalid URL.
Example¶
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://invalid-domain.example/context.jsonld"
],
"type": ["DigitalProductPassport"]
}
Warning: Failed to resolve context: https://invalid-domain.example/context.jsonld
Resolution¶
- Verify the URL is correct and accessible
- Check network connectivity to the context server
- Use cached contexts by enabling the
CachingDocumentLoader:
from dppvalidator import ValidationEngine
# Contexts are cached by default
engine = ValidationEngine(validate_jsonld=True)
- Use inline contexts for custom vocabularies instead of remote URLs:
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
{
"ex": "https://example.com/vocab#",
"customField": "ex:customField"
}
]
}
Notes¶
- The validator uses an LRU cache for remote contexts
- Standard UNTP contexts are cached after first resolution
- Validation continues with a warning if context resolution fails