+++ /dev/null
-
-**make-default**:
- ./Build
-
-clean:
- ./Build clean
-
+++ /dev/null
-allclasses-frame.html
-allclasses-noframe.html
-constant-values.html
-deprecated-list.html
-help-doc.html
-index-all.html
-index.html
-org
-overview-tree.html
-package-list
-packages.html
-serialized-form.html
-stylesheet.css
-resources
+++ /dev/null
-
-all: overview-tree.html
-
-overview-tree.html: ../src/main/java/org/z3950/zing/cql/*.java
- nice javadoc -classpath ../src/main/java \
- -author -version -windowtitle cql-java org.z3950.zing.cql
-
-clean:
- rm -rf allclasses-frame.html \
- allclasses-noframe.html \
- deprecated-list.html \
- help-doc.html \
- index-all.html \
- index.html \
- org \
- overview-tree.html \
- package-list \
- packages.html \
- serialized-form.html \
- constant-values.html \
- stylesheet.css \
- resources
+++ /dev/null
-#!/bin/sh
-
-# mkdist - make a distribution of the CQL-Java software
-
-version=`cat VERSION`
-distdir=cql-java-$version
-distfile=$distdir.tar.gz
-tmpdir=/tmp/$distdir
-echo "Building $distdir"
-trap "rm -rf $tmpdir" 1 2 15 # 0
-cp -rp . $tmpdir
-cd $tmpdir
-find . \( -name CVS -o -name .cvsignore \) -print | xargs rm -rf
-rm -rf archive mkdist etc/xslt .git target
-( cd src/main/java/org/z3950/zing/cql && make && make clean )
-( cd docs && make )
-( cd test/regression && make distclean )
-cd ..
-tar cf - $distdir | gzip -9v > $distfile
-rm -rf $tmpdir
-echo "Made /tmp/$distfile"
* @param allowKeywordTerms when false registered keywords are disallowed in unquoted terms
*/
public CQLParser(int compat, boolean allowKeywordTerms) {
- this.compat = V1POINT2;
+ this.compat = compat;
this.allowKeywordTerms = allowKeywordTerms;
}
+++ /dev/null
-#
-# Your Java compiler will require that this source directory is on the
-# classpath. The best way to do that is just to add the CQL-Java
-# distribution's "src" subdirectory to your CLASSPATH environment
-# variable, like this:
-# CLASSPATH=$CLASSPATH:/where/ever/you/unpacked/it/cql-java-VERSION/src
-
-OBJ = Utils.class \
- CQLNode.class CQLTermNode.class CQLBooleanNode.class \
- CQLAndNode.class CQLOrNode.class CQLNotNode.class \
- CQLProxNode.class CQLPrefixNode.class CQLSortNode.class \
- CQLPrefix.class \
- CQLRelation.class Modifier.class ModifierSet.class \
- CQLParser.class CQLLexer.class CQLGenerator.class \
- CQLParseException.class MissingParameterException.class \
- PQFTranslationException.class \
- UnknownIndexException.class UnknownRelationException.class \
- UnknownRelationModifierException.class UnknownPositionException.class
-
-JARPATH = ../../../lib/cql-java.jar
-JAR = ../../../../../../$(JARPATH)
-$(JAR): $(OBJ)
- cd ../../../..; jar cf $(JARPATH) org/z3950/zing/cql/*.class
-
-%.class: %.java
- javac -Xlint:unchecked *.java
-
-test: $(JAR)
- cd ../../../../../../../test/regression && make
-
-clean:
- rm -f $(OBJ) 'CQLLexer$$Keyword.class'
-
--- /dev/null
+/*
+ * Copyright (c) 1995-2014, Index Datassss
+ * All rights reserved.
+ * See the file LICENSE for details.
+ */
+package org.z3950.zing.cql;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import static java.lang.System.out;
+import java.util.Properties;
+
+/**
+ *
+ * @author jakub
+ */
+public class CQLParserTest {
+ public CQLParserTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of main method, of class CQLParser.
+ */
+ @Test
+ public void testRegressionQueries() throws IOException {
+ System.out.println("Testing the parser using pre-canned regression queries...");
+ //we might be running the test from within the jar
+ //list all resource dirs, then traverse them
+ String[] dirs = getResourceListing(this.getClass(), "regression");
+ for (String dir : dirs) {
+ String files[] = getResourceListing(this.getClass(), "regression/" + dir);
+ for (String file : files) {
+ if (!file.endsWith(".cql")) continue;
+ out.println("Parsing "+dir+"/"+file);
+ InputStream is = this.getClass().getResourceAsStream("/regression/"+dir+"/"+file);
+ BufferedReader reader = null, reader2 = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ String input = reader.readLine();
+ out.println("Query: "+input);
+ CQLParser parser = new CQLParser();
+ CQLNode parsed = parser.parse(input);
+ String xcql = parsed.toXCQL();
+ out.println("Parsed:");
+ out.println(xcql);
+ //read the expected xcql output
+ String prefix = file.substring(0, file.length()-4);
+ reader2 = new BufferedReader(new InputStreamReader(
+ this.getClass().getResourceAsStream("/regression/"+dir+"/"+prefix+".xcql")));
+ StringBuilder sb = new StringBuilder();
+ String line;
+ while ((line = reader2.readLine()) != null) {
+ sb.append(line).append("\n");
+ }
+ String expected = sb.toString();
+ out.println("Expected: ");
+ out.println(expected);
+ assertEquals("Assertion failure for "+dir+"/"+file, expected, xcql);
+ } catch (CQLParseException pe) {
+ fail("Parsing failed with: "+pe.toString());
+ } finally {
+ if (reader != null) reader.close();
+ if (reader2 != null) reader2.close();
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testRandomQueries() throws IOException, MissingParameterException {
+ out.println("Testing the parser using 100 randomly generated queries...");
+ Properties params = new Properties();
+ InputStream is = getClass().getResourceAsStream("/generate.properties");
+ if (is == null)
+ fail("Cannot locate generate.properties");
+ params.load(is);
+ is.close();
+ CQLGenerator generator = new CQLGenerator(params);
+ for (int i=0; i<100; i++) {
+ CQLNode random = generator.generate();
+ String expected = random.toCQL();
+ out.println("Generated query: "+expected);
+ CQLParser parser = new CQLParser();
+ try {
+ CQLNode parsed = parser.parse(expected);
+ String result = parsed.toCQL();
+ assertEquals(expected, result);
+ } catch (CQLParseException pe) {
+ fail("Generated query failed to parse: "+pe.getMessage());
+ }
+ }
+ }
+
+
+ //helper methods follow
+ //TODO move to masterkey-common
+
+ @SuppressWarnings("rawtypes")
+ public static String[] getResourceListing(Class clazz, String path) throws
+ IOException {
+ URL dirURL = clazz.getClassLoader().getResource(path);
+ if (dirURL != null && dirURL.getProtocol().equals("file")) {
+ /* A file path: easy enough */
+ try {
+ return new File(dirURL.toURI()).list();
+ } catch (URISyntaxException use) {
+ throw new UnsupportedOperationException(use);
+ }
+ }
+
+ if (dirURL == null) {
+ /*
+ * In case of a jar file, we can't actually find a directory.
+ * Have to assume the same jar as clazz.
+ */
+ String me = clazz.getName().replace(".", "/") + ".class";
+ dirURL = clazz.getClassLoader().getResource(me);
+ }
+
+ if (dirURL.getProtocol().equals("jar")) {
+ /* A JAR path */
+ String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf(
+ "!")); //strip out only the JAR file
+ JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
+ Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
+ Set<String> result = new HashSet<String>(); //avoid duplicates in case it is a subdirectory
+ while (entries.hasMoreElements()) {
+ String name = entries.nextElement().getName();
+ if (name.startsWith(path)) { //filter according to the path
+ String entry = name.substring(path.length());
+ int checkSubdir = entry.indexOf("/");
+ if (checkSubdir >= 0) {
+ // if it is a subdirectory, we just return the directory name
+ entry = entry.substring(0, checkSubdir);
+ }
+ result.add(entry);
+ }
+ }
+ return result.toArray(new String[result.size()]);
+ }
+
+ throw new UnsupportedOperationException("Cannot list files for URL "
+ + dirURL);
+ }
+}
\ No newline at end of file
--- /dev/null
+#
+# Propeties file to drive the org.z3950.zing.cql.CQLGenerator
+# test-harness. See that class's documentation for the semantics of
+# these properties.
+#
+complexQuery=0.4
+complexClause=0.4
+equalsRelation=0.5
+numericRelation=0.7
+proxOp=0.0
--- /dev/null
+cat
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+</searchClause>
--- /dev/null
+"cat"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+</searchClause>
--- /dev/null
+comp.os.linux
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>comp.os.linux</term>
+</searchClause>
--- /dev/null
+xml:element
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>xml:element</term>
+</searchClause>
--- /dev/null
+"<xml:element>"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term><xml:element></term>
+</searchClause>
--- /dev/null
+"="
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>=</term>
+</searchClause>
--- /dev/null
+"prox/distance<3/unit=word"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>prox/distance<3/unit=word</term>
+</searchClause>
--- /dev/null
+("cat")
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+</searchClause>
--- /dev/null
+((dog))
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>dog</term>
+</searchClause>
--- /dev/null
+all
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>all</term>
+</searchClause>
--- /dev/null
+prox
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>prox</term>
+</searchClause>
--- /dev/null
+Simple
\ No newline at end of file
--- /dev/null
+title = "fish"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+title == fish
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>==</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+title any fish
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+title all fish
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>all</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+title > 9
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>></value>
+ </relation>
+ <term>9</term>
+</searchClause>
--- /dev/null
+title >= 23
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>>=</value>
+ </relation>
+ <term>23</term>
+</searchClause>
--- /dev/null
+dc.title any "fish chips"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>fish chips</term>
+</searchClause>
--- /dev/null
+dc.title any/stem fish
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>any</value>
+ <modifiers>
+ <modifier>
+ <type>stem</type>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+dc.fish all/stem/fuzzy "fish chips"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.fish</index>
+ <relation>
+ <value>all</value>
+ <modifiers>
+ <modifier>
+ <type>stem</type>
+ </modifier>
+ <modifier>
+ <type>fuzzy</type>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>fish chips</term>
+</searchClause>
--- /dev/null
+(title any frog)
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>frog</term>
+</searchClause>
--- /dev/null
+((dc.title any/stem "frog pond"))
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>any</value>
+ <modifiers>
+ <modifier>
+ <type>stem</type>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>frog pond</term>
+</searchClause>
--- /dev/null
+dc.title any "fish frog chicken"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>fish frog chicken</term>
+</searchClause>
--- /dev/null
+dc.title =/rel.algorithm=CORI squid
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>=</value>
+ <modifiers>
+ <modifier>
+ <type>rel.algorithm</type>
+ <comparison>=</comparison>
+ <value>CORI</value>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>squid</term>
+</searchClause>
--- /dev/null
+author any/f.foo/b.bar>1 "sanderson taylor"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>author</index>
+ <relation>
+ <value>any</value>
+ <modifiers>
+ <modifier>
+ <type>f.foo</type>
+ </modifier>
+ <modifier>
+ <type>b.bar</type>
+ <comparison>></comparison>
+ <value>1</value>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>sanderson taylor</term>
+</searchClause>
--- /dev/null
+numberOfLegs <= 4
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>numberOfLegs</index>
+ <relation>
+ <value><=</value>
+ </relation>
+ <term>4</term>
+</searchClause>
--- /dev/null
+numberOfLegs <> 4
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>numberOfLegs</index>
+ <relation>
+ <value><></value>
+ </relation>
+ <term>4</term>
+</searchClause>
--- /dev/null
+title == jaws
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>title</index>
+ <relation>
+ <value>==</value>
+ </relation>
+ <term>jaws</term>
+</searchClause>
--- /dev/null
+Index Relation Term
\ No newline at end of file
--- /dev/null
+cat or dog
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>dog</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+cat and fish
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+cat not frog
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>not</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>frog</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+(cat not frog)
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>not</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>frog</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+"cat" not "fish food"
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>not</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish food</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+xml and "prox///"
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>xml</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>prox///</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+fred and any
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fred</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>any</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+((fred or all))
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fred</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>all</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+a or b and c not d
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>not</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>a</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>b</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>c</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>d</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+Simple Boolean
\ No newline at end of file
--- /dev/null
+bath.author any fish and dc.title all "cat dog"
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>bath.author</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>fish</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>dc.title</index>
+ <relation>
+ <value>all</value>
+ </relation>
+ <term>cat dog</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+(title any/stem "fish dog" or and)
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>title</index>
+ <relation>
+ <value>any</value>
+ <modifiers>
+ <modifier>
+ <type>stem</type>
+ </modifier>
+ </modifiers>
+ </relation>
+ <term>fish dog</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>and</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+I/R/T plus Boolean
\ No newline at end of file
--- /dev/null
+cat prox hat
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>hat</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+cat prox/distance=3/unit=word/ordered hat
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ <modifiers>
+ <modifier>
+ <type>distance</type>
+ <comparison>=</comparison>
+ <value>3</value>
+ </modifier>
+ <modifier>
+ <type>unit</type>
+ <comparison>=</comparison>
+ <value>word</value>
+ </modifier>
+ <modifier>
+ <type>ordered</type>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>hat</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+cat prox/distance<3 hat
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ <modifiers>
+ <modifier>
+ <type>distance</type>
+ <comparison><</comparison>
+ <value>3</value>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>hat</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+"fish food" prox/unit=sentence and
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ <modifiers>
+ <modifier>
+ <type>unit</type>
+ <comparison>=</comparison>
+ <value>sentence</value>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish food</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>and</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+title all "chips frog" prox/distance<=5 exact
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ <modifiers>
+ <modifier>
+ <type>distance</type>
+ <comparison><=</comparison>
+ <value>5</value>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>title</index>
+ <relation>
+ <value>all</value>
+ </relation>
+ <term>chips frog</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>exact</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+(dc.author == "jones" prox/distance>5/unit=element title >= "smith")
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ <modifiers>
+ <modifier>
+ <type>distance</type>
+ <comparison>></comparison>
+ <value>5</value>
+ </modifier>
+ <modifier>
+ <type>unit</type>
+ <comparison>=</comparison>
+ <value>element</value>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>dc.author</index>
+ <relation>
+ <value>==</value>
+ </relation>
+ <term>jones</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>title</index>
+ <relation>
+ <value>>=</value>
+ </relation>
+ <term>smith</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+((cat prox hat))
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>prox</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>hat</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+a and/rel.SumOfScores b
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ <modifiers>
+ <modifier>
+ <type>rel.sumofscores</type>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>a</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>b</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+a and/rel.algorithm=CORI b
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ <modifiers>
+ <modifier>
+ <type>rel.algorithm</type>
+ <comparison>=</comparison>
+ <value>CORI</value>
+ </modifier>
+ </modifiers>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>a</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>b</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+Prox
\ No newline at end of file
--- /dev/null
+(cat^)
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat^</term>
+</searchClause>
--- /dev/null
+"cat"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+</searchClause>
--- /dev/null
+"^cat says \"fish\""
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>^cat says "fish"</term>
+</searchClause>
--- /dev/null
+"cat*fish"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat*fish</term>
+</searchClause>
--- /dev/null
+cat?dog
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat?dog</term>
+</searchClause>
--- /dev/null
+(("^cat*fishdog\"horse?"))
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>^cat*fishdog"horse?</term>
+</searchClause>
--- /dev/null
+Special Characters
\ No newline at end of file
--- /dev/null
+(((cat or dog) or horse) and frog)
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>dog</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>horse</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>frog</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+(cat and dog) or (horse and frog)
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>dog</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>horse</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>frog</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </rightOperand>
+</triple>
--- /dev/null
+(cat and (horse or frog)) and chips
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>cat</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>horse</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>frog</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>chips</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+Nesting Parentheses
\ No newline at end of file
--- /dev/null
+> foo="http://www.loc.gov/zing/cql/dc-indexes/" dc.title="fish"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>foo</name>
+ <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
+ </prefix>
+ </prefixes>
+ <index>dc.title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+> "http://www.loc.gov/zing/cql/dc-indexes/" title="fish"
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <identifier>http://www.loc.gov/zing/cql/dc-indexes/</identifier>
+ </prefix>
+ </prefixes>
+ <index>title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+</searchClause>
--- /dev/null
+> foo="http://www.loc.gov/zing/cql/dc-indexes" > ccg = "http://srw.o-r-g.org/cql/indexSets/ccg/" foo.title="fish" and ccg.force=3
\ No newline at end of file
--- /dev/null
+<triple>
+ <prefixes>
+ <prefix>
+ <name>foo</name>
+ <identifier>http://www.loc.gov/zing/cql/dc-indexes</identifier>
+ </prefix>
+ <prefix>
+ <name>ccg</name>
+ <identifier>http://srw.o-r-g.org/cql/indexSets/ccg/</identifier>
+ </prefix>
+ </prefixes>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>foo.title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>ccg.force</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>3</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+Prefix Maps
\ No newline at end of file
--- /dev/null
+any or all:stem and all contains any prox proxfuzzy
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <triple>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>any</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>all:stem</term>
+ </searchClause>
+ </rightOperand>
+ </triple>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>all contains</index>
+ <relation>
+ <value>any</value>
+ </relation>
+ <term>prox proxfuzzy</term>
+ </searchClause>
+ </rightOperand>
+</triple>
--- /dev/null
+(((((((((any)))))))))
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>any</term>
+</searchClause>
--- /dev/null
+""
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term></term>
+</searchClause>
--- /dev/null
+> any > any = exact any > any
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <identifier>any</identifier>
+ </prefix>
+ <prefix>
+ <name>any</name>
+ <identifier>exact</identifier>
+ </prefix>
+ </prefixes>
+ <index>any</index>
+ <relation>
+ <value>></value>
+ </relation>
+ <term>any</term>
+</searchClause>
--- /dev/null
+sortby sortby sortby
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>sortby</term>
+ <sortKeys>
+ <key>
+ <index>sortby</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+sortby sortby sortby sortby sortby
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>sortby</term>
+ <sortKeys>
+ <key>
+ <index>sortby</index>
+ </key>
+ <key>
+ <index>sortby</index>
+ </key>
+ <key>
+ <index>sortby</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+Lame Searches
\ No newline at end of file
--- /dev/null
+kernighan sortby title
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>title</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+kernighan and ritchie sortby title
\ No newline at end of file
--- /dev/null
+<triple>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>ritchie</term>
+ </searchClause>
+ </rightOperand>
+ <sortKeys>
+ <key>
+ <index>title</index>
+ </key>
+ </sortKeys>
+</triple>
--- /dev/null
+dc.creator=kernighan sortby dc.title
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.title</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby numberOfLegs/cql.number
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>numberOfLegs</index>
+ <modifiers>
+ <modifier>
+ <type>cql.number</type>
+ </modifier>
+ </modifiers>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby dc.title/sort.respectCase
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.title</index>
+ <modifiers>
+ <modifier>
+ <type>sort.respectcase</type>
+ </modifier>
+ </modifiers>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby dc.title/sort.respectCase/sort.descending
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.title</index>
+ <modifiers>
+ <modifier>
+ <type>sort.respectcase</type>
+ </modifier>
+ <modifier>
+ <type>sort.descending</type>
+ </modifier>
+ </modifiers>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby dc.date dc.title
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.date</index>
+ </key>
+ <key>
+ <index>dc.title</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby dc.date/sort.missingOmit
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.date</index>
+ <modifiers>
+ <modifier>
+ <type>sort.missingomit</type>
+ </modifier>
+ </modifiers>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+dc.creator=kernighan sortby dc.date/sort.missingValue=1970
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <index>dc.creator</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>kernighan</term>
+ <sortKeys>
+ <key>
+ <index>dc.date</index>
+ <modifiers>
+ <modifier>
+ <type>sort.missingvalue</type>
+ <comparison>=</comparison>
+ <value>1970</value>
+ </modifier>
+ </modifiers>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+>dc="http://deepcustard.org/1.0" blah sortby dc.custardDepth
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>http://deepcustard.org/1.0</identifier>
+ </prefix>
+ </prefixes>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>blah</term>
+ <sortKeys>
+ <key>
+ <index>dc.custardDepth</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+>ns1="http://uri1" >ns2="http://uri2" whatever sortby ns1.key/a/b/c=1 ns2.key2
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>ns1</name>
+ <identifier>http://uri1</identifier>
+ </prefix>
+ <prefix>
+ <name>ns2</name>
+ <identifier>http://uri2</identifier>
+ </prefix>
+ </prefixes>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>whatever</term>
+ <sortKeys>
+ <key>
+ <index>ns1.key</index>
+ <modifiers>
+ <modifier>
+ <type>a</type>
+ </modifier>
+ <modifier>
+ <type>b</type>
+ </modifier>
+ <modifier>
+ <type>c</type>
+ <comparison>=</comparison>
+ <value>1</value>
+ </modifier>
+ </modifiers>
+ </key>
+ <key>
+ <index>ns2.key2</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+(>dc=x b=c) sortby d
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>x</identifier>
+ </prefix>
+ </prefixes>
+ <index>b</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>c</term>
+ <sortKeys>
+ <key>
+ <index>d</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+b=(>dc=x c) sortby d
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>x</identifier>
+ </prefix>
+ </prefixes>
+ <index>b</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>c</term>
+ <sortKeys>
+ <key>
+ <index>d</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+(>dc=x c1 and c2) sortby d
\ No newline at end of file
--- /dev/null
+<triple>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>x</identifier>
+ </prefix>
+ </prefixes>
+ <boolean>
+ <value>and</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>c1</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>c2</term>
+ </searchClause>
+ </rightOperand>
+ <sortKeys>
+ <key>
+ <index>d</index>
+ </key>
+ </sortKeys>
+</triple>
--- /dev/null
+>dc="http://deepcustard.org" (>dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
\ No newline at end of file
--- /dev/null
+<searchClause>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>http://deepcustard.org</identifier>
+ </prefix>
+ <prefix>
+ <name>dc</name>
+ <identifier>http://dublincore.org</identifier>
+ </prefix>
+ </prefixes>
+ <index>dc.title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>jaws</term>
+ <sortKeys>
+ <key>
+ <index>dc.custardDepth</index>
+ </key>
+ </sortKeys>
+</searchClause>
--- /dev/null
+>dc="http://deepcustard.org" (fish or >dc="http://dublincore.org" dc.title=jaws) sortby dc.custardDepth
\ No newline at end of file
--- /dev/null
+<triple>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>http://deepcustard.org</identifier>
+ </prefix>
+ </prefixes>
+ <boolean>
+ <value>or</value>
+ </boolean>
+ <leftOperand>
+ <searchClause>
+ <index>cql.serverChoice</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>fish</term>
+ </searchClause>
+ </leftOperand>
+ <rightOperand>
+ <searchClause>
+ <prefixes>
+ <prefix>
+ <name>dc</name>
+ <identifier>http://dublincore.org</identifier>
+ </prefix>
+ </prefixes>
+ <index>dc.title</index>
+ <relation>
+ <value>=</value>
+ </relation>
+ <term>jaws</term>
+ </searchClause>
+ </rightOperand>
+ <sortKeys>
+ <key>
+ <index>dc.custardDepth</index>
+ </key>
+ </sortKeys>
+</triple>
--- /dev/null
+Sorting
\ No newline at end of file