ivoa-std/DALI

Include YAML as well as JSON

Opened this issue · 4 comments

As part of the group looking at updating our standards to move away from XML I propose we adopt the following code of practice for all our standards.

Wherever we propose a change to handle JSON we MUST also include an equivalent change to handle YAML.

For example in our discussion about xtype="json"(#33), we MUST also include the same functionality to handle xtype="yaml".

This doesn't add much more complexity, but it forces us think about making our standards serialization agnostic, rather than just moving from one fixed serialization to another.

(a) nobody's asking us for that,

I am, precisely because it forces us to think outside the box.

(b) there's no database column type named "yaml" (though admittedly
you could serialise the content of jsonb columns as yaml -- but
why would you do that?)

Is there a hard link between xtype and the database column type ?

Are we suggesting that if a client creates a VOTable containing a column with xtype="json", a database MUST store this as a native JSON column or reject a TAP upload ?

If we allow databases that don't have support for native JSON to store xtype="json" as VARCHAR(), then we should also allow the same for xtype="yaml".

(d) yaml support, while widespread, still is a lot more limited
that json support (e.g., no module in the Python standard
library), and

There is no standard library for JSON in Java. Implementations have to import an external library for it, but that hasn't stopped people claiming JSON is a must have.

Most Java developers use the Jackson libraries, which include support for several serializations including JSON, XML and YAML.

(e) yaml uses whitespace for grammar. In theory, VOTable preserves
whitespace (by virtue of TD being xs:string even in TABLEDATA).
In practice, given XML prettyprinters and all that, I'd rather
not bet on it.

Claiming we can't handle YAML because our standard is tied to an old XML schema that doesn't preserve spaces is
exactly the kind of thing this issue is intended to make us think about.

We should see this as a reason for to update the VOTable standard to preserve spaces, not a reason to avoid new things because we are stuck with an old XML schema.

We should see this as a reason for to update the VOTable standard to preserve spaces

See VOTable#54 and VOTable#55

(e) yaml uses whitespace for grammar. In theory, VOTable preserves
whitespace (by virtue of TD being xs:string even in TABLEDATA).
In practice, given XML prettyprinters and all that, I'd rather
not bet on it.

You are right, this could happen - I didn't read your comment carefully enough.