w3c / json-ld-api

JSON-LD 1.1 Processing Algorithms and API Specification
https://w3c.github.io/json-ld-api/
Other
73 stars 29 forks source link

Fix context processing for reverse terms #566

Closed niklasl closed 11 months ago

niklasl commented 1 year ago

This changes the algorithm for processing a reverse term so that it doesn't return early. Fixes #565.

Includes one test for expansion using a reverse term with @container: @index and @index set to a property, and a roundtripping compaction test based on the former.

(Note: the round-tripping compaction test reuses the expand test data. That does not seem to be the practise; is there any rationale against that?)


Preview | Diff

davidlehn commented 1 year ago

Does this need parallel toRdf tests too? t0131 is not going to line up between expand/toRdf since there already exists some toRdf tests over 0130. Not sure if some other prefix would be better here for that reason alone.

gkellogg commented 1 year ago

Yes to @davidlehn’s points. Also, there should be an entry in the “changes since Recommendation …” section.

niklasl commented 1 year ago

Yes to @davidlehn’s points. Also, there should be an entry in the “changes since Recommendation …” section.

Added an entry about this change in 8bfdf285ef6836cb80534ac2f8da95c9cc644bf6.

niklasl commented 1 year ago

Does this need parallel toRdf tests too? t0131 is not going to line up between expand/toRdf since there already exists some toRdf tests over 0130. Not sure if some other prefix would be better here for that reason alone.

Added toRdf#t0133 in fb521b7dc7f52986d41e17c8b64ae362bbcd79bb.

The numbering of "non-prefixed" toRdf tests don't seem to correlate with neither expand nor compact test numbering, so I just continued on the non-prefixed sequence rather than using any "prefix". (The "prefixed" ones did seem to correlate, but I didn't see any obvious naming to use.)

niklasl commented 1 year ago

Note that I added textual references in the purpose text to the original expand test id. We should consider adding proper interlinking of all tests instead, so we can query on what is based on what, and if there are any missing round-trip or to/from RDF tests. That would be a separate task of course.