Double Quotes in Constraint Expressions: Difference between revisions
From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
(New page: ==DAP 3.2== Double quotes (") can be used to quote any identifier in a Constrain Expression. ==Rationale== Many data sets us identifier names which contain characters other than those ...) |
|||
Line 8: | Line 8: | ||
===examples=== | ===examples=== | ||
;scale factor | |||
:"scale_factor" or scale%20factor or "scale%20factor" | |||
;level_2 data.scale factor | |||
:"level_2 data"."scale Factor" and the %20 variants. Note that each component of the full field name is quoted separately so the dot (.) will be read by the parser | |||
;level.2.data&errors | |||
:"level.2"."data&errors" In this example, the first dot is part of the variable name and the second is a separator between a field and its container | |||
==Implementation Note== | ==Implementation Note== |
Revision as of 20:52, 24 February 2009
DAP 3.2
Double quotes (") can be used to quote any identifier in a Constrain Expression.
Rationale
Many data sets us identifier names which contain characters other than those that qualify as an identifier in a programming language like C. For example, using an ampersand (&) in a variable name will cause a conflict with the meaning of an ampersand as a prefix AND operator in the CE's selection clause. Enclosing the identifier name in double quotes resolves the ambiguity. The same can be said for other DAP/CE meta-characters like the dot (.) which serves as a separator for the name of a Structure, et c., and its fields.
examples
- scale factor
- "scale_factor" or scale%20factor or "scale%20factor"
- level_2 data.scale factor
- "level_2 data"."scale Factor" and the %20 variants. Note that each component of the full field name is quoted separately so the dot (.) will be read by the parser
- level.2.data&errors
- "level.2"."data&errors" In this example, the first dot is part of the variable name and the second is a separator between a field and its container