Introduction Nested KVP encoding of dependent parameters

Copyright © 2010 Open Geospatial Consortium, Inc. 85 Real numbers shall be represented in a manner consistent with the specification for double-precision numbers in Section 3.2.5 of [XML Schema Part 2: Datatypes]. This representation allows for integer, decimal and exponential notations. This representation also allows special values representing infinity and not-a-number, which shall not be used except where specifically allowed by an Implementation Specification. A real value is allowed in all numeric fields unless the value is explicitly restricted to integer. Boolean values shall be represented by the uppercase strings TRUE and FALSE, representing Boolean true and false respectively. Each Implementation Specification shall explicitly specify where a Boolean value is mandatory.

11.5.5 Parameter names

The set of all parameters and their names used in KVP encoding should be constant and fully specified by each specific OWS, except for allowed variations in capitalization. That is, these parameter names should not depend on the values of other parameters, such as the specific dataset being accessed. This constancy of parameter names is required to allow describing the operation request using WSDL, and is desirable to allow use of options available in the OperationsMetadata section of service metadata or Capabilities documents. EXAMPLE 1 The parameter named PARAMETER in WCS 1.0.0 GetCoverage requests fails this recommendation. EXAMPLE 2 The ―other sample dimensions‖ in WMS 1.3.0 GetMap requests fails this recommendation.

11.5.6 Nested KVP encoding of dependent parameters

11.5.6.1 Introduction

Where there is a need for variable or dependent KVP parameter names the specific OWS should encode the variable parameters nested within a fixed parameter. The name of fixed parameter is determined by the specific OWS. The entire nested parameter shall be URL encoded see Subclause 11.3 to prevent confusing the fixed parameters with the variable parameters. When there is more than one nested or dependent parameter then those variable parameters should be nested and encoded within one fixed parameter. When nested KVP parameters are used the value of the fixed parameter shall use the KVP encoding techniques described in Subclause 11.2. Additionally, the value of the fixed parameter shall be URL encoded to escape all special characters. EXAMPLE The WPS 1.0.0 OGC 05-007r5 specifies the fixed parameter named DATAINPUTS using a syntax containing the ―‖ and ―;‖ characters as separators between inputs and their attributes. Instead the WPS should have used nested KVP encoding. Modifying the WPS to use nested KVPs would require: Original whitespace exists only to help distinguish parameters and attributes. The entire value has not been URLEncoded to help legibility: 86 Copyright © 2010 Open Geospatial Consortium, Inc. DataInputs = BufferDistance=100 datatype=integer uom=meter ; data=http:serverwfs?request=GetFeatureservice=WFSversion=1.0.0Identifier= ShpConvertToGMLDataInputs=complexFieldName=http3A2F2Ffoo2Ebar2Fshapefile mimeType=textxmlEncoding=utf-8Schema=gml Nested KVP version: 1. Nest and URL Encode each parameter’s attributes and attribute values notice the new value attribute: DataInputs = BufferDistance= value=100datatype=integeruom=meter ; data=http:serverwfs?request=GetFeatureservice=WFSversion=1.0.0Identifi er=ShpConvertToGMLDataInputs=complexFieldName=http3A2F2Ffoo2Ebar2Fshap efilemimeType=textxmlEncoding=utf-8Schema=gml 2. URL Encode each parameter’s value DataInputs=BufferDistance=value3D10026datatype3Dinteger26uom3Dmeter data=http:serverwfs?request=GetFeatureservice=WFSversion=1.0.0Identifi er=ShpConvertToGMLDataInputs=complexFieldName=http3A2F2Ffoo2Ebar2Fshap efilemimeType=textxmlEncoding=utf-8Schema=gml 3. URL Encode entire value of DataInputs parameter DataInputs=BufferDistanceBufferDistance3Dvalue253D1002526datatype253Dint eger2526uom253Dmeterdata=http3A2F2Ffoo2Ebar2E22Fwps3Frequest3DExe cute26service3Dwps26version3D12E02E026Identifier3DShpConvertToGML26 DataInputs3DcomplexFieldName3Dhttp253A252F252Ffoo252Ebar252Fshapefile 40mimeType3Dtext2Fxml40Encoding3Dutf2D840Schema3Dgml IMPLEMENTATION NOTE To access the nested parameters a server simply needs to extract the value of the outer parameter, URL Decode the value, then parse the value using the same parsing code. NOTE It is possible to nest parameters recursively to any level but nesting more than one or two levels deep is likely impractical.

11.5.6.2 Nested KVP syntax