The following EBNF grammar describes the syntax for EQL filter expressions.
RecordPath ::= Collection "(" ")" "/" RecordStep Collection ::= FnPrefix? "collection" FnPrefix ::= "fn" ":" RecordStep ::= "record" Predicate? Predicate ::= "[" Expr "]" Expr ::= OrExpr OrExpr ::= AndExpr ("or" AndExpr)* AndExpr ::= NotExpr ("and" NotExpr)* NotExpr ::= PrimaryExpr | (FnPrefix? "not" "(" Expr ")") PrimaryExpr ::= ParenExpr | TestExpr ParenExpr ::= "(" Expr ")" TestExpr ::= ComparisonExpr | FunctionCall FunctionCall ::= TrueFunction | FalseFunction | MatchesFunction TrueFunction ::= FnPrefix? "true" "(" ")" FalseFunction ::= FnPrefix? "false" "(" ")" MatchesFunction ::= "endeca" ":" "matches" "(" "." "," StringLiteral "," StringLiteral ( "," StringLiteral ( "," StringLiteral ( "," (TrueFunction | FalseFunction) )? )? )? ")" ComparisonExpr ::= LiteralComparison | JoinComparison | RangeComparison | GeospatialComparison | DimensionComparison EqualityOperator ::= "=" | "!=" LiteralComparison ::= PropertyKey EqualityOperator Literal JoinComparison ::= PropertyKey "=" PropertyPath RangeComparison ::= PropertyKey RangeOperator NumericLiteral GeospatialComparison ::= "endeca" ":" "distance" "(" PropertyKey "," "endeca" ":" "geocode" "(" NumericLiteral "," NumericLiteral ")" ")" (">" | "<") NumericLiteral DimensionComparison ::= DimensionKey EqualityOperator (DimValById | DimValPath) "//" "id" DimValById ::= "endeca" ":" "dval-by-id" "(" IntegerLiteral ")" DimValPath ::= Collection "(" "" "dimensions" "" ")" ("/" DValStep)* DValStep ::= ("*" | "dval") "[" "name" "=" StringLiteral "]" DimensionKey ::= NCName PropertyPath ::= RecordPath "/" PropertyKey PropertyKey ::= NCName RangeOperator ::= "<" | "<=" | ">" | ">=" Literal ::= NumericLiteral | StringLiteral NumericLiteral ::= IntegerLiteral | DecimalLiteral StringLiteral ::= '"' ('""' | [^"])* '"' IntegerLiteral ::= [0-9]+ DecimalLiteral ::= ([0-9]+ "." [0-9]*) | ("." [0-9]+)
The EBNF uses these notations:
The EBNF uses the same Basic EBNF notation as the W3C specification of XML, located at this URL: http://www.w3.org/TR/xml/#sec-notation
Also, note these important items about the syntax:
Keywords are case sensitive. For example,
“endeca:matches”
must be specified in lower case, as must theand
andor
operators.The names of keywords are not reserved words across the Oracle Commerce namespace. For example, if you have a property named
collection
, its name will not conflict with the name of thecollection()
function.To use the double-quote character as a literal character (that is, for inclusion in a string literal), it must be escaped by prepending it with a double-quote character.
These and other aspects of EQL will be discussed further in later sections of this section.