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

Include YAML as well as JSON #35

Open
Zarquan opened this issue Dec 15, 2023 · 4 comments
Open

Include YAML as well as JSON #35

Zarquan opened this issue Dec 15, 2023 · 4 comments

Comments

@Zarquan
Copy link
Member

Zarquan commented Dec 15, 2023

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.

@Zarquan
Copy link
Member Author

Zarquan commented Dec 15, 2023

(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.

@Zarquan
Copy link
Member Author

Zarquan commented Dec 15, 2023

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

See VOTable#54 and VOTable#55

@Zarquan
Copy link
Member Author

Zarquan commented Dec 16, 2023

(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.

@msdemlei
Copy link
Contributor

msdemlei commented Dec 18, 2023 via email

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