Skip to content
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 context and frame #44

Open
VladimirAlexiev opened this issue Jul 4, 2022 · 7 comments
Open

YAML-LD context and frame #44

VladimirAlexiev opened this issue Jul 4, 2022 · 7 comments
Labels
UCR Issue on Use Case/Recommendation

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Jul 4, 2022

A YAML-LD Context defines the conversion of a YAML-LD document to RDF.
It should include:

A YAML-LD Frame, together with the context, defines the serialization of some RDF data to YAML-LD.
It should include:

@VladimirAlexiev VladimirAlexiev added the UCR Issue on Use Case/Recommendation label Jul 4, 2022
@VladimirAlexiev
Copy link
Contributor Author

VladimirAlexiev commented Jul 4, 2022

@ioggstream asked a relevant question in #42, so let's take a simple ACID test to see how people feel about this:

Should I as information provider be able to state in a standardized way:
"I want 3 spaces used for indentation in my YAML".
eg by specifying indent_spaces: 3 where this term resolves to eg https://w3c.github.io/yaml-ld/presentation#indent_spaces

Please vote with 👍 or 👎

@anatoly-scherbakov
Copy link
Contributor

If two YAML documents, one with 3 spaces and another with 4 spaces, are semantically equivalent, — why would we want this?

Also, I believe the indentation size can be easily changed using an auto formatter.

This is very similar to Python programming language which is also based on indentation.

@gkellogg
Copy link
Member

gkellogg commented Jul 4, 2022

JSON-LD does not say anything about the specifics of JSON encoding, other than ordering. Particularly, the treatment of whitespace.

IMO, as an RDF serialization, two documents are equivalent if they produce equivalent RDF C14N Hashes. Otherwise, getting into YAML C14N if fraught. Even JCS (JSON C14N) can result in different serializations if blank nodes are involved.

@VladimirAlexiev
Copy link
Contributor Author

JSON-LD says a lot about various JSON encodings of the same RDF model. Everything except the formatting.

YAML-LD should take all this from JSON-LD. But YAML is all about readability, so I think it should also address formatting.

@anatoly-scherbakov

  1. If semantic meaning is all that matters, why do we even bother with YAML-LD ? Let's stick with JSON-LD. A few extra quotes and brackets never hurt anyone, right?
  2. You could use a prettyprinter. Just like you could use other tools to convert between JSON representations. But that's not an argument why I should not be able to express how exactly I want my YAML to look.

Formatting does not matter to machines, but it matters to people.

@gkellogg
Copy link
Member

gkellogg commented Jul 4, 2022

A YAML-LD Frame, together with the context, defines the serialization of some RDF data to YAML-LD. It should include:

  • same as YAML-LD frame

JSON-LD frame?

Unless we want to describe a separate YAML-LD Framing algorithm, this may prove to be challenging. The JSON-LD Framing algorithm is quite complicated as it is. This gets into more general YAML-LD presentation issues from #42. IMO, we really need to either avoid such considerations within the spec, or define a single mechanism similar to the Compaction Algorithm that makes use of information in the context to perform presentation, but it seems like a violation of the separation of concerns principle.

@TallTed
Copy link
Contributor

TallTed commented Jul 5, 2022

YAML is all about readability, so I think it should also address formatting

Sure. YAML should also address formatting, and YAML-LD should simply inherit this from YAML.

@VladimirAlexiev
Copy link
Contributor Author

@gkellogg

Fixed same as JSON-LD frame.

maybe some anchor-related options, to handle shared and cyclic

The JSON-LD Framing algorithm is quite complicated as it is.

Let's continue this in #13

@TallTed

YAML should also address formatting, and YAML-LD should simply inherit this from YAML.

Ideally yes, and YAML-LD will just pick URLs for formatting terms.
Similarly for #43, we'll defer to yaml/yaml-spec#289 if and when resolved.
But if the YAML community is not active enough to do that, I think we should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UCR Issue on Use Case/Recommendation
Projects
None yet
Development

No branches or pull requests

4 participants