-
Notifications
You must be signed in to change notification settings - Fork 8
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
YAML-LD canonicalization (c14n) #43
Comments
@VladimirAlexiev I am not sure that YAML does not already provide something like that. I am not sure that's the most readable form, but did you ask to YAML folks? e.g. for scalar, there's https://yaml.org/spec/1.2.2/#canonical-form |
@ioggstream Added your point above. |
@VladimirAlexiev YAML repo or https://app.element.io/#/room/#chat:yaml.io After a brief investigation, I understood there's no easy fix for that - at least if we want to include aliases/anchors. |
The only use for YAML C14N I can see would be for a hypothetical YAML Literal (similar to JSON Literal). And as such, that would seem to be a spec to reference, not add to YAML-LD. As for standardizing the serialization of YAML-LD itself, I would be a 👎 on that, as it should not be necessary for conveying semantic meaning. Granted that people will want to create pretty YAML-LD output, but controls for that should be pass-through (IMO) and not required for interoperability. |
👍 I think that the c14n discussion can be managed in the YAML community (e.g. via element). I think there's some interest there. Note that c14n and readability might be different goals. @VladimirAlexiev I suggest to file an issue in the YAML repo so that if they come up with a solution we could reference it. |
The main use of JSON-LD c14n is for crypto signing and verifiable credentials of whole JSON-LD files.
Gregg, I don't understand your position: are you also against https://json-ld.github.io/rdf-dataset-canonicalization/spec/ and JSON Canonicalization Scheme (JCS)? Aren't the 2 use cases listed enough?
Of course they are not required. But:
Alias names cannot be preserved. But c14n can generate predictable aliases to achieve identical serialization.
Posted yaml/yaml-spec#289, added some more info, and referenced this issue. |
IIRC, VC uses RDF Dataset Canonicalization, which does not rely on JSON C14N (other than for JSON Literals) because of these issues, other than for JWT. Are you proposing a something congruent for JWT for YAML? I would favor sticking with the LD-friendly RDF C14N.
I would support some descriptive way of passing formatting options to a YAML serializer, but think it may be difficult to standardize on that, unless YAML normatively defines this, in which case we should just reference that, along with the ability to pass such controls on. I'm wary of defining a WebIDL API which is YAML-LD specific (although we may describe updates to any existing API methods to manage YAML serialization/deserialization). |
I do see a use case for YAML-LD for both VCs and DIDs... For example: Per the poor decisions of the DID WG, I have stripped In some future version there would be both: ... and their only difference would be an based on the convention set in DID Core v1... which as plagued by a complete lack of understanding with respect to JSON-LD. |
I just answered @TallTed's similar comment in #44 (comment).
You have a point: just like round-tripping can be seen at several different levels, so can c14n. I assume RDF c14n and JSON c14n are compatible (conformant to each other)? |
As an information architect.
I want no variation in YAML format for the same semantic content.
So that I can easily compare or sign YAML.
Canonicalization (also called c14n or normalization) is quite useful to enable the following use cases :
Prior art:
NOTE THAT this UCR is quite the opposite of #42. So if we cater to both:
c14n
style (cosmetic controls) to produce canonic YAMLThe text was updated successfully, but these errors were encountered: