There is a newer version of the record available.

Published May 13, 2014 | Version 1.0
Software Open

Unity: multi-syntax unit parsing

  • 1. University of Glasgow


This is the unity library, which is able to parse scientific unit specifications using a variety of syntaxes.

The library was written with the following goals:

  • Producing formal grammars of the existing and proposed standard unit syntaxes, for reference purposes.
  • Participating in the VOUnit standardisation process by acting as a locus for experimentation with syntaxes and proposed standards.
  • To that end, discovering edge cases and producing test cases.
  • Producing parsing libraries which are fast and standalone, and so could be conveniently used by other software; this will act as an implementation of the eventual VOUnits standard.  The distribution is buildable using no extra software beyond a Java and a C compiler.  It is also a goal that the distributed Java is source-compatible with Java 1.5 (though this isn't automatically tested, so bugreports are welcome).

It is not a goal for this library to do any processing of the resulting units, such as unit conversion or arithmetic.  Parsing unit strings isn't a deep or particularly interesting problem, but it's more fiddly than one might expect, and so it's useful for it to be done properly once.

A major goal of the VOUnits process is to identify a syntax for unit strings (called 'VOUnits') which is as nearly as possible in the intersection of the various existing standards.  The intention is that if file creators target the VOUnits syntax, the resulting string has a chance of being readable by as many other parsers as possible.  This isn't completely possible (the OGIP syntax doesn't allow dots as multipliers), but we can get close.

The contents of this upload are

  • : the repository code, as found at tag `1.0` of repository (note, this is the code repository as of mid-2022, when this upload was made; the location of the master repository has changed before and may change again)
  • unity-1.0-srcdist.tar.gz : the software distribution, as assembled from the repository code after some preprocessing
  • unity-1.0.jar : the executable jar file
  • and : the HTML versions of the documentation for the C and Java versions of the library


Files (1.4 MB)

Name Size Download all
177.3 kB Preview Download
88.8 kB Preview Download
539.4 kB Preview Download
442.3 kB Download
107.7 kB Download

Additional details

Related works

Technical note: 10.5479/ADS/bib/2014ivoa.spec.0523D (DOI)
Is derived from
Software: (URL)
Is referenced by
Software documentation: (URL)


EUROVO-ICE – Euro-VO International Cooperation Empowerment 261541
European Commission