diff --git a/cql2/standard/clause_6_basic_cql2.adoc b/cql2/standard/clause_6_basic_cql2.adoc index 1598f983..db23a965 100644 --- a/cql2/standard/clause_6_basic_cql2.adoc +++ b/cql2/standard/clause_6_basic_cql2.adoc @@ -18,7 +18,7 @@ encodings of CQL2. A CQL2 filter expression is an expression that defines a logically connected set of predicates that are evaluated for each item of a collection. Each predicate is an operator with operands where the number of operands depends -on the operator. An operand is either a literal, a standardized or custom function +on the operator. An operand is either a literal, a property, a standardized or custom function or an arithmetic expression. A predicate is an expression that evaluates to the Boolean values of `TRUE` @@ -80,11 +80,11 @@ specifying the requirements class. The scalar data types are: -* "string": character strings (literal rule `characterLiteral`); -* "number": numbers including integers and floating point values (literal rule `numericLiteral`); -* "boolean": booleans (literal rule `booleanLiteral`); -* "timestamp": an instant with a granularity of a second or smaller (literal rule: `timestampLiteral`) -* "date": an instant with a granularity of a day (literal rule: `dateLiteral`) +* "string": character strings (rule `characterLiteral`); +* "number": numbers including integers and floating point values (rule `numericLiteral`); +* "boolean": booleans (rule `booleanLiteral`); +* "timestamp": an instant with a granularity of a second or smaller (rule `timestampInstant`) +* "date": an instant with a granularity of a day (rule `dateInstant`) For character string, numeric and boolean literals, the standard representations are used. For character string literals, embeded quotes are escaped using two consecutive single quotes (i.e. `''`). diff --git a/cql2/standard/clause_7_enhanced.adoc b/cql2/standard/clause_7_enhanced.adoc index cfc1a88a..4a404857 100644 --- a/cql2/standard/clause_7_enhanced.adoc +++ b/cql2/standard/clause_7_enhanced.adoc @@ -200,7 +200,7 @@ A _spatial predicate_ evaluates two geometry-valued expressions to determine if [[basic-spatial-data-types]] ==== Basic spatial data types and literal values -The basic spatial data types are (part of rule `spatialLiteral`): +The basic spatial data types are (part of rule `spatialInstance`): * "Point": a point; * "BBox": a bounding rectangle or box. @@ -454,11 +454,11 @@ A temporal predicate evaluates two time-valued expressions to determine, if the The operands in a temporal predicate are temporal geometries. A temporal geometry is either an instant or an interval. -==== Temporal data types and literal values +==== Temporal data types and instances An instant is either a date (rule `dateInstant`) or a timestamp (rule `timestampInstant`) in accordance with <> (RFC 3339 rules `full-date` or `date-time`). Note that since time is continuous, every instant has a duration and a start/end. Nevertheless, the geometry can be considered an instant in the temporal resolution that is applicable for the specific property. -An interval is the time between a start instant and an end instant, including both bounding instances (rule `intervalLiteral`). Unbounded interval ends are represented by a double-dot string ("..") based on the convention specified in ISO 8601-2. +An interval is the time between a start instant and an end instant, including both bounding instances (rule `intervalInstance`). Unbounded interval ends are represented by a double-dot string ("..") based on the convention specified in ISO 8601-2. CQL2 follows ISO 8601-1/ISO 8601-2 in defining intervals as closed at both start and end. Note that some implementations and other specifications use a different definition and it may be necessary to convert between the interval representations. For example, SQL uses half-closed intervals - closed at the start, open at the end. @@ -604,7 +604,7 @@ include::requirements/requirements_class_array-operators.adoc[] This clause specifies requirements for supporting array expression in CQL2. -==== Arrays and literal values +==== Arrays An array is a bracket-delimited, comma-separated list of array elements. An array element is either a scalar value, a geometry, an interval, or another array. diff --git a/cql2/standard/recommendations/advanced-comparison-operators/PER_in-predicate.adoc b/cql2/standard/recommendations/advanced-comparison-operators/PER_in-predicate.adoc index d6b85fbe..1c546330 100644 --- a/cql2/standard/recommendations/advanced-comparison-operators/PER_in-predicate.adoc +++ b/cql2/standard/recommendations/advanced-comparison-operators/PER_in-predicate.adoc @@ -2,6 +2,6 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/advanced-comparison-operators/in-predicate* -^|A |The server MAY not support `characterLiteral`, `numericLiteral`, `booleanLiteral` or `instantLiteral` as the value to be tested (rule `scalarExpression`, i.e., the left hand side of the predicate). +^|A |The server MAY not support `characterLiteral`, `numericLiteral`, `booleanLiteral` or `instantInstance` as the value to be tested (rule `scalarExpression`, i.e., the left hand side of the predicate). ^|B |The server MAY not support `propertyName` as the items in the list of an in-list predicate (rule `inList`, i.e., the items on the right hand side of the predicate). |=== diff --git a/cql2/standard/recommendations/array-operators/PER_array-predicates.adoc b/cql2/standard/recommendations/array-operators/PER_array-predicates.adoc index cfe38503..26fac2bc 100644 --- a/cql2/standard/recommendations/array-operators/PER_array-predicates.adoc +++ b/cql2/standard/recommendations/array-operators/PER_array-predicates.adoc @@ -2,6 +2,6 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/arrays/array-predicates* -^|A |The server MAY not support an `arrayLiteral` as the first operand (rule `arrayExpression`) in rule `arrayPredicate`. +^|A |The server MAY not support an `array` as the first operand (rule `arrayExpression`) in rule `arrayPredicate`. ^|B |The server MAY not support a `propertyName` as the second operand (rule `arrayExpression`) in rule `arrayPredicate`. |=== diff --git a/cql2/standard/recommendations/basic-cql2/PER_cql2-filter.adoc b/cql2/standard/recommendations/basic-cql2/PER_cql2-filter.adoc index cba94bcb..d072e395 100644 --- a/cql2/standard/recommendations/basic-cql2/PER_cql2-filter.adoc +++ b/cql2/standard/recommendations/basic-cql2/PER_cql2-filter.adoc @@ -2,7 +2,7 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/basic-cql2/cql2-filter* -^|A |In the rule `binaryComparisonPredicate` the server MAY only support `propertyName` in the first `scalarExpression` rule as well as `characterLiteral`, `numericLiteral`, `booleanLiteral`, and `instantLiteral` in the second `scalarExpression` rule. +^|A |In the rule `binaryComparisonPredicate` the server MAY only support `propertyName` in the first `scalarExpression` rule as well as `characterLiteral`, `numericLiteral`, `booleanLiteral`, and `instantInstance` in the second `scalarExpression` rule. ^|B |In the rule `isNullPredicate` the server MAY only support `propertyName` in the `scalarExpression` rule. |=== diff --git a/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-data-types.adoc b/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-data-types.adoc index e6ea4555..e16f37d7 100644 --- a/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-data-types.adoc +++ b/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-data-types.adoc @@ -2,5 +2,5 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/spatial-data-types* -^|A |The server MAY only support `pointTaggedText` and `bboxTaggedText` in rule `spatialLiteral`. +^|A |The server MAY only support `pointTaggedText` and `bboxTaggedText` in rule `spatialInstance`. |=== diff --git a/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-predicates.adoc b/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-predicates.adoc index e82e089b..0ed7407b 100644 --- a/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-predicates.adoc +++ b/cql2/standard/recommendations/basic-spatial-operators/PER_spatial-predicates.adoc @@ -2,6 +2,6 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/spatial-operators* -^|A |The server MAY not support a `spatialLiteral` as the first operand (rule `geomExpression`) in rule `spatialPredicate`. +^|A |The server MAY not support a `spatialInstance` as the first operand (rule `geomExpression`) in rule `spatialPredicate`. ^|B |The server MAY not support a `propertyName` as the second operand (rule `geomExpression`) in rule `spatialPredicate`. |=== diff --git a/cql2/standard/recommendations/cql2-json/PER_basic-cql2.adoc b/cql2/standard/recommendations/cql2-json/PER_basic-cql2.adoc index 4a75e0e5..0ada73d1 100644 --- a/cql2/standard/recommendations/cql2-json/PER_basic-cql2.adoc +++ b/cql2/standard/recommendations/cql2-json/PER_basic-cql2.adoc @@ -5,5 +5,5 @@ ^|A |The server MAY not support * the schema component "#/$defs/propertyRef" in an operand of a comparison operator, standardized spatial, temporal or array comparison functions starting with the second operand, -* the schema components "\#/$defs/scalarLiteral", "#/$defs/spatialLiteral", "\#/$defs/temporalLiteral" or "#/$defs/arrayLiteral" in the first operand of a comparison operator, standardized spatial, temporal or array comparison function. +* the schema components "\#/$defs/scalarLiteral", "#/$defs/spatialInstance", "\#/$defs/temporalInstance" or "#/$defs/array" in the first operand of a comparison operator, standardized spatial, temporal or array comparison function. |=== diff --git a/cql2/standard/recommendations/temporal-operators/PER_temporal-predicates.adoc b/cql2/standard/recommendations/temporal-operators/PER_temporal-predicates.adoc index 1dd78ef8..eabd3123 100644 --- a/cql2/standard/recommendations/temporal-operators/PER_temporal-predicates.adoc +++ b/cql2/standard/recommendations/temporal-operators/PER_temporal-predicates.adoc @@ -2,6 +2,6 @@ [width="90%",cols="2,6a"] |=== ^|*Permission {counter:per-id}* |*/per/temporal-operators/temporal-operators* -^|A |The server MAY not support a `temporalLiteral` as the first operand (rule `temporalExpression`) in rule `temporalPredicate`. +^|A |The server MAY not support a `temporalInstance` as the first operand (rule `temporalExpression`) in rule `temporalPredicate`. ^|B |The server MAY not support a `propertyName` as the second operand (rule `temporalExpression`) in rule `temporalPredicate`. |=== diff --git a/cql2/standard/requirements/cql2-json/REQ_basic-spatial-operators.adoc b/cql2/standard/requirements/cql2-json/REQ_basic-spatial-operators.adoc index 5b5ad6fb..d68126db 100644 --- a/cql2/standard/requirements/cql2-json/REQ_basic-spatial-operators.adoc +++ b/cql2/standard/requirements/cql2-json/REQ_basic-spatial-operators.adoc @@ -6,5 +6,5 @@ ^|A |The server SHALL be able to parse and evaluate filter expressions encoded as JSON that use the following schema components: * "#/$defs/spatialPredicate" where property "op" has the value "s_intersects" -* "#/$defs/spatialLiteral" where the value is either "#/$defs/point" or "#/$defs/bboxLiteral" +* "#/$defs/spatialInstance" where the value is either "#/$defs/point" or "#/$defs/bboxLiteral" |=== diff --git a/cql2/standard/requirements/cql2-json/REQ_property-property.adoc b/cql2/standard/requirements/cql2-json/REQ_property-property.adoc index f0d4640d..46dfcbfb 100644 --- a/cql2/standard/requirements/cql2-json/REQ_property-property.adoc +++ b/cql2/standard/requirements/cql2-json/REQ_property-property.adoc @@ -6,5 +6,5 @@ ^|A |In addition to the <> requirement, the server SHALL be able to parse and evaluate filter expressions encoded as JSON that use * the schema component "#/$defs/propertyRef" in an operand of a comparison operator, standardized spatial, temporal or array comparison function starting with the second operand, -* the schema components "\#/$defs/scalarLiteral", "#/$defs/spatialLiteral", "\#/$defs/temporalLiteral" or "#/$defs/arrayLiteral" in the first operand of a comparison operator, standardized spatial, temporal or array comparison function. +* the schema components "\#/$defs/scalarLiteral", "#/$defs/spatialInstance", "\#/$defs/temporalInstance" or "#/$defs/array" in the first operand of a comparison operator, standardized spatial, temporal or array comparison function. |=== diff --git a/cql2/standard/requirements/spatial-operators/REQ_spatial-data-types.adoc b/cql2/standard/requirements/spatial-operators/REQ_spatial-data-types.adoc index 39470b69..712282ff 100644 --- a/cql2/standard/requirements/spatial-operators/REQ_spatial-data-types.adoc +++ b/cql2/standard/requirements/spatial-operators/REQ_spatial-data-types.adoc @@ -2,5 +2,5 @@ [width="90%",cols="2,6a"] |=== ^|*Requirement {counter:req-id}* |*/req/spatial-operators/spatial-data-types* -^|A |The server SHALL support all spatial literals as defined by the BNF rule `spatialLiteral` in <>. +^|A |The server SHALL support all spatial literals as defined by the BNF rule `spatialInstance` in <>. |=== diff --git a/cql2/standard/schema/cql2.bnf b/cql2/standard/schema/cql2.bnf index ba6bba1c..1b8d21e9 100644 --- a/cql2/standard/schema/cql2.bnf +++ b/cql2/standard/schema/cql2.bnf @@ -52,7 +52,7 @@ binaryComparisonPredicate = scalarExpression scalarExpression = characterClause | numericLiteral - | instantLiteral + | instantInstance | arithmeticExpression | booleanExpression | propertyName @@ -95,8 +95,8 @@ isNullPredicate = isNullOperand "IS" ["NOT"] "NULL"; isNullOperand = characterClause | numericLiteral - | temporalLiteral - | spatialLiteral + | temporalInstance + | spatialInstance | arithmeticExpression | booleanExpression | propertyName @@ -127,7 +127,7 @@ spatialFunction = "S_INTERSECTS" # a geometric literal (expressed as WKT) or a function that returns a # geometric value. # -geomExpression = spatialLiteral +geomExpression = spatialInstance | propertyName | function; @@ -140,7 +140,7 @@ geomExpression = spatialLiteral temporalPredicate = temporalFunction "(" temporalExpression "," temporalExpression ")"; -temporalExpression = temporalLiteral +temporalExpression = temporalInstance | propertyName | function; @@ -169,23 +169,23 @@ temporalFunction = "T_AFTER" arrayPredicate = arrayFunction "(" arrayExpression "," arrayExpression ")"; -arrayExpression = arrayLiteral +arrayExpression = array | propertyName | function; -# An array literal is a bracket-delimited, comma-separated list of array +# An array literal is a parentheses-delimited, comma-separated list of array # elements. arrayLiteral = "(" ")" | "(" arrayElement [ { "," arrayElement } ] ")"; # An array element is either a character literal, a numeric literal, -# a geometric literal, a temporal literal, a property name, a function, an -# arithmetic expression or an array. +# a geometric literal, a temporal instance, a property name, a function, +# an arithmetic expression or an array. arrayElement = characterClause | numericLiteral - | temporalLiteral - | spatialLiteral - | arrayLiteral + | temporalInstance + | spatialInstance + | array | arithmeticExpression | booleanExpression | propertyName @@ -345,9 +345,9 @@ argumentList = argument [ { "," argument } ]; argument = characterClause | numericLiteral - | temporalLiteral - | spatialLiteral - | arrayLiteral + | temporalInstance + | spatialInstance + | array | arithmeticExpression | booleanExpression | propertyName @@ -468,14 +468,14 @@ booleanLiteral = "TRUE" | "FALSE"; # NOTE: This is basically BNF that define WKT encoding. It would be nice # to instead reference some normative BNF for WKT. #=============================================================================# -spatialLiteral = pointTaggedText - | linestringTaggedText - | polygonTaggedText - | multipointTaggedText - | multilinestringTaggedText - | multipolygonTaggedText - | geometryCollectionTaggedText - | bboxTaggedText; +spatialInstance = pointTaggedText + | linestringTaggedText + | polygonTaggedText + | multipointTaggedText + | multilinestringTaggedText + | multipolygonTaggedText + | geometryCollectionTaggedText + | bboxTaggedText; pointTaggedText = "POINT" pointText; @@ -511,8 +511,7 @@ multiLineStringText = "(" lineStringText {"," lineStringText} ")"; multiPolygonText = "(" polygonText {"," polygonText} ")"; -geometryCollectionText = "(" - spatialLiteral {"," spatialLiteral} ")"; +geometryCollectionText = "(" spatialLiteral {"," spatialLiteral} ")"; bboxTaggedText = "BBOX" bboxText; @@ -530,9 +529,9 @@ minElev = signedNumericLiteral; maxElev = signedNumericLiteral; -temporalLiteral = instantLiteral | intervalLiteral; +temporalInstance = instantInstance | intervalInstance; -instantLiteral = dateInstant | timestampInstant; +instantInstance = dateInstant | timestampInstant; dateInstant = "DATE" "(" dateInstantString ")"; @@ -544,8 +543,7 @@ timestampInstant = "TIMESTAMP" timestampInstantString = "'" fullDate "T" utcTime "'"; -intervalLiteral = "INTERVAL" - "(" instantParameter "," instantParameter ")"; +intervalLiteral = "INTERVAL" "(" instantParameter "," instantParameter ")"; instantParameter = dateInstantString | timestampInstantString diff --git a/cql2/standard/schema/cql2.json b/cql2/standard/schema/cql2.json index 89a7ce83..af1a13ba 100644 --- a/cql2/standard/schema/cql2.json +++ b/cql2/standard/schema/cql2.json @@ -131,7 +131,7 @@ "temporalInstantExpression": { "oneOf": [ { - "$ref": "#/$defs/instantLiteral" + "$ref": "#/$defs/instantInstance" }, { "$ref": "#/$defs/propertyRef" @@ -332,7 +332,7 @@ "geomExpression": { "oneOf": [ { - "$ref": "#/$defs/spatialLiteral" + "$ref": "#/$defs/spatialInstance" }, { "$ref": "#/$defs/propertyRef" @@ -387,7 +387,7 @@ "temporalExpression": { "oneOf": [ { - "$ref": "#/$defs/temporalLiteral" + "$ref": "#/$defs/temporalInstance" }, { "$ref": "#/$defs/propertyRef" @@ -423,7 +423,7 @@ "items": { "oneOf": [ { - "$ref": "#/$defs/arrayLiteral" + "$ref": "#/$defs/array" }, { "$ref": "#/$defs/propertyRef" @@ -434,7 +434,7 @@ ] } }, - "arrayLiteral": { + "array": { "type": "array", "items": { "oneOf": [ @@ -454,7 +454,7 @@ "$ref": "#/$defs/temporalExpression" }, { - "$ref": "#/$defs/arrayLiteral" + "$ref": "#/$defs/array" } ] } @@ -582,7 +582,7 @@ "$ref": "#/$defs/temporalExpression" }, { - "$ref": "#/$defs/arrayLiteral" + "$ref": "#/$defs/array" } ] } @@ -602,12 +602,12 @@ "type": "boolean" }, { - "$ref": "#/$defs/instantLiteral" + "$ref": "#/$defs/instantInstance" } ] }, - "spatialLiteral": { + "spatialInstance": { "oneOf": [ { "$ref": "#/$defs/geometryLiteral" @@ -848,27 +848,27 @@ } }, - "temporalLiteral": { + "temporalInstance": { "oneOf": [ { - "$ref": "#/$defs/instantLiteral" + "$ref": "#/$defs/instantInstance" }, { - "$ref": "#/$defs/intervalLiteral" + "$ref": "#/$defs/intervalInstance" } ] }, - "instantLiteral": { + "instantInstance": { "oneOf": [ { - "$ref": "#/$defs/dateLiteral" + "$ref": "#/$defs/dateInstant" }, { - "$ref": "#/$defs/timestampLiteral" + "$ref": "#/$defs/timestampInstant" } ] }, - "dateLiteral": { + "dateInstant": { "type": "object", "required": [ "date" ], "properties": { @@ -877,7 +877,7 @@ } } }, - "timestampLiteral": { + "timestampInstant": { "type": "object", "required": [ "timestamp" ], "properties": { @@ -904,7 +904,7 @@ "type": "string", "format": "date-time" }, - "intervalLiteral": { + "intervalInstance": { "type": "object", "required": [ "interval" diff --git a/cql2/standard/schema/cql2.yml b/cql2/standard/schema/cql2.yml index dc18253f..7301da5b 100644 --- a/cql2/standard/schema/cql2.yml +++ b/cql2/standard/schema/cql2.yml @@ -87,7 +87,7 @@ components: - $ref: '#/components/schemas/booleanExpression' temporalInstantExpression: oneOf: - - $ref: '#/components/schemas/instantLiteral' + - $ref: '#/components/schemas/instantInstance' - $ref: '#/components/schemas/propertyRef' - $ref: '#/components/schemas/functionRef' isLikePredicate: @@ -216,7 +216,7 @@ components: $ref: '#/components/schemas/geomExpression' geomExpression: oneOf: - - $ref: '#/components/schemas/spatialLiteral' + - $ref: '#/components/schemas/spatialInstance' - $ref: '#/components/schemas/propertyRef' - $ref: '#/components/schemas/functionRef' temporalPredicate: @@ -253,7 +253,7 @@ components: $ref: '#/components/schemas/temporalExpression' temporalExpression: oneOf: - - $ref: '#/components/schemas/temporalLiteral' + - $ref: '#/components/schemas/temporalInstance' - $ref: '#/components/schemas/propertyRef' - $ref: '#/components/schemas/functionRef' arrayPredicate: @@ -279,8 +279,8 @@ components: oneOf: - $ref: '#/components/schemas/propertyRef' - $ref: '#/components/schemas/functionRef' - - $ref: '#/components/schemas/arrayLiteral' - arrayLiteral: + - $ref: '#/components/schemas/array' + array: type: array items: oneOf: @@ -289,7 +289,7 @@ components: - $ref: '#/components/schemas/booleanExpression' - $ref: '#/components/schemas/geomExpression' - $ref: '#/components/schemas/temporalExpression' - - $ref: '#/components/schemas/arrayLiteral' + - $ref: '#/components/schemas/array' arithmeticExpression: type: object required: @@ -373,8 +373,8 @@ components: - type: string - type: number - type: boolean - - $ref: '#/components/schemas/instantLiteral' - spatialLiteral: + - $ref: '#/components/schemas/instantInstance' + spatialInstance: oneOf: - $ref: '#/components/schemas/geometryLiteral' - $ref: '#/components/schemas/bboxLiteral' @@ -550,22 +550,22 @@ components: maxItems: 6 items: type: number - temporalLiteral: + temporalInstance: oneOf: - - $ref: '#/components/schemas/instantLiteral' - - $ref: '#/components/schemas/intervalLiteral' - instantLiteral: + - $ref: '#/components/schemas/instantInstance' + - $ref: '#/components/schemas/intervalInstance' + instantInstance: oneOf: - - $ref: '#/components/schemas/dateLiteral' - - $ref: '#/components/schemas/timestampLiteral' - dateLiteral: + - $ref: '#/components/schemas/dateInsant' + - $ref: '#/components/schemas/timestampInstant' + dateInsant: type: object required: - date properties: date: $ref: '#/components/schemas/dateString' - timestampLiteral: + timestampInstant: type: object required: - timestamp @@ -582,7 +582,7 @@ components: timestampString: type: string format: date-time - intervalLiteral: + intervalInstance: type: object required: - interval