1 $Id: README,v 1.20 2002-11-18 15:05:49 mike Exp $
3 cql-java - a free CQL compiler, and other CQL tools, for Java
9 cql-java is a Free Software project that provides:
11 * A set of classes for representing a CQL parse tree (a base CQLNode
12 class, CQLBooleanNode and its subclasses, CQLTermNode, etc.)
13 * A CQLCompiler class (and its lexer) which builds a parse tree given
15 * A selection of compiler back-ends to render out the parse tree as:
16 * XCQL (the standard XML representation)
17 * CQL (i.e. decompiling the parse-tree)
18 * PQF (Yaz-style Prefix Query Format)
19 * A random query generator, useful for testing.
21 CQL is "Common Query Language", a new query language designed under
22 the umbrella of the ZING initiative (Z39.59-International Next
23 Generation). More information at
24 http://zing.z3950.org/cql/index.html
26 XCQL is "XML CQL", a representation of CQL-equivalent queries in XML
27 which is supposed to be easier to parse. More information at
28 http://www.loc.gov/z3950/agency/zing/cql/xcql.html
29 include an XML Schema.
31 But if you didn't know that, why are you even reading this? :-)
34 What's what in this distribution?
37 VERSION The version-number of this distribution
38 src Source-code for the cql-java library
39 lib The compiled library file, "cql-java.jar"
40 bin Simple shell-scripts to invoke the test-harnesses
41 docs Documentation automatically generated by "javadoc"
42 test Various testing and sanity-checking frameworks
43 etc Other files: CQL Grammar, generator properties, etc.
45 "Installation" of this package would consist of putting the bin
46 directory on your PATH and lib/cql-java.jar on your CLASSPATH.
52 Using the test-harnesses:
54 $ CQLParser 'title=foo and author=(bar or baz)'
55 $ CQLParser -c 'title=foo and author=(bar or baz)'
56 $ CQLParser -p /etc/pqf.properties 'title=foo and author=(bar or baz)'
57 $ CQLLexer 'title=foo and author=(bar or baz)'
58 (not very interesting unless you're debugging)
59 $ CQLGenerator etc/generate.properties seed 18
61 Using the library in your own applications:
63 import org.z3950.zing.cql.*
65 // Building a parse-tree by hand
66 CQLNode n1 = new CQLTermNode("dc.author", new CQLRelation("="),
68 CQLNode n2 = new CQLTermNode("dc.title", new CQLRelation("all"),
70 CQLNode root = new CQLAndNode(n1, n2);
71 System.out.println(root.toXCQL(0));
73 // Parsing a CQL query
74 CQLParser parser = new CQLParser();
75 CQLNode root = parser.parse("title=dinosaur");
76 System.out.print(root.toXCQL(0));
77 System.out.println(root.toCQL());
78 System.out.println(root.toPQF(config));
79 // ... where `config' specifies CQL-qualfier => Z-attr mapping
85 See the automatically generated class documentation in the "doc"
92 All code and documentation by Mike Taylor <mike@z3950.org>
93 http://www.miketaylor.org.uk
94 Please email me with bug-reports, wishlist items, patches, deployment
95 stories and, of course, large cash donations.
101 The cql-java suite is Free Software, which is pretty much legally
102 equivalent -- though not morally equivalent -- to Open Source. See
103 http://www.gnu.org/philosophy/free-software-for-freedom.html
104 for a detailed if somewhat one-sided discussion of the differences,
105 and particularly of why Free Software is an important idea.
107 cql-java is distributed under version 2.1 of the LGPL (GNU LESSER
108 GENERAL PUBLIC LICENSE). A copy of the licence is included in this
109 distribution, as the file LGPL-2.1. This licence does not allow you
110 to restrict the freedom of others to use derived versions of cql-java
111 (i.e. you must share your enhancements), but does let you deploy
112 cql-java as a part of a non-free larger work.
118 Adam Dickmeiss's CQL compiler, written in C.
119 Rob Sanderson's CQL compiler, written in Python.
120 All the other free CQL compilers everyone's going to write :-)
121 The "Changes" file, including the "Still to do" section.