1 $Id: README,v 1.3 2002-10-25 07:38:16 mike Exp $
3 cql-java -- a free CQL compiler for Java
6 This project provides a set of classes for representing a CQL parse
7 tree (CQLBooleanNode, CQLTermNode, etc.) and a Compiler class which
8 builds a parse tree given a CQL query as input. It also provides
9 compiler back-ends to render out the parse tree either as XCQL or
10 Yaz-style Prefix Query Format (PQF).
12 CQL is "Common Query Language", a new query language designed under
13 the umbrella of the ZING initiative (Z39.59-International Next
14 Generation). More information at
15 http://zing.z3950.org/cql/index.html
17 XCQL is "XML CQL", a representation of CQL-equivalent queries in XML
18 which is supposed to be easier to parse. More information at
19 http://www.loc.gov/z3950/agency/zing/srwu/xcql.html
20 (not much more, though)
22 But if you didn't know that, why are you even reading this? :-)
30 $ echo "foo and (bar or baz)" | java org.z3950.zing.cql.CQLParser
34 import org.z3950.zing.cql.*
36 // Building a parse-tree by hand
37 CQLNode n1 = new CQLTermNode("dc.author", "=", "kernighan");
38 CQLNode n2 = new CQLTermNode("dc.title", "all", "elements style");
39 CQLNode root = new CQLAndNode(n1, n2);
40 System.out.println(root.toXCQL(3));
42 // Parsing a CQL query
43 CQLParser parser = new CQLParser();
44 CQLNode root = parser.parse("title=dinosaur");
45 System.out.println(root.toXCQL(0));
46 System.out.println(root.toCQL());
47 System.out.println(root.toPQF(qualSet));
48 // ... where `qualSet' specifies CQL-qualfier => Z-attr mapping
54 Se the automatically generated class documentation in the "doc"
55 subdirectory. (### It's not there yet, of course)
61 Mike Taylor <mike@z3950.org>
62 http://www.miketaylor.org.uk
68 This software is open source, but I've not yet decided exactly what
69 licence to use. Be good. Assume I'm going with the GPL (most
70 restrictive) until I say otherwise.
76 Adam Dickmeiss's CQL compiler, written in C.
77 Rob Sanderson's CQL compiler, written in Python.
78 All the other free CQL compilers everyone's going to write.