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
W3C YAML-LD #125
Comments
From https://json-ld.github.io/yaml-ld/spec/#example-convenience-context ::
{
"@context": {
"$base": "@base",
"$container": "@container",
"$direction": "@direction",
"$graph": "@graph",
"$id": "@id",
"$import": "@import",
"$included": "@included",
"$index": "@index",
"$json": "@json",
"$language": "@language",
"$list": "@list",
"$nest": "@nest",
"$none": "@none",
"$prefix": "@prefix",
"$propagate": "@propagate",
"$protected": "@protected",
"$reverse": "@reverse",
"$set": "@set",
"$type": "@type",
"$value": "@value",
"$version": "@version",
"$vocab": "@vocab"
}
}
|
How should yamlfmt format YAML-LD YAML documents?
|
Hi @westurner thanks for the feature request. This sounds like it deviates heavily enough from a normal yaml document that it should likely be implemented as a separate formatter that the user can choose to use instead of the current I will not have time to implement this any time soon unfortunately, but if anyone in the community wanted to I am happy to help explain how to design it to satisfy the interface and hook into the rest of |
TBH IDK when I'll have time for this priority either.
Are there links to sources that would help?
How should the CLI args work (there are probably addl YAML-LD args beyond
--formatter=yamlld; rdfpipe supports a few but pyld is the python reference
implementation of JSON-LD and it has tests for CLI args IIRC)
…On Sun, Jul 16, 2023, 9:50 PM Braydon Kains ***@***.***> wrote:
Hi @westurner <https://github.com/westurner> thanks for the feature
request. This sounds like it deviates heavily enough from a normal yaml
document that it should likely be implemented as a separate formatter that
the user can choose to use instead of the current basic one.
I will not have time to implement this any time soon unfortunately, but if
anyone in the community wanted to I am happy to help explain how to design
it to satisfy the interface and hook into the rest of yamlfmt (I don't
have any developer docs yet only user ones).
—
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMNS3NGHBTPGPWOXRN3ATXQSK6VANCNFSM6AAAAAA2LLKEMY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It depends what kind of help you'll need. If it's about actually implementing the formatter interface, I have not actually documented how it works but I don't think it's too tough. Development docs have always been low priority cause I haven't had anyone trying to use the libs a whole lot yet (at least that I've heard about). I am happy to help guide how to do that, and it'll help me actually write some docs along the way too. Unfortunately I don't know much about YAML-LD; had never heard of it before you opened this issue here 😄 If it will require a new parser due to some difference in YAML-LD syntax, then it would be best implemented as a separate formatter that used its own parser. This ends up just getting down to how to write parsers in general. There are 2 solid yaml libraries in Go, The way formatter options work in general is that they are completely independent of each other. So a hypothetical Hopefully this helps a bit, I'm happy to connect directly if you or anyone else wanted to take this work on. |
There probably doesn't need to be a new parser just to normalize quoting, optionally replace With standard ASCII (and thus also Unicode) collation, IIRC (Also, FWIW, Gmail mobile and Gmail web have different collation orders for sorting labels; |
If the YAML-LD can properly conforms to YAML 1.1 spec then it's possible to do this in the existing formatter and do the transformations on the |
STORY: Users can reformat YAML-LD with yamlfmt per the YAML-LD/JSON-LD guidelines.
The text was updated successfully, but these errors were encountered: