CQL Filter

The Common Query Language (CQL) is used to define expressions and filters in several parts of HALE. It can be used to define conditions on schema elements or to filter instances.

Property references

In a filter, you can refer to a property value by the property name. If you want to refer to a nested property, use a dot to separate the property names on the property's path. Encapsulating a property path in double quotes ensures that it is correctly recognized, even if a property name happens to be equal to a reserved expression in CQL.

For this example schema...

...the following are valid references to a property:

name

"id"

details.address.city

"details.age"

Groups

If a schema contains groups, you can ignore them in your filter. Just treat the group's properties as if they were directly associated to the group's parent.

Namespaces

Stating the namespace associated to a property name is optional, though it may be useful to differentiate between properties with the same local name. A namespace is specified by encapsulating it in curly brackets and using it as a prefix for the corresponding property name. When specifying a namespace it is mandatory to use double quotes for the property reference. Following is an example:

"geometry.{http://www.opengis.net/gml}Point"

Literals

Type Example
String 'Yoda'
Integer 12
Floating-point number 1.234

Example filters

Following are some example filters. You can test them with the example project provided in the command linkGet started with HALE guide, using the Transformed Data view.

Comparisons

name = 'Yoda'

details.age > (10 + (4 / 2) * 3)

details.age >= 16 AND details.age <= 50

details.age BETWEEN 16 AND 50

Text

name LIKE 'Tom%'

name NOT LIKE '%Snow'

Null

details.address.city IS NULL

details.address.city IS NOT NULL



What is an Instance?

Contexts


Schema elements