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