1 $Id: Grammar,v 1.1 2002-10-30 09:19:26 mike Exp $
3 This is the CQL grammar, more or less as on the official Maintenance
4 Agency page (http://lcweb.loc.gov/z3950/agency/zing/srwu/cql.html) but
5 with a few tweaks described in my message of Tue, 29 Oct 2002 14:11:48
6 which I hope will be integrated into the official grammar.
10 cql-query ::= cql-query boolean search-clause
12 boolean ::= "and" | "or" | "not" | prox
13 search-clause ::= "(" cql-query ")"
14 | [ qualifier relation ] term
16 relation ::= base-relation { "/" relation-modifier }
17 base-relation ::= numeric-relation | "exact" | "all" | "any"
18 relation-modifier ::= "relevant" | "fuzzy" | "stem"
19 numeric-relation ::= "<" | ">" | "<=" | ">=" | "<>" | "="
21 prox ::= "prox" [ "/" prox-parameters ]
22 prox-parameters ::= [ numeric-relation ] "/" [ distance ] "/" [ unit ] "/" ordering
23 | [ numeric-relation ] "/" [ distance ] "/" unit
24 | [ numeric-relation ] "/" distance
26 unit ::= "word" | "sentence" | "paragraph" | "element"
27 ordering ::= "ordered" | "unordered"
28 distance ::= non-negative-integer
30 qualifier ::= [ qualifier-prefix "." ] qualifier-name
31 qualifier-prefix ::= identifier
32 qualifier-name ::= identifier
34 term ::= string | ""string""
35 string ::= a character string