pyld icon indicating copy to clipboard operation
pyld copied to clipboard

PyLD incorrectly detects circular contexts in scoped context processing

Open azaroth42 opened this issue 7 years ago • 0 comments

Summary:

When processing scoped contexts, PyLD errors when a remote context has already been seen at a higher scope, when this is not an error in JSON-LD 1.1. See: https://github.com/w3c/json-ld-api/issues/14#issuecomment-432695248 And playground link demonstrating it working in Javascript: http://tinyurl.com/yayh6e74

Current Behavior:

Exhibited in: https://raw.githubusercontent.com/w3c/json-ld-api/recursive-test/tests/recursive/process.py

When context A refers to context B within a scope, and context B refers to context A in a scope, then processing terminates with the error:

Type: jsonld.ExpandError
Cause: ('Cyclical @context URLs detected.',)

These are not actually cyclical, as the scoping behaves as if the @context definition was inline in the instance data.

Expected Behavior:

The scoped contexts should be processed without the Cyclical error.

Test Data:

  • Instance: https://raw.githubusercontent.com/w3c/json-ld-api/recursive-test/tests/recursive/manifest-1.json
  • Context A: https://rawgit.com/w3c/json-ld-api/recursive-test/tests/recursive/presentation.json
  • Context B: https://raw.githubusercontent.com/w3c/json-ld-api/recursive-test/tests/recursive/image.json

azaroth42 avatar Oct 24 '18 15:10 azaroth42