Common Query Language (CQL)

This document describes the basic syntax of the common query language. CQL is the query language defined the Catalogue Service specification (CSW). CQL support in EOxServer is realized using the external pycql package.

This document is based upon the (E)CQL documentation of GeoServer with adapations wherever needed.

Syntax Specification

This chapter shows the syntax to define CQL queries.

Condition

condition syntax
Syntax Description
Predicate A single predicate expression
Condition AND | OR Condition Logical combination of two conditions
NOT Condition Logical inversion of a condition.
( | [ Condition ] | ) Grouping of conditions regarding evaluation order

Predicate

predicate syntax
Syntax Description
Expression = | <> | < | <= | > | >= Expression Comparison of two expression
Expression [ NOT ] BETWEEN Expression AND Expression Value range Comparison
Expression [ NOT ] LIKE | ILIKE pattern Check whether an expression matches a pattern. The % character can be used as a wildcard.
Expression [ NOT ] IN ( Expression { , Expression ) Tests the inclusion of a value in a set of values.
Expression IS [ NOT ] NULL Tests whether the evaluated expression is NULL
Expression BEFORE Timestamp  
Expression BEFORE OR DURING Period  
Expression DURING Period  
Expression DURING OR AFTER Period  
Expression AFTER Timestamp  
INTERSECTS ( Expression , Expression )  
DISJOINT ( Expression , Expression )  
CONTAINS ( Expression , Expression )  
WITHIN ( Expression , Expression )  
TOUCHES ( Expression , Expression )  
CROSSES ( Expression , Expression )  
OVERLAPS ( Expression , Expression )  
EQUALS ( Expression , Expression )  
RELATE ( Expression , Expression , pattern )  
DWITHIN ( Expression , Expression , Number , units )  
BEYOND ( Expression , Expression , Number , units )  
BBOX ( Expression , Number , Number , Number , Number [ , CRS ] )  

Expression

expression syntax
Syntax Description
Attribute Name of an objects attribute
Literal A literal value
Expression + | - | * | / Expression Arithmetic operations of two expressions
( | [ Expression ] | ) Grouping of expression regarding evaluation order

Literal

literal values
Syntax Description

Number

A literal number (either floating point or integer

Boolean

A literal booelan value: either TRUE or FALSE

Timestamp

A timestamp literal. Must be in ISO 8601 compliant datetime format.

Duration

A timestamp literal. Must be in ISO 8601 compliant duration format.

Geometry

A Geometry in WKT format. EPSG:4326 is assumed

Period

period syntax
Syntax Description
Timestamp / Timestamp Period definition using the start and end timestamp.
Timestamp / Duration Period definition using the start timestamp and a duration afterwards.
Duration / Timestamp Period definition using the end timestamp and a duration before.

Attribute

Depending on the current query context, the following attributes are available to use in the queries.

available attributes
Attribute name Field type Availability
identifier String All
beginTime Timestamp All
endTime Timestamp All
footprint String All
inserted Timestamp All
updated Timestamp All
productType String Collection
doi String Collection
platform String Collection
platformSerialIdentifier String Collection
instrument String Collection
sensorType String Collection
compositeType String Collection
processingLevel String Collection
orbitType String Collection
spectralRange String Collection
wavelength Number Collection
parentIdentifier String Product
productionStatus String Product
acquisitionType String Product
orbitNumber Number Product
orbitDirection Number Product
track Number Product
frame Number Product
swathIdentifier String Product
productVersion String Product
productQualityStatus String Product
productQualityDegradationTag String Product
processorName String Product
processingCenter String Product
creationDate Timestamp Product
modificationDate Timestamp Product
processingDate Timestamp Product
sensorMode String Product
archivingCenter String Product
processingMode String Product
availabilityTime Timestamp Product
acquisitionStation String Product
acquisitionSubType String Product
startTimeFromAscendingNode Number Product
completionTimeFromAscendingNode Number Product
illuminationAzimuthAngle Number Product
illuminationZenithAngle Number Product
illuminationElevationAngle Number Product
polarisationMode String Product
polarizationChannels String Product
antennaLookDirection String Product
minimumIncidenceAngle Number Product
maximuIncidenceAngle Number Product
dopplerFrequency Number Product
incidenceAngleVariation Number Product
cloudCover Number Product
snowCover Number Product
lowestLocation Number Product
highestLocation Number Product