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 diagram: allow "objects as keys" #1079

Open
VladimirAlexiev opened this issue Aug 10, 2022 · 1 comment
Open

YAML diagram: allow "objects as keys" #1079

VladimirAlexiev opened this issue Aug 10, 2022 · 1 comment

Comments

@VladimirAlexiev
Copy link
Contributor

Unlike JSON, YAML keys are not limited to strings, but can be objects.

json-ld/yaml-ld#45 discusses using this for RDF-star, which allows putting annotations on statements.
Here are 2 examples. I use the JSON-like "flow" notation (YAML is really an extension of JSON), if needed I'll restate it in "block" notation:

  • {$id: bob, age: 42}: {certainty: 0.8, source: Newspaper-1}: "Bob's age is 42, with a certainty of 0.8, as stated in a Newspaper"
  • {{$id: bob, knows: {$id: alice}}: {certainty: 0.8}}: {claims: ted}: Ted claims that the certainty of Bob knowing Alice is 0.8"

I have zero drawing skills but I'll describe how I'd like the second example to be drawn:

  • draw {$id: bob, knows: {$id: alice}} as usual and put it in a box
  • draw a line from the first box to a second box with {certainty: 0.8}
  • put both in a bigger box
  • draw a line from the big box to a fourth box with {claims: ted}
@mfhepp
Copy link

mfhepp commented Aug 10, 2022

This could be useful for many typical needs in the context of ontology documentation, Linked Open Data, Knowledge Graphs, etc.!

However, note that in the original YAML-LD issue, there are objections against this proposal, too, claiming that there is already a proper way to express this in YAML-LD, see @gkellogg in json-ld/yaml-ld#45 (comment).

So before moving this forward, it would be good to know if there are use cases for this in plain YAML beyond this extension proposal for YAML-LD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants