# $Id: cqlsample,v 1.2 2004/03/10 18:50:56 adam Exp $
# CQL queries for testing.
# from http://www.loc.gov/z3950/agency/zing/cql/sample-queries.html
# Simple Term

cat
"cat"
comp.os.linux
ml:element
"<xml:element>"
"="
"prox/distance<3/unit=word"
("cat")
((dog))
all
prox 

# Index Relation Term

title = "fish"
title exact fish
title any fish
title all fish
title > 9
title >= 23
dc.title any "fish chips"
dc.title any/stem fish
dc.fish all/stem/fuzzy "fish chips"
(title any frog)
((dc.title any/stem "frog pond"))
dc.title scr "fish frog chicken"
dc.title =/rel.algorithm=CORI squid
creator any/f.foo/b.bar>1 "sanderson taylor" 

# Simple Boolean

cat or dog
cat and fish
cat not frog
(cat not frog)
"cat" not "fish food"
xml and "prox///"
fred and any
((fred or all))
a or b and c not d 

# Index Relation Term plus Boolean

bath.uniformTitle any fish and dc.title any "cat dog"
(title any/stem "fish dog" or and) 

# Proximity and Boolean Modifiers

cat prox hat
cat prox/distance=3/unit=word/ordered hat
cat prox/distance<3 hat
"fish food" prox/unit=sentence and
title all "chips frog" prox/distance<=5 exact
(dc.author exact "jones" prox/distance>5/unit=element title >= "smith")
a and/rel.SumOfScores b
a and/rel.algorithm=CORI b 

# Special Characters

(cat^)
"cat"
"^cat says \"fish\""
"cat*fish"
cat?dog
(("^cat*fishdog\"horse?")) 

# Nesting Parentheses

(((cat or dog) or horse) and frog)
(cat and dog) or (horse and frog)
(cat and (horse or frog)) and chips 

# Prefix Maps

> foo="info:srw/cql-context-set/1/dc-v1.1" dc.title="fish"
> "info:srw/cql-context-set/1/dc-v1.1" title="fish"
> foo="info:srw/cql-context-set/1/dc-v1.1" > ccg = "http://srw.cheshire3.org/contextSets/ccg/1.1/" foo.title="fish" and ccg.force=3 

# Lame Searches

any or all:stem and all exact any prox prox=fuzzy
(((((((((any)))))))))
""
> any > any = exact any > any 

# Invalid searches [should error]

<
===
missingClause or
missingTerm any
()
(missingParen
missingParen any fish)
(emptyParens or ())
title = ("illegal parentheses")
> illegal="urn:missingQuery" 


