json-ld-api
json-ld-api copied to clipboard
Add JSON literal tests.
- Various tests of when
@typeof@jsonis used, the JSON may be an array, and the interaction with a@containerof@setand@list. - Change compaction output for
@jsonand@setwith a JSON array. - Add test for many other possibilities and processing algorithms.
- Propose new
multiple JSON literalserror code when trying to add multiple JSON literals as values for a property not declared a@set.
NOTE: This is a work-in-progress that needs feedback. HTML rebuild has not yet been done.
Please put major discussion in the issue that links here as this PR may need to be replaced.
Some of these assume changes to the algorithms that will need their own PRs:
- Tests expand/er57 and er58 along with toRdf/er57 and er58 need a check to be sure that the value is an array, or generate the
invalid set or list objecterror. The presumed semantics are that each array value becomes its own JSON value. - Test compact/ej01 is expected to raise
multiple JSON literalsbecause the term didn't use@set. This is arguably a breaking change as any data that did this before would now fail (of course two JSON values on input would now be one JSON value on output). This will certainly require checks in the compaction algorithm. - Test compact/js07 (and others) also change the behavior to preserve the array value.
Addresses #560.