| 3.1 Specification Changes
1. A revised BNF for the Query language and instructions about string-char and number substitution in section 7.7:
Query ::= search-condition
search-condition::== query-clause | ( search-condition or query-clause)
query-clause ::= boolean-element | ( query-clause and boolean-element )
boolean-element :: = [not] query-element
query-element ::= field-criteria | ( "(" search-condition ")" )
or ::= "OR" | "|"
and ::= "AND" | ","
not ::= "NOT" | "~"
field-criteria ::= "(" field "=" field-content")"
field-value ::= lookup-list | string-list | range-list | period | number | string-literal
lookup-list ::= lookup-or | lookup-not | lookup-and
lookup-or ::= "|" lookup *( "," lookup )
lookup-not ::= "~" lookup *( "," lookup )
lookup-and ::= "+" lookup *( "," lookup )
lookup ::= <any legal ALPHANUM value for the field as defined in the metadata>
string-list ::= 1*( string *( "," string ))
string ::= string-eq | string-start | string-contains | string-char
string-eq ::= 1*ALPHANUM
string-start ::= 1*ALPHANUM "*"
string-contains ::= "*" 1*ALPHANUM "*"
string-char ::= *ALPHANUM 1*"?" *ALPHANUM
string_literal ::= <"> 1*( *( PLAINTEXT except <"> ) *( 2<"> ) *( PLAINTEXT except <"> ) ) <">
range-list ::= 1*( range *( "," range ))
range ::= between | greater | less
between ::= ( period | number | string-eq ) "-" ( period | number | string-eq )
greater ::= ( period | number | string-eq ) "+"
less ::= ( period | number | string-eq ) "-"
period ::= (date | datetime | time)
number ::= 1*DIGIT ["." *DIGIT]
date ::= (year "-" month "-" day) | TODAY
datetime ::= (year "-" month "-" day "T" hour ":" minute":" second ["."fraction]) | NOW
time ::= (hour ":" minute ":" second ["." fraction])
fraction ::= 1*3DIGIT
second ::= 2DIGIT
minute ::= 2DIGIT
hour ::= 2DIGIT
day ::= 2DIGIT
month ::= 2DIGIT
year ::= 4DIGIT
NOW ::= "NOW" <the host should substitute this with its current date/time>
TODAY ::= "TODAY" <the host should substitute this with its current date>
In processing a literal string, a server MAY substitute a string-char expression (?s) for the range of characters that contain any non-ALPHANUM not supported by that server.
In processing decimal numbers, a server MAY round as follows, down for the bottom of ranges or values less than .5 and round up for the top of ranges or values .5 or greater..
2. The addition of DMQL2 as a Query Type in section 7.3.2:
QueryType ::= DMQL | DMQL2
An enumeration giving the language in which the query is presented. The valid value are "DMQL" for RETS/1.0 compliance and "DMQL2" which indicates the query language described in Section 7.7.
3.2 Implementation Notes
This proposal minimizes the changes to the query syntax while filling some important holes. The author hopes to have balanced the implementation effort that will be required by servers with the need for more SQL like syntax for the clients. |