ZOOM C: deal with excess bytes HTTPS case YAZ-833
[yaz-moved-to-github.git] / test / cql2xcqlsample
1 # CQL queries for testing.
2 # from http://www.loc.gov/z3950/agency/zing/cql/sample-queries.html
3 # Simple Term
4
5 cat
6 "cat"
7 comp.os.linux
8 ml:element
9 "<xml:element>"
10 "="
11 "prox/distance<3/unit=word"
12 ("cat")
13 ((dog))
14 all
15 prox 
16
17 # Index Relation Term
18
19 title = "fish"
20 title == fish
21 title any fish
22 title all fish
23 title > 9
24 title >= 23
25 dc.title any "fish chips"
26 dc.title any/stem fish
27 dc.fish all/stem/fuzzy "fish chips"
28 (title any frog)
29 ((dc.title any/stem "frog pond"))
30 dc.title = "fish frog chicken"
31 dc.title =/rel.algorithm=CORI squid
32 creator any/f.foo/b.bar>1 "sanderson taylor" 
33
34 # Simple Boolean
35
36 cat or dog
37 cat and fish
38 cat not frog
39 (cat not frog)
40 "cat" not "fish food"
41 xml and "prox///"
42 fred and any
43 ((fred or all))
44 a or b and c not d 
45
46 # Index Relation Term plus Boolean
47
48 bath.uniformTitle any fish and dc.title any "cat dog"
49 (title any/stem "fish dog" or and) 
50
51 # Proximity and Boolean Modifiers
52
53 cat prox hat
54 cat prox/distance=3/unit=word/ordered hat
55 cat prox/distance<3 hat
56 "fish food" prox/unit=sentence and
57 title all "chips frog" prox/distance<=5 exact
58 (dc.author == "jones" prox/distance>5/unit=element title >= "smith")
59 a and/rel.SumOfScores b
60 a and/rel.algorithm=CORI b 
61
62 # Special Characters
63
64 (cat^)
65 "cat"
66 "^cat says \"fish\""
67 "cat*fish"
68 cat?dog
69 (("^cat*fishdog\"horse?")) 
70
71 # Nesting Parentheses
72
73 (((cat or dog) or horse) and frog)
74 (cat and dog) or (horse and frog)
75 (cat and (horse or frog)) and chips 
76
77 # Prefix Maps
78
79 > foo="info:srw/cql-context-set/1/dc-v1.1" dc.title="fish"
80 > "info:srw/cql-context-set/1/dc-v1.1" title="fish"
81 > 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 
82
83 # Lame Searches
84
85 any or all:stem and all == any prox prox=fuzzy
86 (((((((((any)))))))))
87 ""
88 > any > any = exact any > any 
89
90 # Invalid searches [should error]
91
92 <
93 ===
94 missingClause or
95 missingTerm any
96 ()
97 (missingParen
98 missingParen any fish)
99 (emptyParens or ())
100 title = ("illegal parentheses")
101 > illegal="urn:missingQuery" 
102
103 # free-form term OK)
104 a b
105 a b c
106 a.b c
107 and b c
108 all a
109 a any b
110 dc.title a b c and d
111
112 # free-form term (Syntax error)
113 a b.c
114 a and
115
116 # sortby
117 a sortby title
118 a or b sortby title/ascending author