Units discussion

Norman Gray norman at astro.gla.ac.uk
Sun Jan 29 11:45:32 PST 2012


Markus and all, hello.

On 27 Jan 2012, at 15:23, Markus Demleitner wrote:

> [quoting Norman on the wiki page:]
> 
> # One possibility is that we should aim for a minimal grammar (in which
> # case the CDS grammar is probably the most nearly minimal of the
> # three), or a lenient but still well-defined one (in which case the
> # FITS covers almost all bases, even though it's not a strict superset
> # of the others). I'd push for the latter: it's well-defined, but most
> # nearly compatible with everyone, plus it's flexible enough that
> # people don't have to try to memorise what is and isn't permitted
> # (principle of least surprise).
> 
> I, on the other hand, maintain that having a simple grammar that
> uniquely defines how a given unit is expressed is preferable on
> grounds that VOUnits is, in effect, part of the VOTable spec, and
> people will, as soon as they do anything with the units at all, need
> to throw around parse trees (e.g.: unifying values in different units
> from two different tables).  The less flamboyant the things they have
> to expect are the better.
> 
> True, a parser library can help providing a unified interface here,
> but if we can keep the standard so simple that almost any kind of
> parser library will do the trick, even better, no?

I don't think there's a big problem here.  Looking at the current grammar files <http://www.astro.gla.ac.uk/users/norman/ivoa/unity/grammar/>, the three grammars are pretty similar, at 24, 26 and 27 lines long, ignoring comments and blank lines, and the differences are pretty minor.  The three grammars differ in what tokens they accept (FITS accepts '^' and '**' as power indicators, OGIP and CDS accept only '**', and the multiplication operator is '.' for CDS, space or  '*' for OGIP, and space, '*' or '.' for FITS.

The main difference is the list of units that they recognise.  Again, FITS is the most lenient, but I've already run into units you'd reasonably have in a RDBMS schema which aren't in there, so I plan to have an alternate syntax in the unity library which has a very generous set of units.

> That some services may have to rework their units seems, in
> comparison, a small price to pay, even more so since they only have
> to write and run the conversion software once (as opposed to VOTable
> clients having to understand all kinds of syntaxes everytime they
> parse a unit, in every VOTable library).

I'm interested in serving the latter case, too, with the unity library.

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk



More information about the semantics mailing list