Version is in the pom
[cql-java-moved-to-github.git] / README
1
2 CQL-Java - a free CQL compiler, and other CQL tools, for Java
3
4
5 INTRODUCTION
6 ------------
7
8 CQL-Java is a Free Software project that provides:
9
10 * A set of classes for representing a CQL parse tree (a base CQLNode
11   class, CQLBooleanNode and its subclasses, CQLTermNode, etc.)
12 * A CQLCompiler class (and its lexer) which builds a parse tree given
13   a CQL query as input.
14 * A selection of compiler back-ends to render out the parse tree as:
15         * XCQL (the standard XML representation)
16         * CQL (i.e. decompiling the parse-tree)
17         * PQF (Yaz-style Prefix Query Format)
18         * BER code for the Z39.50 Type-1 query
19 * A random query generator, useful for testing.
20
21 CQL is "Common Query Language", a 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/standards/sru/cql/
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/standards/sru/xml-files/xcql.xsd
31 in the form of 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
39         README          This file
40         Changes         History of releases
41         LGPL-2.1        The GNU lesser GPL (see below)
42         pom.xml Maven project file to control compilation.
43         src     Source-code for the CQL-Java library and tests
44         target  The compiled library file, "cql-java.jar" and javadoc
45         bin     Simple shell-scripts to invoke CQL programs (parser/lexer/generator)
46         util    Various testing and sanity-checking Perl scripts
47         etc             Other files: PQF indexes, generator properties, etc.
48
49 "Installation" of this package would consist of putting the bin
50 directory on your PATH and target/cql-java.jar on your CLASSPATH.
51
52
53 SYNOPSIS
54 --------
55
56 Using the test-harnesses:
57
58         $ CQLParser 'title=foo and author=(bar or baz)'
59         $ CQLParser -c 'title=foo and author=(bar or baz)'
60         $ CQLParser -p /etc/pqf.properties 'dc.title=foo and dc.author=bar'
61         $ CQLLexer 'title=foo and author=(bar or baz)'
62                 (not very interesting unless you're debugging)
63         $ CQLGenerator etc/generate.properties seed 18
64
65 Using the library in your own applications:
66
67         import org.z3950.zing.cql.*
68
69         // Building a parse-tree by hand
70         CQLNode n1 = new CQLTermNode("dc.author", new CQLRelation("="),
71                                      "kernighan");
72         CQLNode n2 = new CQLTermNode("dc.title", new CQLRelation("all"),
73                                      "elements style");
74         CQLNode root = new CQLAndNode(n1, n2);
75         System.out.println(root.toXCQL(0));
76
77         // Parsing a CQL query
78         CQLParser parser = new CQLParser();
79         CQLNode root = parser.parse("title=dinosaur");
80         System.out.print(root.toXCQL(0));
81         System.out.println(root.toCQL());
82         System.out.println(root.toPQF(config));
83         // ... where `config' specifies CQL-qualfier => Z-attr mapping
84
85
86 DESCRIPTION
87 -----------
88
89 See the automatically generated class documentation in the "target"
90 subdirectory.
91
92
93 AUTHOR
94 ------
95
96 Original code and documentation by Mike Taylor, Index Data <mike@indexdata.com>
97 At present maintained by Jakub Skoczen, Index Data <jakub@indexdata.dk>
98
99     http://www.indexdata.com/cql-java
100         http://zing.z3950.org/cql
101
102 Please email me with bug-reports, wishlist items, patches, deployment
103 stories and, of course, large cash donations.
104
105
106 LICENCE
107 -------
108
109 The CQL-Java suite is Free Software, which is pretty much legally
110 equivalent -- though not morally equivalent -- to Open Source.  See
111         http://www.gnu.org/philosophy/free-software-for-freedom.html
112 for a detailed if somewhat one-sided discussion of the differences,
113 and particularly of why Free Software is an important idea.
114
115 CQL-Java is distributed under version 2.1 of the LGPL (GNU LESSER
116 GENERAL PUBLIC LICENSE).  A copy of the licence is included in this
117 distribution, as the file LGPL-2.1.  This licence does not allow you
118 to restrict the freedom of others to use derived versions of CQL-Java
119 (i.e. you must share your enhancements), but does let you do pretty
120 much anything else with it.  In particular, you may deploy CQL-Java as
121 a part of a non-free larger work.
122
123
124 SEE ALSO
125 --------
126
127 Adam Dickmeiss's CQL compiler, written in C.
128 Rob Sanderson's CQL compiler, written in Python.
129 Jakub Skoczen's CQL-js compiler, written in JavaScript http://git.indexdata.com/?p=cql-js.git
130 All the other free CQL compilers everyone's going to write  :-)
131 The "Changes" file, including the "Still to do" section.