X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=README;h=eea8b25f10c55ee10c61b40e735060dff12b5d64;hb=4e874df732f94bfee7f0e737b74143b191cde33f;hp=590fff1d25f653ec2def8a515f9bd13e3889ef08;hpb=caeab95a0bbe3a694746bb3244e6605c36927c1e;p=cql-java-moved-to-github.git diff --git a/README b/README index 590fff1..eea8b25 100644 --- a/README +++ b/README @@ -1,75 +1,124 @@ -$Id: README,v 1.6 2002-10-30 11:13:18 mike Exp $ +$Id: README,v 1.24 2007-06-07 16:04:50 mike Exp $ -cql-java -- a free CQL compiler for Java +CQL-Java - a free CQL compiler, and other CQL tools, for Java -This project provides a set of classes for representing a CQL parse -tree (CQLBooleanNode, CQLTermNode, etc.) and a CQLCompiler class which -builds a parse tree given a CQL query as input. It also provides -compiler back-ends to render out the parse tree as XCQL (the XML -representation), as PQF (Yaz-style Prefix Query Format) and as CQL -(i.e. decompiling the parse-tree). Oh, and there's a random query -generator, too. +INTRODUCTION +------------ -CQL is "Common Query Language", a new query language designed under +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) + * BER code for the Z39.50 Type-1 query +* A random query generator, useful for testing. + +CQL is "Common Query Language", a query language designed under the umbrella of the ZING initiative (Z39.59-International Next -Generation). More information at +Generation). The official specification is at + http://www.loc.gov/standards/sru/cql/ +and there's more (and friendlier) 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/srwu/xcql.html -(not much more, though) +which is supposed to be easier to parse. The specification is at + http://www.loc.gov/standards/sru/xml-files/xcql.xsd +in the form of 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 + Changes History of releases + LGPL-2.1 The GNU lesser GPL (see below) + Makefile, Build Files to control compilation. + 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: PQF indexes, 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 -------- -Test-harness: +Using the test-harnesses: - $ echo "foo and (bar or baz)" | java org.z3950.zing.cql.CQLParser + $ CQLParser 'title=foo and author=(bar or baz)' + $ CQLParser -c 'title=foo and author=(bar or baz)' + $ CQLParser -p /etc/pqf.properties 'dc.title=foo and dc.author=bar' + $ CQLLexer 'title=foo and author=(bar or baz)' + (not very interesting unless you're debugging) + $ CQLGenerator etc/generate.properties seed 18 -Library: +Using the library in your own applications: import org.z3950.zing.cql.* // Building a parse-tree by hand - CQLNode n1 = new CQLTermNode("dc.author", "=", "kernighan"); - CQLNode n2 = new CQLTermNode("dc.title", "all", "elements style"); + 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(3)); + System.out.println(root.toXCQL(0)); // Parsing a CQL query CQLParser parser = new CQLParser(); CQLNode root = parser.parse("title=dinosaur"); - System.out.println(root.toXCQL(0)); + System.out.print(root.toXCQL(0)); System.out.println(root.toCQL()); - System.out.println(root.toPQF(qualSet)); - // ... where `qualSet' specifies CQL-qualfier => Z-attr mapping + System.out.println(root.toPQF(config)); + // ... where `config' specifies CQL-qualfier => Z-attr mapping DESCRIPTION ----------- -Se the automatically generated class documentation in the "doc" -subdirectory. (### It's not there yet, of course) +See the automatically generated class documentation in the "doc" +subdirectory. AUTHOR ------ -Mike Taylor -http://www.miketaylor.org.uk +Code and documentation by Mike Taylor, Index Data + http://indexdata.com + http://zing.z3950.org/cql +Please email me with bug-reports, wishlist items, patches, deployment +stories and, of course, large cash donations. LICENCE ------- -This software is open source, but I've not yet decided exactly what -licence to use. Be good. Assume I'm going with the GPL (most -restrictive) until I say otherwise. +The CQL-Java suite is Free Software, which is pretty much legally +equivalent -- 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 do pretty +much anything else with it. In particular, you may deploy CQL-Java as +a part of a non-free larger work. SEE ALSO @@ -78,41 +127,4 @@ 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 :-) - - -TO DO ------ - -* Add proximity support to parser - -* Some niceties for the CQL-decompiling back-end: - * Don't emit redundant parentheses. - * Don't put spaces around relations that don't need them. - -* Write PQN-generating back-end (will need to be driven from a - configuation file specifying how to represent the qualifiers, - relations, relation modifiers and wildcard characters as Z39.50 - attributes.) - -* Consider the utility of yet another back-end that translates a - CQLNode tree into a Type-1 query tree using the JZKit data - structures. That would be nice so that CQL could become a JZKit - query-type, but you could achieve the same effect by generating PQN, - and running that through JZKit's existing PQN-to-Type-1 compiler. - -* Refinements to random query generator: - * Generate relation modifiers - * Proximity support - * Don't always generate qualifier/relation for terms - * Better selection of qualifier (configurable?) - * Better selection of terms (from a dictionary file?) - * Introduce wildcard characters into generated terms - * Generate multi-word terms - -* Write fuller "javadoc" comments. - -* Write generic test suite. - -* Fix CQLParser test harness to read query from command-line - arguments, if any, falling back to stdin if there are none. - +The "Changes" file, including the "Still to do" section.