-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Expansion test e005 is a test to check the processor returns invalid remote context error.
In that test, specVersion is not specified, but the input refers itself recursively, so it seems to be recursive context inclusion error by JSON-LD 1.0 processor with JSON-LD 1.0 spec.
Input (e005):
json-ld-api/tests/expand/e005-in.jsonld
Lines 1 to 4 in da0dc41
| [{ | |
| "@context": "e005-in.jsonld", | |
| "@id": "http://example/test#example" | |
| }] |
Manifest (e005):
json-ld-api/tests/expand-manifest.jsonld
Lines 1074 to 1079 in da0dc41
| "@id": "#te005", | |
| "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ], | |
| "name": "Invalid remote context", | |
| "purpose": "Verifies that an exception is raised on expansion when a remote context is not an object containing @context", | |
| "input": "expand/e005-in.jsonld", | |
| "expect": "invalid remote context" |
e002 is similar test with "specVersion": "json-ld-1.0".
In this test, processor is expected to abort with recursive context inclusion error.
Input (e002):
json-ld-api/tests/expand/e002-in.jsonld
Lines 1 to 4 in da0dc41
| { | |
| "@context": "e002-in.jsonld", | |
| "@id": "http://example/test#example" | |
| } |
Manifest (e002):
json-ld-api/tests/expand-manifest.jsonld
Lines 1051 to 1057 in da0dc41
| "@id": "#te002", | |
| "@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ], | |
| "name": "A context may not include itself recursively (direct)", | |
| "purpose": "Verifies that an exception is raised on expansion when processing a context referencing itself", | |
| "input": "expand/e002-in.jsonld", | |
| "expect": "recursive context inclusion", | |
| "option": {"specVersion": "json-ld-1.0"} |
According to the step 3.2.2 in JSON-LD 1.0 context processing algorithm, both e002 and e005 should abort with recursive context inclusion.
(Note that invalid remote context might be returned in the step 3.2.3 in JSON-LD 1.0 spec. The processor won't reach that step with e005 test case.)
I think the test e005 should be applied only for processors implemented with JSON-LD 1.1 spec, but not for processors with 1.0 spec.
And if it is correct, "option": {"specVersion": "json-ld-1.1"} should be specified in manifest entry for e005 test.