foam3

Table of Contents generated with DocToc

AutoQueryParser Syntax Guide

Basic AQL Syntax

The AQL Query Language supports property-based queries with various operators and logical combinations. This parser is meant to work together with the foam.parse.auto.SmartView component, providing suggestions to the user as they type and it is referred to as AQL.

Logical Operators

AND

Combine expressions with an explicit AND or &:

expression1 AND expression2
expression1 & expression2

NOT

Negate expressions with NOT:

NOT expression

OR

Combine expressions with OR or pipe:

expression1 OR expression2
expression1 | expression2

Grouping

Use parentheses for complex expressions:

(field1 = "value1" OR field2 > 123) AND field3 IS NOT EMPTY

Property Values

Supported property values are:

[!IMPORTANT] In the JavaScript parser, only properties marked as searchable in the model are available for querying. The Java parser accepts every property.

Expressions

Supported expressions are property type dependant, not all operations pertain to all types.

Strings

The expressions that are supported for strings are:

String Expression Description
property CONTAINS value property contains value
property : value property contains value
property ~ value property contains value
property = value property exactly matches “value”
property IN (value1,value2,…) property exactly matches any of the listed values
property NOT IN (value1,value2,…) property does not exactly match any of the listed values
property > value property is greater than value
property < value property is less than value
property >= value property is greater than or equal to value
property <= value property is less than or equal to value
property != value property is not equal to value
property IS EMPTY property is is empty
property IS NOT EMPTY property is not empty

String Examples


stringField = email@somedomain.com
stringField = "Quoted String"            
stringField = "Quoted \\" String"          
stringField = "Quoted , String"           
stringField = SomeName
stringField != SomeName
stringField CONTAINS SomeName
stringField ~ SomeName
stringField IN (SomeName,AnotherName)
stringField IS EMPTY

Numbers

The expressions that are supported for all numbers are:

Number Expression Description
property >= value property is greater than or equal to value
property > value property is greater than value
property <= value property is less than or equal to value
property < value property is less than value
property != value property is not equal to value
property = value property equals value

Additional expressions that are supported for floating point numbers only:

Float Expression Description
property IN RANGE (min,max) property is within the range from min to max inclusive
property NOT IN RANGE (min,max) property is outside the range from min to max

Additional expressions that are supported for integers only:

Integer Expression Description
property IN (value1,value2,…) property equals any of the listed values
property NOT IN (value1,value2,…) property does not equal any of the listed values

Number Examples

intField = -6
intField != 6
intField IN (6,7,8)
floatField = 123.45
floatField IN RANGE (1.0,2.0)
floatField NOT IN RANGE (1.0,2.0)

Booleans

The expressions that are supported for booleans are:

Boolean Expression Description
property IS TRUE property equals true
property IS FALSE property equals false

Boolean Examples

boolField IS TRUE
boolField IS FALSE

Date and DateTime Expressions

The date values should always be in the ISO UTC format. The expressions that are supported for dates are:

Date Expression Description
property >= date property is greater than or equal to date
property > date property is greater than date
property <= date property is less than or equal to date
property < date property is less than date
property != date property is not equal to date
property = date property equals date
property IN RANGE (start,end) property is within the range from start to end inclusive
property NOT IN RANGE (start,end) property is outside the range from start to end
property IS EMPTY property is empty
property IS NOT EMPTY property is not empty

Date and DateTime Examples

dateField = 2025-10-21
dateField > 2025-10-21
dateField >= 2025-10-21
dateField < 2025-10-21
dateField <= 2025-10-21
dateField != 2025/10/21
dateField = 2025-10-21T14:30
dateField = TODAY
dateField = TODAY+7
dateField = TODAY-7
dateField IN RANGE (2025-10,2025-10)
dateField IN RANGE (2025,2025)
dateField IN RANGE (2025-10-21T14:30:45.123Z,2025-10-22T14:30:45.123Z)
dateField NOT IN RANGE (2025/10/21T14,2025/10/21T15)
dateField IS EMPTY

Enum Expressions

The expressions that are supported for enums are:

Enum Expression Description
property = EnumValue property equals the enum value
property != EnumValue property does not equal the enum value
property IN (EnumValue1,EnumValue2,…) property equals any of the listed enum values
property NOT IN (EnumValue1,EnumValue2,…) property does not equal any of the listed enum values

Enum Examples

The expressions support enums and their values. For example, if a lifecycleState property is an enum with values like ACTIVE and REJECTED, you can query:

lifecycleState = ACTIVE
lifecycleState != ACTIVE
lifecycleState IN (ACTIVE, REJECTED)
lifecycleState NOT IN (ACTIVE, REJECTED)

StringArray Expressions

The expressions that are supported for StringArray properties are:

StringArray Expression Description
property = value property has value as an element
property HAS value property has value as an element
property != value property does not have value as an element
property IN (value1,value2,…) property has any of the listed values (alias of HAS ANY)
property NOT IN (value1,value2,…) property has none of the listed values (alias of DOES NOT HAVE ANY)

StringArray Examples

disabledTopics IN (topicName1,topicName2,topicName3)
disabledTopics NOT IN (topicName1,topicName2,topicName3)
disabledTopics = topicName
disabledTopics != topicName