-
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
Multiple documents in YAML #46
Comments
Some notes: a. Theoretically speaking
In python, when you parse a stream containing multiple documents b. not sure the eg2 provided above is valid yaml. |
In python, when you parse a stream containing multiple documents
In kubernetes, multiple YAML documents are bundled together Another example could be bundling in a single file different related
As different JSON-LD documents related between them
Aren't they always RDF graphs?
I see it more as a bundling method. The complexity lies inside each document. WDYT? |
Does it look better now?
But how can we relate documents?
I agree they should be graphs. Then we need:
Eg this {"@context": {"@base": "http://example.org", "@vocab":"http://example.org/",
"spouse":{"@type":"@id"},"statedIn":{"@type":"@id"}},
"@id": "#bart", "spouse": "#marge", "statedIn": ""} results in these triples (not quads) <http://example.org#bart> <http://example.org/spouse> <http://example.org#marge> .
<http://example.org#bart> <http://example.org/statedIn> <http://example.org> . |
My two cents about
A few examples of software that supports YAML front matter for Markdown documents:
I am using this format to source YAML-LD from the front matter. However, this is not valid YAML and thus I do not believe it applies to the question at hand. Does it? |
JSON-LD-API has some options and descriptions for processing multiple script elements within an HTML document using |
@anatoly-scherbakov I thought the second doc consists of one long string? But that would require some quoting or escaping, else colons and dashes at BOL will throw it off. |
@VladimirAlexiev @gkellogg this will be mainly addressed in ietf-wg-httpapi/mediatypes#55 Thanks for this issue: without this the YAML media type would have missed this piece. @anatoly-scherbakov wrt the document in the example is valid like @VladimirAlexiev said. s=("""---
title: My Cat
tags:
- article
- pets
---
My cat is the most handsome cat in the whole world.
""")
for d in yaml.safe_load_all(s):
print(d) |
Should YAML-LD allow or prohibit multiple documents in YAML?
PLEASE VOTE with 👍 or 👎 , thanks!
Eg1: multiple identical keys are forbidden by YAML linters.
But they are ok if they are in different documents.
Example by @ioggstream from #42 (comment):
Eg2: YAML metadata followed by a markdown textual body is widely used in some blog/content management systems:
As an information architect.
I want to be able to use multiple documents in YAML-LD.
So that I can transmit several closely related documents (graphs) together.
The text was updated successfully, but these errors were encountered: