- Remove the redundant and misleading etc/Grammar file.
[cql-java-moved-to-github.git] / README
1 $Id: README,v 1.21 2002-11-20 09:49:28 mike Exp $
2
3 cql-java - a free CQL compiler, and other CQL tools, for Java
4
5
6 INTRODUCTION
7 ------------
8
9 cql-java is a Free Software project that provides:
10
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
14   a CQL query as input.
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.
20
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).  The official specification is at
24         http://www.loc.gov/z3950/agency/zing/cql/cql-syntax.html
25 and there's more (and friendlier) information at
26         http://zing.z3950.org/cql/index.html
27
28 XCQL is "XML CQL", a representation of CQL-equivalent queries in XML
29 which is supposed to be easier to parse.  The specification is at
30         http://www.loc.gov/z3950/agency/zing/cql/xcql.html
31 and includes an XML Schema.
32
33 But if you didn't know that, why are you even reading this?  :-)
34
35
36 What's what in this distribution?
37
38         README  This file
39         VERSION The version-number of this distribution
40         src     Source-code for the cql-java library
41         lib     The compiled library file, "cql-java.jar"
42         bin     Simple shell-scripts to invoke the test-harnesses
43         docs    Documentation automatically generated by "javadoc"
44         test    Various testing and sanity-checking frameworks
45         etc     Other files: CQL Grammar, generator properties, etc.
46
47 "Installation" of this package would consist of putting the bin
48 directory on your PATH and lib/cql-java.jar on your CLASSPATH.
49
50
51 SYNOPSIS
52 --------
53
54 Using the test-harnesses:
55
56         $ CQLParser 'title=foo and author=(bar or baz)'
57         $ CQLParser -c 'title=foo and author=(bar or baz)'
58         $ CQLParser -p /etc/pqf.properties 'title=foo and author=(bar or baz)'
59         $ CQLLexer 'title=foo and author=(bar or baz)'
60                 (not very interesting unless you're debugging)
61         $ CQLGenerator etc/generate.properties seed 18
62
63 Using the library in your own applications:
64
65         import org.z3950.zing.cql.*
66
67         // Building a parse-tree by hand
68         CQLNode n1 = new CQLTermNode("dc.author", new CQLRelation("="),
69                                      "kernighan");
70         CQLNode n2 = new CQLTermNode("dc.title", new CQLRelation("all"),
71                                      "elements style");
72         CQLNode root = new CQLAndNode(n1, n2);
73         System.out.println(root.toXCQL(0));
74
75         // Parsing a CQL query
76         CQLParser parser = new CQLParser();
77         CQLNode root = parser.parse("title=dinosaur");
78         System.out.print(root.toXCQL(0));
79         System.out.println(root.toCQL());
80         System.out.println(root.toPQF(config));
81         // ... where `config' specifies CQL-qualfier => Z-attr mapping
82
83
84 DESCRIPTION
85 -----------
86
87 See the automatically generated class documentation in the "doc"
88 subdirectory.
89
90
91 AUTHOR
92 ------
93
94 All code and documentation by Mike Taylor <mike@z3950.org>
95         http://www.miketaylor.org.uk
96 Please email me with bug-reports, wishlist items, patches, deployment
97 stories and, of course, large cash donations.
98
99
100 LICENCE
101 -------
102
103 The cql-java suite is Free Software, which is pretty much legally
104 equivalent -- though not morally equivalent -- to Open Source.  See
105         http://www.gnu.org/philosophy/free-software-for-freedom.html
106 for a detailed if somewhat one-sided discussion of the differences,
107 and particularly of why Free Software is an important idea.
108
109 cql-java is distributed under version 2.1 of the LGPL (GNU LESSER
110 GENERAL PUBLIC LICENSE).  A copy of the licence is included in this
111 distribution, as the file LGPL-2.1.  This licence does not allow you
112 to restrict the freedom of others to use derived versions of cql-java
113 (i.e. you must share your enhancements), but does let you deploy
114 cql-java as a part of a non-free larger work.
115
116
117 SEE ALSO
118 --------
119
120 Adam Dickmeiss's CQL compiler, written in C.
121 Rob Sanderson's CQL compiler, written in Python.
122 All the other free CQL compilers everyone's going to write  :-)
123 The "Changes" file, including the "Still to do" section.