-
Notifications
You must be signed in to change notification settings - Fork 34
The algorithm for processing a reverse term returns too early #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FTR PyLD 2.0.3 also provides the expected result |
niklasl
added a commit
to niklasl/json-ld-api
that referenced
this issue
Jun 7, 2023
gkellogg
pushed a commit
that referenced
this issue
Jul 20, 2023
zotanmew
added a commit
to zotanmew/dotnetrdf
that referenced
this issue
Mar 9, 2025
marcelotto
added a commit
to rdf-elixir/jsonld-ex
that referenced
this issue
Mar 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In section 4.2 Create Term Definition of the Context Processing Algorithms, step 13, processing a reverse term ends with:
But with that early return, the algorithm stops processing a reverse term definition here, and thus reverse terms will not use any compaction features captured in the subsequent steps (step 19 and onward); e.g. indexed containers).
Thus this example:
which should expand to:
instead results in:
since the term definition of
statement
is missing what term to use when interpreting the@index
value.The fix is simple: remove "and return" from the end of step 13, and revise step 14 to begin with "Otherwise".
This is consistent with playground and distiller behaviour, and by looking at implementation, e.g. the ruby implementation does not return early.
I have a fix for TRLD to reflect the above (applying that, example output changed accordingly to the expected behaviour).
The text was updated successfully, but these errors were encountered: