Re: Reg: PyYAML grammar

Oren Ben-Kiki <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
There hasn't been much work on YAML schemas. There is an issue here that
people mean different things when they say "schema" and "validation".

If you are looking for validating your specific input files in your specific
application, YAML is very well suited for that. A minimal amount of !tag-ing
combined with some implicit tagging rules, plus adding verification code in
the matching classes in your favorite implementation language, and you are
all set for as strong (or as weak) a verification as you want. This is what
most people do.

If you are looking for a generic "validate a data file with a schema file"
ability. There's no such thing for YAML, perhaps because it isn't that
useful in practice after all...

The same arguments can be made about JSON, except there you are completely
at the mercy of "implicit" tagging, and the whole notion of deserialization
into your application classes is an afterthought rather than being an
inherent part of the spec.

Binary encoding... sorry. YAML is first and foremost about readability.
Sure, you can produce pretty dense (and unreadable) YAML files using the
flow styles (think JSON but with the !tag-ing, such as [!foo{bar: baz}].
That's not _too_ bad size-wise, as long as all your data is textual anyway -
and you can zip it for additional shrinkage. If you have true binary data
(e.g., a PNG image), you'd need to base-64 it, and zipping the result would
only help so far... YAML really wasn't designed for this sort of thing.

Have fun,

    Oren Ben-Kiki

On Fri, Jun 10, 2011 at 9:52 PM, Paul Lambert <[email protected]> wrote:

> So … I’ve only recently joined and been tracking this list, so please
> excuse what might be off-topic.
>
>
>
> I’m working on a security standard and trying to use YAML.  However, I need
> a schema – not to enforce a schema on YAML, but  primarily to be able to
> describe in YAML subsets of a possible schema.
>
>
>
> The standard is focused on describing “who can do what”. Who is
> cryptographic, what can be objects describable in YAML.  Delegation requires
> the ability to define set of information within a schema.
>
>
>
> I’ve looked at Doctrine – it’s close but not quite what I need. Are there
> other efforts in place that could be leveraged?
>
>
>
> I’m also looking at stronger typing and binary encoding (akin to
> Protobuf).  The use of schemas, strong types and alternate encodings may be
> contrary to YAML culture and goals (of staying simple).  Is YAML the right
> choice in this context or should I just start something new that is
> YAML-like?
>
>
>
> Thanks in advance,
>
>
>
> Paul
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Yaml-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/yaml-core
>
>

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.