-
Notifications
You must be signed in to change notification settings - Fork 34
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
Compaction cannot round-trip terms using @container: @list
and @type: @vocab
#558
Comments
Presumably, the problem lies in the term selection algorithm, rather than the compaction algorithm itself. Are there some specific errata that should be raised against the spec? |
I thought so too, but term selection does provide the necessary structure to make compaction work in this case. It just isn't used for contained list values (it is only checked with the list object itself). In the TRLD fix for this I addressed this by:
I do believe this ought to be raised as an errata against the spec, yes. While I think this fix ought to be enough, I'd love to have more eyes on it. If we agree on this solution, I can make a PR to the spec reflecting the change. |
We've been holding off on making normative updates, in case we want to publish an update with editorial changes only. But, highlighting the proposed updates in the issue, would be great. Compaction of list items is indeed a shortcoming, as is framing lists. Not sure it's an erratum, though, as it's not an error by design, but definitely something that should be considered for future normative updates. |
This was discussed during the #json-ld meeting on 12 February 2025. View the transcriptw3c/json-ld-api#558<gb> Issue 558 Compaction cannot round-trip terms using ` bigbluehat: niklasl, this one is yours. No activity in the past 2 years (almost exactly). <niklasl> niklasl/trld@1190a25 niklasl: I have a proposal about what to do. I have refactored my implementation accordingly. bigbluehat: niklasl, would you be willing to write a PR for that? niklasl: yes, I can try bigbluehat: this needs to be wrapped in <ind>/<del> tags, like the other PRs we have. |
The following compact data expands as expected to a
@list
of vocabulary term IRIs:However, when compacting the results using the same context, the JSON-LD 1.1 algorithm fails to produce the same compact form.
Here is the above example and the problematic compaction behaviour in the playground.
There are many use cases where a compact form of the combination of
@container: @list
and@type: @vocab
is useful, such as when expressing anowl:unionOf
or a owl:propertyChainAxiom, a FRESNEL lens or various expressions in ShEx and SHACL .I have implemented a fix for this in TRLD. As this implementation strives to follow the specification algortihm, these changes ought to be fairly easy to apply in the specification too (adjusting some prose, and introducing a new section for the new sub-algorithm).
The text was updated successfully, but these errors were encountered: