TJS GetData Operation
The GetData operation provides a means for a client to retrieve attribute data. The response includes descriptive information about each attribute included in the response, as well as the attribute values for all selected records. The attribute values are returned to a client as an XML document, in GDAS format.
GetData Request
Parameters
| Name | Presence | Description |
|---|---|---|
| Service | Required | Identifies service type. Must be "TJS". |
| Version | Required | Identifies service version. Defaults to the latest available version, currently 1.0. |
| Request | Required | Identifies service request. Must be "GetData" |
| AcceptLanguages | Optional | Determines the language of the human-readable content of the response. Consists of a list of RFC 4646 language tags, comma-delimited and in order of preference. |
| FrameworkURI | Required | The URI of the spatial framework, as indicated in the DescribeFrameworks response. |
| DatasetURI | Required | The URI of the attribute dataset, as indicated in the DescribeDatasets response. |
| Attributes | Optional | The AttributeNames requested by the user, in comma-delimited format. |
| LinkageKeys | Optional | The DatasetKey identifiers requested by the user. Identifiers shall be in comma-delimited format, where ranges shall be indicated with a minimum value and maximum value separated by a dash ("-"). The same Identifier cannot be requested multiple times. |
| XSL | Optional | The URL of a valid XSLT document that shall be referenced in the response. (Note that the XSL file must be accessible via the same server and port number as the GDAS GetData operation, since cross-domain XSLT references are not supported by most web browsers.) |
| Aid | Optional | Boolean value used to request the inclusion of an attribute identifiers in the Rowset portion of the response. When "Aid" is set to "true", an "aid" attribute will be included with each "V" found in the response. Default is "false". |
Methods
HTTP GET method using KVP (mandatory)
All TJS servers shall implement HTTP GET transfer of the GetData request, using KVP encoding. The KVP encoding of the GetData request shall use the parameters specified above. An example of a GetData request via HTTP GET is:
http://foo.bar/foo?
Service=TJS&
Version=1.0&
Request=GetData&
AcceptLanguages=en&
FrameworkURI=http://nrcan.gc.ca/Provinces/2001&
DatasetURI=http://statcan.ca/2001Census
Attributes=cattlecalves,cows&
LinkageKeys=10,11,12,13,24,35,46-48&
XSL=http://foo.bar/foo&
Aid=false
Note: URL encoding of KVP values in this example has been removed for clarity.
HTTP POST method using XML (optional)
TJS servers may also implement HTTP POST transfer of the GetData operation request, using XML encoding only. The request parameters are encoded as XML elements, with their contents equivalent to those indicated in the parameter table shown above, and encoded according to the GetData request XML schema. The following example indicates the contents and structure of a GetData operation request encoded in XML.
<GetData service="TJS" version="1.0" language="en-CA">
<FrameworkURI>http://nrcan.gc.ca/Provinces/2001</FrameworkURI>
<DatasetURI>http://statcan.ca/2001Census</DatasetURI>
<Attributes>cattlecalves,cows</Attributes>
<LinkageKeys>10-13,24,35,46-48,59</LinkageKeys>
<XSL>http://www.ogcnetwork.net/schemas/tjs/1.0/examples_xslt/gdas2html2.xsl</XSL>
</GetData>
GetData Response
Schema
The normal response to a valid GetData operation request shall be a GDAS data structure, which encodes attribute data along with associated metadata. GDAS is encoded in XML according to the GetData response XML schema.
Examples
Exceptions
When a TJS server encounters an error while performing a GetData operation, it shall return an exception report message as specified in Clause 8 of [OGC 06-121r3]. The allowed exception codes shall include those listed in Table 5 of Subclause 7.4.1 of [OGC 06-121r3].
For more information on structuring requests, please see the TJS Standard.