-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue-630: Changes to define the "CASEI" function for supporting case-insensitive string comparisons. #641
Changes from 9 commits
9d5e464
e906e71
1ba1aec
3b544b3
dd2519c
5530ad6
4719095
80d81a6
a7eb3a8
93fb966
f5d9b05
8354a5c
95b426d
f68100d
63ad704
5928904
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ include::requirements/advanced-comparison-operators/REQ_like-predicate.adoc[] | |
|
||
include::recommendations/advanced-comparison-operators/PER_like-predicate.adoc[] | ||
|
||
[[example_8_4]] | ||
[[example_7_1]] | ||
.Example of a LIKE predicate | ||
==== | ||
---- | ||
|
@@ -46,7 +46,7 @@ include::requirements/advanced-comparison-operators/REQ_between-predicate.adoc[] | |
|
||
include::recommendations/advanced-comparison-operators/PER_between-predicate.adoc[] | ||
|
||
[[example_8_5]] | ||
[[example_7_2]] | ||
.Examples of a BETWEEN predicate | ||
==== | ||
---- | ||
|
@@ -69,7 +69,7 @@ include::requirements/advanced-comparison-operators/REQ_in-predicate.adoc[] | |
|
||
include::recommendations/advanced-comparison-operators/PER_in-predicate.adoc[] | ||
|
||
[[example_8_6]] | ||
[[example_7_3]] | ||
.Examples of a IN predicate | ||
==== | ||
---- | ||
|
@@ -103,14 +103,60 @@ category NOT IN (1,2,3,4) | |
---- | ||
==== | ||
|
||
[[case-insensitive-comparison]] | ||
=== Requirements Class "Case-insensitive Comparison" | ||
[[accent-case-insensitive-comparison]] | ||
=== Requirements Class "Accent and Case-insensitive Comparison" | ||
|
||
include::requirements/requirements_class_case-insensitive-comparison.adoc[] | ||
include::requirements/requirements_class_accent-case-insensitive-comparison.adoc[] | ||
|
||
This requirements class adds support for case-insensitive string comparisons. | ||
|
||
#TODO: add requirement for UPPER() and LOWER(). However, there is still the unresolved question how we exactly define UPPER() and LOWER(). Or whether we should define a unicode case folding function instead (see http://unicode.org/reports/tr21/tr21-5.html#Caseless_Matching[Unicode] or https://www.w3.org/TR/charmod-norm/#definitionCaseFolding[W3C]).# | ||
include::requirements/accent-case-insensitive-comparison/REQ_casei-builtin-function.adoc[] | ||
|
||
[[example_7_4_casei]] | ||
.Example case-insensitive comparison | ||
==== | ||
|
||
---- | ||
CASEI(road_class) IN (CASEI('Οδος'),CASEI('Straße')) | ||
---- | ||
|
||
[source,JSON] | ||
---- | ||
{ | ||
"in": [ | ||
{ "function": { "name": "casei", "arguments": ["road_class"] } }, | ||
[ | ||
{ "function": { "name": "casei", "arguments": ["Οδος"] } }, | ||
{ "function": { "name": "casei", "arguments": ["Straße"] } } | ||
] | ||
] | ||
} | ||
---- | ||
==== | ||
|
||
This requirements class adds support for accent-insensitive string comparisons. | ||
|
||
include::requirements/accent-case-insensitive-comparison/REQ_accenti-builtin-function.adoc[] | ||
|
||
[[example_7_4_accenti]] | ||
.Example accent-insensitive comparison | ||
==== | ||
|
||
---- | ||
etat_vol = ACCENTI('débárquér') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pvretano I know you just merged this, but shouldn't this be
as as it is for CASEI? same for the JSON example. |
||
---- | ||
|
||
[source,JSON] | ||
---- | ||
{ | ||
"op": "=", | ||
"args": [ | ||
{ "property": "etat" }, | ||
{ "function": { "name": "accenti", "args": ["débárquér"] } }, | ||
] | ||
} | ||
---- | ||
==== | ||
|
||
[[basic-spatial-operators]] | ||
=== Requirements Class "Basic Spatial Operators" | ||
|
@@ -129,7 +175,7 @@ include::recommendations/basic-spatial-operators/PER_spatial-predicates.adoc[] | |
|
||
CQL2 uses Well-Known Text (WKT) or GeoJSON to encode geometry literals. Since WKT and GeoJSON do not provide a capability to specify the CRS of a geometry literal, the server has to determine the CRS of the geometry literals in a filter expression through another mechanism. For example, a query parameter `filter-crs` is used in <<OGCFeat-3,OGC API - Features - Part 3: Filtering>> to pass the CRS information to the server. | ||
|
||
[[example_9_1]] | ||
[[example_7_5]] | ||
.Example spatial predicate | ||
==== | ||
---- | ||
|
@@ -156,7 +202,7 @@ S_INTERSECTS(geometry,POLYGON((36.319836 32.288087,36.320041 32.288032,36.320210 | |
---- | ||
==== | ||
|
||
[[example_9_2]] | ||
[[example_7_6]] | ||
.Example for the filter-crs query parameter | ||
==== | ||
---- | ||
|
@@ -214,7 +260,7 @@ image::images/within.png[alt=Within,width=70%] | |
|
||
NOTE: If geometry *_a_* `S_CONTAINS` geometry *_b_*, then geometry *_b_* is `S_WITHIN` geometry *_a_*. | ||
|
||
[[example_9_3]] | ||
[[example_7_7]] | ||
.Example of a spatial relationship between a property and a literal geometry. | ||
==== | ||
---- | ||
|
@@ -317,7 +363,7 @@ include::requirements/temporal-operators/REQ_temporal-operators.adoc[] | |
|
||
include::recommendations/temporal-operators/PER_temporal-predicates.adoc[] | ||
|
||
[[example_9_4]] | ||
[[example_7_8]] | ||
.Examples of temporal predicate using T_INTERSECTS | ||
==== | ||
---- | ||
|
@@ -335,7 +381,7 @@ T_INTERSECTS(event_date, INTERVAL("1969-07-16T05:32:00Z", "1969-07-24T16:50:35Z" | |
---- | ||
==== | ||
|
||
[[example_9_5]] | ||
[[example_7_9]] | ||
.Examples of temporal relationships using a property and a temporal literal. | ||
==== | ||
---- | ||
|
@@ -370,7 +416,7 @@ the requirements class <<rc_functions,Custom Functions>>. | |
Support for the BNF rule `arithmeticExpression` is added by | ||
the requirements class <<rc_arithmetic,Arithmetic Expressions>>. | ||
|
||
[[example_9_6]] | ||
[[example_7_10]] | ||
.Evalute if the value of an array property contains the specified subset of values. | ||
==== | ||
---- | ||
|
@@ -394,7 +440,7 @@ This requirements class adds support for properties on the right side of predica | |
|
||
include::requirements/property-property/REQ_withdraw-permissions.adoc[] | ||
|
||
[[example_9_7]] | ||
[[example_7_11]] | ||
.Example of a spatial relationship between two literal geometries. | ||
==== | ||
---- | ||
|
@@ -436,7 +482,7 @@ S_CROSSES(LINESTRING(43.72992 -79.2998, 43.73005 -79.2991, 43.73006 -79.2984, | |
---- | ||
==== | ||
|
||
[[example_9_8]] | ||
[[example_7_12]] | ||
.Examples of temporal relationships using temporal literals. | ||
==== | ||
---- | ||
|
@@ -465,7 +511,7 @@ include::requirements/functions/REQ_functions.adoc[] | |
NOTE: Support for the BNF rule `arithmeticExpression` is added by | ||
the requirements class <<rc_arithmetic,Arithmetic Expressions>>. | ||
|
||
[[example_9_9]] | ||
[[example_7_13]] | ||
.Example of a spatial relationship between a property and a function that return a geometry value. | ||
==== | ||
It should be noted that the function "Buffer()" in this example is not part of CQL2 but is an example of a function that an implementation may offer that returns a geometry value. | ||
|
@@ -499,7 +545,7 @@ include::requirements/arithmetic/REQ_arithmetic.adoc[] | |
|
||
NOTE: Support for the BNF rule `function` is added by the requirements class <<rc_functions,Custom Functions>>. | ||
|
||
[[example_9_11]] | ||
[[example_7_14]] | ||
.Predicate with an arithmetic expression finding all vehicles that are too tall to pass under a bridge. | ||
==== | ||
---- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[req_accent-case-insensitive-comparison_accenti-builtin-function]] | ||
[width="90%",cols="2,6a"] | ||
|=== | ||
^|*Requirement {counter:req-id}* |*/req/accent-case-insensitive-comparison/accenti-builtin-function* | ||
^|A |The server SHALL support a built-in function named `ACCENTI`. | ||
^|B |The function SHALL accept one argument that can be a character string literal, the name of a property that evaluates to a string literal or a function that returns a string literal (see rules `characterLiteral`, `propertyName`, `function`). | ||
cportele marked this conversation as resolved.
Show resolved
Hide resolved
|
||
^|C |The function SHALL return a character string literal. | ||
^|D |The function SHALL implement https://www.w3.org/TR/charmod-norm/#unicodeNormalization[unicode normalization] described in the implementation guidelines of https://www.unicode.org/versions/Unicode14.0.0[The Unicode Standard, Version 14.0] (see https://www.unicode.org/versions/Unicode14.0.0/ch05.pdf[clause 5.6 Normalization]). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding the term “Unicode normalization” to the terms & definitions. Unicode normalization There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meeting 2022-01-17: Agreed. |
||
|=== | ||
|
||
NOTE: The references in D need to be verified. Also need to have some discussion about NFC (cacnonically-composed form) or NFD (canonically decomposed form). I think the correct thing is to say that ACCENTI() must do NFC ... but I need to verify. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[[req_accent-case-insensitive-comparison_casei-builtin-function]] | ||
[width="90%",cols="2,6a"] | ||
|=== | ||
^|*Requirement {counter:req-id}* |*/req/accent-case-insensitive-comparison/casei-builtin-function* | ||
^|A |The server SHALL support a built-in function named `CASEI`. | ||
^|B |The function SHALL accept one argument that can be a character string literal, the name of a property that evaluates to a string literal or a function that returns a string literal (see rules `characterLiteral`, `propertyName`, `function`). | ||
cportele marked this conversation as resolved.
Show resolved
Hide resolved
|
||
^|C |The function SHALL return a character string literal. | ||
^|D |The function SHALL implement the https://www.w3.org/TR/charmod-norm/#definitionCaseFolding[full case folding] algorithm defined in the implementation guidelines of https://www.unicode.org/versions/Unicode14.0.0[The Unicode Standard, Version 14.0] (see https://www.unicode.org/versions/Unicode14.0.0/ch05.pdf[clause 5.18 Case Mappings, sub-clause Caseless Matching]). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding the term “Unicode case folding” to the terms & definitions: Unicode case folding Note: Case folding is meant for the purpose of string matching. Source: https://www.w3.org/TR/charmod-norm/#definitionCaseFolding Consider adding and using the term “Unicode case-insensitive matching” as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meeting 2022-01-17: Agreed. |
||
|=== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term “collation” does not seem to be used in the remainder of the document. Should it be removed from the terms & definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meeting 2022-01-17: Use the term in the description and keep the definition.