Indentation.
[yaz-moved-to-github.git] / test / cql2xcqlsample
diff --git a/test/cql2xcqlsample b/test/cql2xcqlsample
new file mode 100644 (file)
index 0000000..9bc2819
--- /dev/null
@@ -0,0 +1,114 @@
+# 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 == 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 = "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 == "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 == 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" 
+
+# free-form term OK)
+a b
+a b c
+a.b c
+and b c
+all a
+a any b
+dc.title a b c and d
+
+# free-form term (Syntax error)
+a b.c
+a and