Re: yaml-ld?

Yeah, YAML is much better for hand editing, but I don't see a place for it
becoming an actual part of the spec for either a wire or data-at-rest
format. The content negotiation would be annoying: while I think requesting
http://example.com/foo.yml with a Content-Type of application/ld+json is
not crazy, I don't know a way to do that out of the box with, say, nginx...
so that would put it back on the client to able to parse the yaml off the
wire. I don't think you'd see this built into any of the "canonical"
parsers, so i don't think you could rely on using a yml endpoint for a
@context. OTOH, I could see a parser creating a hookable system that would
let a user do this... but that's none of my business :)

However, as to supporting YAML as an editing format in the playground:
sounds great! I've been mulling over a few concepts like that: they usually
end up looking like noflo, but there's must be something simpler than that.
Overall, i think the playground could stand some fairly significant
rearchitecting, while remaining backwards URL-compatible.

Abstracting the modes of the playground into some "blocks" that could be
recombined to create the current matrix of modes would give you:
- raw editing document (i.e. current codemirror), publishes, well, text
- load text (url to text... though this would also own content negotiation,
so might take over some parts of parsing)
- parse text into a JSON in-memory object (i.e. the JSON.parses scattered
all over, here's where YAML would go1)
- JSON-LD verbs (e.g. compact, expand, ...)

Underneath, gist persistence! Write the playground state out as some
JSON-LD, push it up and Gist would give you not only storage, history,
forkability.. but also built-in in-line comments, linkable URL lines, etc.

On Thu, Jan 22, 2015 at 1:05 PM, David I. Lehn <dil@lehn.org> wrote:

> On Thu, Jan 22, 2015 at 11:03 AM, peter <peter.amstutz@curoverse.com>
> wrote:
> > Has anyone tried using yaml (http://www.yaml.org/) as an alternate
> > serialization to express json-ld structured data?  Are there any
> > pitfalls to this approach?
> >
>
> Sometimes I convert between JSON-LD to YAML just because YAML is
> usually more compact and easier to read and write.  It's easy to
> convert back and forth.  One pitfall is that unfortunately you do need
> to quote all the keywords starting with '@'.  I've just used the basic
> syntax but more advanced features like types and linking could
> probably be used to do interesting things.  I have wanted to add YAML
> input/output support to the playground but haven't found time to do
> it.
>
> -dave
>
>

Received on Thursday, 22 January 2015 20:15:23 UTC