$Id: README,v 1.19 2002-11-18 14:41:02 mike Exp $ cql-java - a free CQL compiler, and other CQL tools, for Java INTRODUCTION ------------ cql-java is a Free Software project that provides: * 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) * A random query generator, useful for testing. CQL is "Common Query Language", a new query language designed under the umbrella of the ZING initiative (Z39.59-International Next Generation). More 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. More information at http://www.loc.gov/z3950/agency/zing/cql/xcql.html include an XML Schema. But if you didn't know that, why are you even reading this? :-) What's what in this distribution? README This file VERSION The version-number of this distribution src Source-code for the cql-java library lib The compiled library file, "cql-java.jar" bin Simple shell-scripts to invoke the test-harnesses docs Documentation automatically generated by "javadoc" test Various testing and sanity-checking frameworks etc Other files: CQL Grammar, generator properties, etc. "Installation" of this package would consist of putting the bin directory on your PATH and lib/cql-java.jar on your CLASSPATH. SYNOPSIS -------- Using the test-harnesses: $ CQLParser 'title=foo and author=(bar or baz)' $ CQLParser -c 'title=foo and author=(bar or baz)' $ CQLParser -p /etc/pqf.properties 'title=foo and author=(bar or baz)' $ CQLLexer 'title=foo and author=(bar or baz)' (not very interesting unless you're debugging) $ CQLGenerator etc/generate.properties seed 18 Using the library in your own applications: import org.z3950.zing.cql.* // Building a parse-tree by hand CQLNode n1 = new CQLTermNode("dc.author", new CQLRelation("="), "kernighan"); CQLNode n2 = new CQLTermNode("dc.title", new CQLRelation("all"), "elements style"); CQLNode root = new CQLAndNode(n1, n2); System.out.println(root.toXCQL(0)); // Parsing a CQL query CQLParser parser = new CQLParser(); CQLNode root = parser.parse("title=dinosaur"); System.out.print(root.toXCQL(0)); System.out.println(root.toCQL()); System.out.println(root.toPQF(config)); // ... where `config' specifies CQL-qualfier => Z-attr mapping DESCRIPTION ----------- See the automatically generated class documentation in the "doc" subdirectory. AUTHOR ------ All code and documentation by Mike Taylor http://www.miketaylor.org.uk Please email me with bug-reports, wishlist items, patches, deployment stories and, of course, large cash donations. LICENCE ------- The cql-java suite is Free Software, which is legally -- though not morally -- equivalent to Open Source. See http://www.gnu.org/philosophy/free-software-for-freedom.html for a detailed if somewhat one-sided discussion of the differences, and particularly of why Free Software is an important idea. cql-java is distributed under version 2.1 of the LGPL (GNU LESSER GENERAL PUBLIC LICENSE). A copy of the licence is included in this distribution, as the file LGPL-2.1. This licence does not allow you to restrict the freedom of others to use derived versions of cql-java (i.e. you must share your enhancements), but does let you deploy cql-java as a part of a non-free larger work. SEE ALSO -------- Adam Dickmeiss's CQL compiler, written in C. Rob Sanderson's CQL compiler, written in Python. All the other free CQL compilers everyone's going to write :-) The "Changes" file, including the "Still to do" section.