CQL-Java is a CQL compiler written in Java. As well as the compiler itself, it includes classes representing CQL queries as abstract trees of variously typed nodes, a decompiler (translating trees back into CQL), a translator into YAZ-style Prefix Query Format and a random query generator which is useful for some kinds of testing.
- A set of classes for representing a CQL parse tree (a base CQLNode class, CQLBooleanNode and its subclasses, CQLTermNode, etc.)
- A CQLCompiler class (and its lexer) which builds a parse tree given a CQL query as input.
A selection of compiler back-ends to render out the parse tree as:
- XCQL (the standard XML representation)
- CQL (i.e. decompiling the parse-tree)
- PQF (Yaz-style Prefix Query Format)
- BER code for the Z39.50 Type-1 query
- A random query generator, useful for testing.
CQL is "Common Query Language", a query language designed under the umbrella of the ZING initiative (Z39.59-International Next Generation). The official specification is on a Library of Congress web page. Mike Taylor has created additional (and friendlier) information at http://zing.z3950.org/cql/index.html.
XCQL is "XML CQL", a representation of CQL-equivalent queries in XML which is supposed to be easier to parse. The specification is at http://www.loc.gov/standards/sru/xml-files/xcql.xsd in the form of an XML Schema.