We can filter these results by using TupleTypes. If the TupleType elements are not specified, all the elements that can be returned for the specified DTDType will be returned. This may be time and resource consuming and we should avoid this in our prototype client.
TupleType takes the name of the result attribute (element) in the attributeName element. It also has an element PrimitiveTypeName that specifies the data type of the attribute. The list of possible result attributes (elements) that can be specified in TupleTypes depends on the DTD to which the results will conform.
Tuples are hierarchical in that if Platform is specified, Platform,
PlatformShortName, Instrument, InstrumentShortName, Sensor,
SensorShortName, SensorCharacteristitcs, SensorCharacteristicName,
SensorCharacteristicValue and OperationMode, will also be returned.
The following code which build Tuples into our previous query
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE CatalogService PUBLIC "-//ECHO CatalogService (v6.0)//EN" "http://api.echo.nasa.gov/echo/dtd/CatalogService.dtd">
<CatalogService>
<QueryRequest>
<QueryExpression>
<query>
<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//ECHO CatalogService (v6.0)//EN" "http://api.echo.nasa.gov/echo/dtd/IIMSAQLQueryLanguage.dtd">
<query>
<for value="granules"/>
<dataCenterId>
<value>ORNL-DAAC</value>
</dataCenterId>
<where>
<granuleCondition>
<dataSetId><textPattern>'%AMAZON%'</textPattern></dataSetId>
</granuleCondition>
</where>
</query>
]]>
</query>
<namespace>none</namespace>
<QueryLanguage>
<IIMSAQL/>
</QueryLanguage>
</QueryExpression>
<ResultType>
<RESULTS/>
</ResultType>
<IteratorSize>2</IteratorSize>
<Cursor>1</Cursor>
<PresentationDescription>
<TupleType>
<attributeName>Platform</attributeName>
<PrimitiveTypeName><Integer/></PrimitiveTypeName>
</TupleType>
<TupleType>
<attributeName>SensorShortName</attributeName>
<PrimitiveTypeName><String/></PrimitiveTypeName>
</TupleType>
<DTDType>
<ECHO/>
</DTDType>
</PresentationDescription>
</QueryRequest>
</CatalogService>
results in the return of the following payload
<payload>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE results SYSTEM "http://api.echo.nasa.gov/echo/dtd/ECHOGranuleResults.dtd">
<results>
<provider name='ORNL-DAAC'>
<result number='1' itemId='G14944434-ORNL-DAAC'>
<GranuleURMetaData>
<ECHOItemId>G14944434-ORNL-DAAC</ECHOItemId>
<GranuleUR>lba_legal_amazon.8kmlegamazon.dat.gz</GranuleUR>
<CollectionMetaData>
<DataSetId>LBA REGIONAL BOUNDARY FOR THE LEGAL AMAZON OF BRAZIL, 8-KM</DataSetId>
</CollectionMetaData>
<Platform>
<PlatformShortName>TOPOGRAPHIC MAP</PlatformShortName>
<Instrument>
<InstrumentShortName>ANALYSIS</InstrumentShortName>
<Sensor>
<SensorShortName>ANALYSIS</SensorShortName>
</Sensor>
</Instrument>
</Platform>
</GranuleURMetaData>
</result>
<result number='2' itemId='G14950140-ORNL-DAAC'>
<GranuleURMetaData>
<ECHOItemId>G14950140-ORNL-DAAC</ECHOItemId>
<GranuleUR>lba_reg_basin.lba_basin.dat.gz</GranuleUR>
<CollectionMetaData>
<DataSetId>LBA REGIONAL BOUNDARY FOR THE AMAZON AND TOCANTINS RIVER BASINS, 5-MIN</DataSetId>
</CollectionMetaData>
<Platform>
<PlatformShortName>DIGITAL ELEVATION MODEL</PlatformShortName>
<Instrument>
<InstrumentShortName>MODEL ANALYSIS</InstrumentShortName>
<Sensor>
<SensorShortName>MODEL ANALYSIS</SensorShortName>
</Sensor>
</Instrument>
</Platform>
</GranuleURMetaData>
</result>
</provider>
</results>
</payload
It is Jiboia's responsibility to both create the initial XML Query request object and handle the returned results set payload.[TODO]
vern 2006-10-25