You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

Preface

This document provides a look and guide to the Common Metadata Repository (CMR) from the perspective of the Client Partner.

Conventions

  • All references to time are in Universal Time Coordinated (UTC).
  • Data Partners are also referred to as Data Providers.
  • Client Partners are also referred to as Client Developers.
  • Words in bold text are key words or concepts. 

  • Programming examples use a fixed width font, have upper/lower lines separating them 
    from the rest of the text, and are in this color font. 

     

  • Comments (denoted by // within examples) 

  • Best practices or warnings appear in italicized, boxed text.

 

Before You Begin

The primary reason for designing the CMR was to increase access to Earth Science data and services by providing a system with a machine-to-machine interface, that is, an Application Programming Interface (API). The CMR functions as a metadata clearinghouse of Earth Science metadata for a wide variety of partners, enabling the science community to exchange information. Data Partners provide the Earth Science community with metadata representing their Earth Science data holdings. CMR technology in turn provides services for Client Partners and Data Partners and supports efficient discovery and access to Earth science data. 
The CMR also functions as an order broker for the data, and offers services applied to that data. The CMR provides a portal on the internet where CMR clients can search the metadata for information they wish to order.   The CMR also functions as an internet portal where CMR clients can search the metadata for information they wish to retrieve.
Client applications can access data holdings via order distribution or online access. Data Partners retain complete control over what metadata are represented in the CMR including inserting new metadata, modifying existing metadata and removing old metadata, and controlling access to their metadata.

Tasks That You Will Perform as a Client Partner

Usually performed in the order shown below:

In Chapter 4

  • Logging in and getting started
    • Creating and managing CMR sessions
    • Creating and managing user accounts

In Chapters 56 and 8

  • Querying for Earth Science Data
    • Formatting query results
    • Handling large result sets
    • Using subscriptions to automate queries
      • Creating and deleting subscriptions
      • Listing subscriptions

In Chapter 7

  • Ordering Retrieving data through CMR
    • Adding order items
    • Updating order items
    • Removing order items
    • Removing orders
    • Setting user information for an order
    • Validating orders
    • Requesting a quote for an order (LBN: I thought this was free?)
    • Submitting an order
    • Tracking or canceling an order

In Chapter 8

  • Using Event Notification Service
    • Setting delivery modes
    • Filtering events
    • Creating event subscriptions
    • Removing event subscriptions
    • Renewing event subscriptions

Skills You Will Need as a Client Partner

Since the CMR uses platform-independent web service definitions for its API, there are no requirements for a client programming language. All examples in this document are in snippets of Java code; however, the code samples provided could be translated to any web service capable language. 
As a CMR Data Partner, you need to be familiar with basic software development and Service Oriented Architecture (SOA) concepts such as:

  • XML and XML Schema (XSD)
  • Client/Server-based programming (client stubs, remote endpoints, etc.)

As a REST-API user, you will need:

  • A basic understanding of the REST concept
  • HTTP

As a SOAP-API user, you will need:

  • Web Service Definition Language (WSDL)
  • Service-based Application Programmer's Interface (API)

CMR Concept and Design

NASA's Earth Science Data and Information System (ESDIS) has built the CMR based on Extensible Markup Language (XML) and Web Service technologies. The CMR interfaces with clients and users through its series of Application Program Interfaces (APIs). The CMR is an open system with published APIs available to the CMR Development and User community. 
As the CMR is a middleware application, interacting with it means interacting with the CMR API. There is typically a user-focused client application interacting with CMR's API on behalf of an end user. This client may be a generic, query and order-based client, or may be specific to an end user's research, mission, or general area of interest. The CMR incorporates a Universal Description, Discovery, and Integration (UDDI) registry to facilitate registration, discovery, and invocation of services related to the CMR holdings. 
Internally, the CMR specifies APIs and provides middleware components, including data and service search and access functions, in a layered architecture. The figure below depicts the CMR system context in relation to its public APIs.


All CMR metadata are stored in an Oracle database with spatial extensions. The metadata model is derived primarily from that used by the Earth Observing System Data and Information System (EOSDIS) Core System (ECS). For more details about the CMR model, refer to the Earth Science Metadata Model chapter of the Data Partner Guide
Key features of the CMR architecture are:

  • Ease of Partner Participation
    Designed to be low-cost and minimally intrusive, the CMR offers a set of standard ways for partners to interface with the system and a metadata exchange approach that accommodates existing partners and technology.
  • Data Model Consistency
    To mitigate the risk of being unable to match all possible partner data models, the CMR has prototyped a Metadata Mapping Tool to translate non-standard formats upon ingest into the CMR.
  • Open System/Published APIs
    To accommodate independent clients, the CMR uses an open system approach and publishes domain APIs. These APIs are independent of the underlying transport protocols used. The CMR communicates using WS-I Basic Profile v1.0 compliant web services. This API is located at  api.cmr.nasa.gov/cmr. Interactions with the CMR may involve user interactions in real time or may be machine to machine.
  • Evolutionary Development
    The CMR system is being developed incrementally to allow for insight and feedback during the development cycle. Industry trends are followed and the use of commercial, off-the-shelf (COTS) products is optimized.
  • Extensibility of Client User Interfaces and Capabilities
    CMR extensibility is ensured by its component architecture, which allows new capabilities and functions to be plugged in, modeling relationships between services/APIs/UIs, and continued prototyping. the CMR's current focus is on the middleware and on enabling many different types of user interfaces via its APIs.

CMR as a Spatially Enabled Metadata Search and Order System

Oracle enables the the CMR system to interact with spatially enabled Earth science metadata by use of spatial extensions into the system and business logic within the system that understands how to interact with that metadata. In addition, a second CMR interface (Ingest) allows metadata updates to go directly into the database, bypassing the message-passing API. The File Transfer Protocol (FTP) server is configured to receive these update files, which are expressed in XML conforming to three schemas, one for granules (or inventory), one for collections (or datasets), and one for browse. 
Note: For E CHO 10.0 and later, these formats are schemas; for legacy E CHO, these formats are DTDs.

The schemas are defined on the E CHO 10.10 Ingest DTD/Schemas page of the E CHO  website: http://api.e cho.nasa.gov/e cho/apis.html
Oracle's spatial capabilities support queries for CMR metadata whose spatial extents are described within the system. A Data Partner can define the spatial extent of a granule or a collection with different spatial constructs (for example: point and polygon). A Client Partner can then construct a search using a point, a line, or a polygon (or multiple polygon) spatial type, and the CMR responds with data whose spatial regions intersect the described region. The CMR provides services for interacting with its Catalog of metadata. Queries can be performed in a number of ways; result formats can be specified, and the resulting data sets can be incrementally accessed so that large return sets can be handled gracefully. The CMR also supports constructing, submitting, and tracking orders for the data that the metadata represents. The CMR supports both an embedding of a Uniform Resource Locator (URL) within the metadata for accessing the data (which the client simply accesses via Hypertext Transfer Protocol [HTTP]), and a more complicated order process in which quotes and order options are accommodated. 
The CMR incorporates the ECS concept of granules and collections and defines separate DTDs for updating each, under the assumption that granules will indicate which collection is considered their ―primary‖ collection. ―Primary collection‖ "primary collection."  "Primary Collection" means the collection that owns the granule. 
collection is a grouping of granules that all come from the same source, such as a modeling group or institution. Collections have information that is common across all the granules they "own" and a template for describing additional attributes not already part of the metadata model. 
granule is the smallest aggregation of data that can be independently managed (described, inventoried, and retrieved). Granules have their own metadata model and support values associated with the additional attributes defined by the owning collection. 
A third type of metadata is browse metadata, which provide a high-level view of granule or collection metadata and cross-referencing to other granules or collections.  Browse metadata are not spatially enabled but are still useful.

Security

The CMR system supports Secure Sockets Layer (SSL)-based communication, which a client must use to pass passwords or other sensitive information securely. Internally, the systems are firewalled to prevent unintended access.

Supported Platforms

The CMR system supports clients capable of initiating an HTTP connection from a variety of programming languages

CMR Capability and Functionality

The CMR provides an infrastructure that allows various communities to share tools, services, and metadata. As a metadata clearinghouse, it supports many data access paradigms such as navigation and discovery. As an order broker, the CMR forwards orders for data discovered through the metadata query process to the appropriate Data Partners for order fulfillment. As a service broker, the CMR decentralizes end user functionality and supports interoperability of distributed functions. 
Although this Guide focuses on the needs of Client Partners, the CMR supports the following different, nonexclusive types of Partners:

  • Data Partners: Organizations that supply metadata representing their data holdings to the CMR database.
  • Client Partners: Organizations that participate by developing software applications to access the Earth science metadata in the CMR database.
  • Service Partners: Organizations that participate by advertising their Earth science-related services to the user community via the CMR, which maintains service descriptions in a Service Catalog (either special services, or services that are available as an option on a selected set of granules/collections) and support the user in ordering those services.
  • Extended Service Partners: Organizations that participate by providing a central location for registration, classification, and maintenance of Earth science services, interfaces, GUIs, and advertisements. The CMR addresses science user needs through a set of well-defined and open interfaces upon which the user community can build its own client applications. In this way, the CMR supports extendable, flexible user interfaces, allowing industry and the science community to drive the progress of available Earth science applications. For more complete information about client applications, refer to the companion piece to this Guide, the E CHO 10.10
  • Data Partner's Guide: The CMR approach allows users to build their own user interfaces to the CMR, rather than being limited to the data search and order system provided by NASA. For Data Partners, the CMR offloads the burden of providing the system resources required for searching and gives users the flexibility to support community-specific services and functionality. the CMR's interoperability features allow all participants to benefit from the distributed development of functions, again reducing dependence on NASA resources.

CMR Benefits to Client Partners

To address the CMR system vision, the CMR has responded to a set of system drivers, that is, reasons for upgrading. These drivers, derived from functional, organizational, and operational concerns expressed by the user community, determined the architectural approach and the types of technical solutions used in building the CMR system.

Ease of Participation

The primary goal of the CMR is to enable organizations to participate in making their resources and capabilities available to the Earth Science community. To facilitate participation by these organizations, the CMR has:

  • Minimized the number of requirements that a partner must meet to participate.
  • Involved partners in the system's development cycle and requirements definition.
  • Selected metadata insert and update mechanisms based on current standard industry practice (for example, XML) that most databases can generate automatically.
  • Provided mapping capabilities to convert from one XML representation into another.

Cost to Field

While aggressive in the capabilities it is targeted to support, the CMR minimizes the Cost to Field by continually evaluating performance and functionality against costs, for example, licensing of Commercial Off-the-Shelf (COTS) applications, amount of custom code required, hardware platform requirements, and complexity of networking and installation.

Cost to Operate

Once fielded, the CMR seeks to minimize the cost to operate the system by making it easier to use, thereby minimizing the load on operations staff.

Extensibility

The CMR is being built with long-term extensibility foremost in mind. To enable emerging techniques and strategies for Earth Science research, the CMR has:

  • Adopted a 'design for change' as a goal at the beginning of the CMR development.
  • Built in the capability to limit the impact of changes to the API on the configuration file, the service interface, and the business logic that implement the function.
  • Developed test tools to regression test large portions of functionality automatically overnight, so that when changes are made, undesirable impacts can be discovered quickly.
  • Adopted a layered architecture to allow changes to one component of the system without affecting other components.

CMR Systems

There are three CMR Systems that you, as a Client Partner, have access to:

CMR Operations: This is the current operational system for the CMR and is available to all users.

Location: http://api.cmr.nasa.gov/cmr/index.html

CMR Partner Test: This is an operational system used only by the CMR partners where they can test their data and services prior to making the final changes in the operational system.

Location: http://api-test.cmr.nasa.gov/cmr/index.html

CMR Testbed: This is a test system area used by partners and CMR testers to test before changes to the CMR system go operational.

Location: http://testbed.cmr.nasa.gov/cmr/index.html

Logging in, setting up and getting started

This section contains information and examples that are common to most CMR client applications, such as basic Login and Logout and creation and management of user accounts.

CMRTokens & User Contexts

There are two types of users in the CMR: registered users and guests. LBN: Is this still valid or is URS now required? Registered users can have access to restricted data and services but requires the creation of a URS profile. Guest users do not require a URS profile but their access is limited in some areas.

CMR tokens are generated whenever a user interacts with a CMR API. A token is a transient representation of either your URS credentials or your guest status.

In both CMR-REST and CMR-SOAP LBN: Does CMR have a SOAP API? APIs registered access requires the creation of a CMR token and then use of that token throughout your interaction with the CMR.

In the case of CMR-REST, guest token creation is carried out behind the scenes of the API. In the case of CMR-SOAP a client must manually create their token to interact with the API.

User Accounts

Create your user credentials in URS and use them to interact with the CMR using your user name and password.

Creating and Managing CMR Sessions

When using the Web Services API, you need to request a CMR token for all but CMR-REST guest access.

This token acts as your session key and must be passed to all other CMR operations. All clients interfacing with the system are required to pass client identifier information to the CMR. The client identifier is a short description and/or name of the client. Client developers are encouraged to keep this information as concise as possible and to work with the CMR Operations Group to create an appropriate identifier.
A token is obtained when logging into the CMR (see Logging Into the CMR). This is also done when setting user and provider context.
When done working in the CMR, be sure to logoff (see Logging Out of the CMR).
NOTE: If client identifier information is not provided, submitted orders will fail.

Logging Into the CMR

The REST way

Create a token via a POST to the token resource

 

Creating a CMR token for a user
Request headers:
Content-Type: application/xml
 
Request:
POST https://api.cmr.nasa.gov/cmr-rest/tokens
 
Request body:
<token>
    <username>Your URS username</username>
    <password>Your URS password</password>
    <client_id>An arbitrary ID to identify yourself</client_id>
    <user_ip_address>Your IP address</user_ip_address>
</token>

 

If you want to perform operations as a provider then you need the provider id and the credentials of a user that has provider privileges.

 

Creating a CMR token for a provider
Request headers:
Content-Type: application/xml
 
Request:
POST https://api.cmr.nasa.gov/cmr-rest/tokens
Request body:
<token>
    <username>Your URS username</username>
    <password>Your URS password</password>
    <client_id>An arbitrary ID to identify yourself</client_id>
    <user_ip_address>Your IP address</user_ip_address>
    <behalfOfProvider>Your provider ID</behalfOfProvider>
 </token>

The CMR token will be returned to you as follows in the response body,

 

CMR token response
<?xml version="1.0" encoding="UTF-8"?>
<token>
  <id>CMR-TOKEN-ID</id>
  <username>Your URS username</username>
  <client_id>An arbitrary ID to identify yourself</client_id>
  <user_ip_address>Your IP address</user_ip_address>
</token>

You will use the value of CMR-TOKEN-ID to interact with the CMR REST API.

The SOAP way

To obtain a token, call the Login operation of the Authentication Service. A new token is created and returned each time Login is invoked. Code Listing 1 is an example of logging in to the CMR and creating a session token for a guest user.
Parameters:

  • username - Username of the user logging in.
  • password - Password of the user.
  • clientInfo - The string identifier of the CMR client used to make this request.
  • actAsUserName - name of the user an Admin wants to act as, null for non CMR administrator users.
  • behalfOfProvider - provider the user wants to act as, null for guests and registered users with no ProviderRoles.

A Security Token is returned that is used for all subsequent calls to the CMR using the same Token profile.

 

Code listing 1: Logging in as a guest
// Client information is optional information provided by the
// client to the CMR when a user logs in
ClientInformation clientInfo = new ClientInformation();
clientInfo.setClientId("A Client");
clientInfo.setUserIpAddress("192.168.1.1");
// Call login with guest as username, email as password, and
// client information
String token = authenticationService.login("guest", "john@doe.com", clientInfo, null, null);

Code Listing 2 is an example of logging in to the CMR and creating a session token for a guest user.

 

Code listing 2: Logging in as a registered user
// Client information is optional information provided by the
// client to CMR when a user logs in
ClientInformation clientInfo = new ClientInformation();
clientInfo.setClientId("A Client");
clientInfo.setUserIpAddress("192.168.1.1");
// Call login with jdoe as username, mypass as password, and
// client information
String token = authenticationService.login("jdoe", "mypass", clientInfo, null, null);

Logging Out of the CMR

The REST way

To logout of your session simply delete your CMR token.

 

Logging out: Deleting a CMR token
 DELETE https://api.cmr.nasa.gov/cmr-rest/tokens/CMR-TOKEN-ID
Response: Status Code: 204 No Content

The SOAP way

When you are finished with a token, for example, you have finished a session with the CMR; destroy the token using the Logout operation.
Parameter(s):

  • token - security token
Code listing 3: Logging out of the CMR
 // Logout and set token to null because it is not useful anymore
authenticationService.logout(token);
token = null;   

You do not need to destroy a token after each call; you may reuse a token until it is destroyed with the Logout operation or the token expires. Because the token is used to track your session, it must be protected by client applications with the same level of security that you use for your login name and password.

Interacting with the CMR

The REST way

You can interact with any CMR-REST resource using guest by simply GETing, POSTing, PUTing or DELETEing the resource. Some of these operations will fail if guest does not have the authority to perform them. In cases, where you want to use a registered user you should acquire a CMR token above and attach it as a header to the request you make. For example,

Getting a list of providers with a CMR token

 

Request headers:
Content-Type: application/xml
CMR-Token: CMR-TOKEN-ID
 
Request:
 
Response headers:
Status Code: 200 OK
 
Response Body:
<?xml version="1.0" encoding="UTF-8"?>
<providers type="array">
  <provider>
   ...
  </provider>
</providers>

 

The SOAP way

Interacting with the rest of the CMR API follows the same pattern as logging in and logging out except that it requires that you pass a valid CMR token to each operation. The following example shows logging in, retrieving the version number of the CMR system and logging back out.

Code Listing 4: Getting the CMR Version Number

// Login
String token = authenticationService.login("jdoe", "mypass", new ClientInformation("A Client", "192.168.1.1"), null, null);
// Print out CMR version number.
System.out.println("CMR's version number: " + authenticationService.getCMRVersion(token));
// Logout using token from previous login
authenticationService.logout(token);
token = null;

 

Querying for earth science metadata

The CMR uses the CMR Alternative Query Language (AQL) for its querying capabilities. (See Chapter 6 for a detailed explanation of the language syntax.) To support potentially large queries, the CMR handles a query expression without regard to the details of whether and how it will return query results to the user.
A CMR query consists of a query expression specified in XML, starting with <query>. All AQL queries must conform to the AQLQueryLanguage.dtd available on the CMR website. Also, refer to Chapter 6, The CMR Alternative Query Language for additional information about AQL.

 

 

You should validate your query against the DTD before passing it to the CMR. Since a query is passed to the CMR as a string, the query will not be validated against the DTD by the Web Service processing layer but rather at execution time, which, in the case of an asynchronous query or a subscription, could be after the Web Service call has completed.

You may use the optional argument MaxResults to limit the numbers of results returned from a query, which is useful when a query produces more data than can be processed. This also saves processing time for the query and presentation of results.
You may retrieve the results of a query in several different ways. The ExecuteQuery operation on the Catalog Service allows you to indicate whether you would like the data itself returned or simply the number of hits. When doing so, ensure that the CatalogItemID tag is returned. The string value under this tag is the actual catalog item GUID that you can use to order items from the CMR. You can specify this function in the ResultType argument with one of the following values:

Table 2: Query Return Result Types

Value

Description

RESULTS

Returns the detailed metadata for items that match the query directly in the response. When using this option, you may choose to limit the actual metadata values returned. In addition, the CMR will return a result set identifier (ResultSetGUID) for subsequent retrievals of the results or for paging through the result list. Note that CMR Operations limits the maximum number of items returned to 2,000 at a time. The complete results are stored in your result set which you can retrieve by using the GetQueryResults operation.

RESULT_SET_GUID

Returns the result set guid of the results that are stored on the server. The CMR will generate a result set but will not return any results. You must subsequently retrieve the results using the GetQueryResults operation.

HITS

Returns the number of hits (matches) to the query and a ResultSetGUID for the results stored on the server. The CMR will generate a result set but will not return any results. The number of records may be a statistically determined for large result sets. You must subsequently retrieve the results using the GetQueryResults operation. Hits is a relatively expensive operation therefore if the client only needs to know if some data exists, it is faster to simply query for ITEM_GUIDS with a small iterator size.

ITEM_GUIDS

Returns the Catalog Item GUIDs that match the specified query. Note: No ResultSetGUID is returned since results do not persist in the system.

All the GUIDs of the granules/collections that satisfy the query are returned to the client. It is the client‘s responsibility to request the metadata for each individual granule/collection using the GetCatalogItemMetadata operation discussed later.

Formatting Your Query Results

You can specify a subset of the information in the result set by using different parameters for the operations
ExecuteQuery and GetQueryResults.
The following elements are used to specify the format and content of a result set:

Table 3: Result Set Content Elements

Argument
Description
IteratorSize

Specifies the number of results to be returned from a single operation. This does not limit the number of items a query may match (see MaxResults) but limits to 2,000 the number of matching items returned in the result set, starting from the Cursor position.

This field is only used if the result type is set to RESULTS.

Cursor

Specifies the index of the first record to be returned in the result set. For example, a value of 5 will return results starting from the fifth record. If none is specified, it defaults to 1. If you repeat the same query later, use the same Cursor value.

This field is only used if the result type is set to RESULTS.

MetadataAttributes

Specifies which fields of the CMR Metadata you actually want to return. By only requesting the parts of the metadata you are interested in, you can increase query performance substantially. By default, the CMR returns all of the metadata for each item.

This field is only used if the result type is set to RESULTS.


Metadata results are returned as XML that conforms to one of the following DTDs:

Granule metadata conforms to the Granule Results DTD—refer to Appendix F, Results DTDs (also located at: http://api.cmr.nasa.gov/cmr/dtd/CMRGranuleResults.dtd).
Collection metadata conforms to the Collection Results DTD Appendix F, Results DTDs (also located at: http://api.cmr.nasa.gov/cmr/dtd/CMRCollectionResults.dtd).
Metadata attributes are made up of two values: the XML metadata attribute name and a primitive type name. The CMR currently ignores the type name. The allowable metadata attribute names are specified in the appropriate DTD (CMRGranuleResults.dtd for granules and CMRCollectionResults.dtd for collections). If you specify a metadata attribute name that has sub-attributes, all of the sub-attributes will be included as well. For example, if you specify Platform, the following elements will be included in the metadata:

  • Platform
  • PlatformShortName
  • Instrument
  • InstrumentShortName
  • Sensor
  • SensorShortName
  • SensorCharacteristics
  • SensorCharacteristicName
  • SensorCharacteristicValue

OperationMode
When you specify a sub-attribute, the CMR will return the ―parent‖ attribute in the hierarchy as well as the sub-attribute. This allows you to ensure that data are correctly scoped. For example, if you specify Sensor, the following elements will be included in the metadata:

  • Platform
  • PlatformShortName
  • Instrument
  • InstrumentShortName
  • GranuleUR
  • GranuleURMetaData

Detailed spatial attributes cannot be used as MetadataAttributes; only their containing element may be specified. For example, you cannot use BoundingBox as a MetadataAttribute, but you can use HorizontalSpatialDomainContainer. The following spatial elements cannot be specified as MetadataAttributes:

  • Point
  • Circle
  • BoundingRectangle
  • GPolygon
  • Polygon
  • PointLongitude
  • PointLatitude
  • CenterLongitude
  • CenterLatitude
  • Radius
  • WestBoundingCoordinate
  • NorthBoundingCoordinate
  • EastBoundingCoordinate
  • SouthBoundingCoordinate
  • Boundary
  • ExclusiveZone
  • SinglePolygon
  • MultiPolygon
  • OutRing
  • InnerRing

Specifying GranuleURMetaData as a MetadataAttribute is equivalent to not specifying any MetadataAttributes; the result set includes all the elements in the result DTD.
The following code snippet shows how to execute a query for all of the metadata for matching items.

Code Listing 6: Executing a Simple Query

 

// Execute a query to get results
QueryResponse response = catalogService.executeQuery(userToken, queryString, ResultType.RESULTS,
    10, // Iterator
    0, // Cursor
    3000, // max results
    null); // no metadata attributes specified
 
MetadataAttribute[] attributes = new MetadataAttribute[] { new MetadataAttribute(
    "HorizontalSpatialDomainContainer", null) };
 
QueryResponse response = catalogService.executeQuery(userToken, queryString, ResultType.RESULTS,
    10, // Iterator
    0, // Cursor
    3000, // max results
    attributes);

Handling Large Result Sets

Given the CMR's large store of Earth Science data, it is possible for queries to return very large result sets. The CMR supports retrieving the results from a query in a number of ways. The simplest is to ask the CMR to return the results directly from the ExecuteQuery request by passing RESULTS as the ResultType. However, to prevent a single query from monopolizing CMR resources, the CMR limits the number of results available in response to a query. By default, this limit is 2,000 items. CMR Operations may change this limit depending on CMR usage patterns.
For larger results, the CMR supports a paging mechanism. This allows you to page through the available data in page sizes that you select (up to the CMR Operations configurable limit). For all ResultTypes, the CMR will create and store a result set and return the corresponding GUID. You can page through the result set using the GetQueryResults operation. The arguments to GetQueryResults are similar to ExecuteQuery with the exception that you specify the result set GUID rather than a new query.
Result sets may change after they are created. Providers are continually changing the data they have registered in the CMR. New records may appear or may be removed from a result set. Because of this, you should watch the fields Cursor and CursorAtEnd when paging through a large result set:
Cursor specifies the index of the first record to be returned in the result set. For example, a value of 5 will return results starting from the fifth record. If none is specified, it defaults to 1. If you repeat the same query later, use the same Cursor value.
Use CursorAtEnd to determine when you have reached the end of the result set. This Boolean field is TRUE if the returned results were the last available results in the result set.
The following code illustrates paging through a result set and displaying it to the user.

Code Listing 8: Paging Through Query Results

 

final int ITERATOR_SIZE = 10;
try
    {
        CatalogServiceLocator catalogServiceLocator = new CatalogServiceLocator();
        CatalogServicePort catalogService = catalogServiceLocator.getCatalogServicePort();
        QueryResponse response = catalogService.executeQuery(userToken, userQuery,
        ResultType.RESULT_SET_GUID, 0, 0, 1000, null);
        String resultSetGuid = response.getResults().getResultSetGuid();
        // begin paging through results
        int cursor = 1;
        boolean atEnd = false;
        while (!atEnd)
        {
            //Get next ITERATOR_SIZE results
            QueryResults results = catalogService.getQueryResults(userToken,
                resultSetGuid, null, ITERATOR_SIZE, cursor);
            //Print out results
            System.out.println(results.getReturnData());
            //Set cursor to next index
            cursor = results.getCursor();
            //Check if at end of result set
            atEnd = results.isCursorAtEnd();
        }
        System.out.println("All results retrieved");
    }
    catch (CMRFault e)
    {
        e.printStackTrace();
    }
    catch (ServiceException e)
    {
        e.printStackTrace();
    }
    catch (RemoteException e)
    {
        e.printStackTrace();
    }

Like ExecuteQuery, GetQueryResults takes an array of MetadataAttributes. Internally, the CMR only stores in a result set the item IDs that match a given query. This means that you may pull different metadata from a single result set with each call by varying what you pass to the MetadataAttribute array without needing to re-query the CMR . It is highly recommended you use the MetadataAttribute array to restrict the information the CMR returns and thus improve performance.

Visibility of Results

When you execute a query, the query is applied to all the data in the CMR. However, when the results are retrieved, you may not see all of the items. What you can see depends on the rules defined by the Data Partners and the privileges granted to you.

Restricted Items

If a particular item in your result set is restricted for you (i.e., you are not allowed to see it), based on your privileges, it will not be returned.

Deleted Items

It is possible that between the time you execute a query and the time you view the results some of the matched items may have been deleted from the CMR or restricted due to a request from the Data Partner who owns the metadata. In that case, the item will not be returned in your result set. For more information about notification of deleted or restricted order items, refer to section 7.8.1, Restricted or Deleted Order Items.

Querying for Orderable Data

The CMR allows you to exclude from your query data that cannot be ordered. Refer to section 1.1.1.

Searching for Orbit Data

4.4.1 Backtrack Orbit Search Algorithm

Orbit searching is by far the most accurate way to search for level 0-2 orbital swath data. Unfortunately orbital mechanics is a quite difficult field, and the most well known orbit model, the NORAD Propagator, is quite complex. The NORAD Propagator is designed to work with a wide range of possible orbits, from circular to extremely elliptical, and consequently requires quite a bit of information about the orbit to model it well.
To facilitate earth science, the orbits of satellites gathering earth science data are quite restricted compared to the variety of orbits the NORAD Propagator is designed to work with. Generally, the earth science community would like global coverage, with a constant field of view, at the same time every day. For this reason, most earth science satellites are in a sun-synchronous, near-polar orbit. Even missions that are not interested in global coverage, e.g., the Tropical Rainfall Measuring Mission (TRMM), are still interested in having a constant field of view so the coverage of the sensor is at a constant resolution. For this reason, ALL earth science satellites are in circular orbits.
The Backtrack Orbit Search Algorithm, designed and developed by Ross Swick, exploits this fact to simplify the orbit model by modeling an orbit as a great circle under which the Earth rotates. This reduces the number of orbital elements required for the model from 22 to three. Moreover, the NORAD Propagator is designed to predict future orbits based on current status, and consequently must be reinitialized periodically to correct for cumulative error as the model spins forward. As the name implies Backtrack spins the orbit backwards, and in practice spins backwards at most one orbit, so there is no cumulative error.


For more information on Backtrack, please see  http://geospatialmethods.org/bosa/.


Figure 2. Typical Orbit Path Represented on a Globe and the same Path on a Map

Backtrack orbit model

Three parameters to define an orbit:

  1. Instrument swath width (in kilometers)
  2. Satellite declination or inclination (in degrees)
  3. Satellite period (in minutes)

Orbit data representation

Three parameters to represent orbit data:

  1. Equatorial crossing longitude
  2. Start circular latitude (or start latitude and start direction)
  3. End circular latitude (or end latitude and end direction)

How the CMR Searches for Orbit Data

  • The user specifies a regular spatial window

Figure 3. Spatial Window

 

<granuleCondition>
    <spatial>
        <IIMSPolygon>
            <IIMSLRing>
                <IIMSPoint lon="-90" lat="49" />
                <IIMSPoint lon="-90" lat="39" />
                <IIMSPoint lon="-70" lat="39" />
                <IIMSPoint lon="-70" lat="49" />
                <IIMSPoint lon="-90" lat="49" />
            </IIMSLRing>
        </IIMSPolygon>
        <SpatialType>
            <list>
                <value>ORBIT</value>
            </list>
        </SpatialType>
    </spatial>
</granuleCondition>

 

  • Backtrack then calculates from both ascending and descending a path for equatorial longitude crossings and start/end circular latitudes according to user's query window.

Figure 4. Search Ascending Path
Sample queries

The following are sample queries that you can execute against the CMR. Note that the provider and the datasets used in these samples are representative only; you should modify the query to suit your needs.

Code Listing 9: Sample Collection Query (Discovery Search)

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//CMR CatalogService (v{*}10{*})//EN" "http://api.cmr.nasa.gov/cmr/dtd/IIMSAQLQueryLanguage.dtd">
<!- Search for collections from ORNL_DAAC that have parameter value that contains 'IMAGERY'-->
<query>
    <for value="collections"/>
        <dataCenterId>
            <list>
                <value>ORNL_DAAC</value>
            </list>
        </dataCenterId>
    <where>
        <collectionCondition>
            <parameter>
                <textPattern>'%Imagery%'</textPattern>
            </parameter>
        </collectionCondition>
    </where>
</query>

Code Listing 10: Sample Collection Query from Two Providers (Discovery Search)

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//CMR CatalogService (v{*}10{*})//EN" "http://api.cmr.nasa.gov/cmr/dtd/IIMSAQLQueryLanguage.dtd">
<!-- Search for collections from GSFCECS and ORNL_DAAC that have processing level 1A or 2 -->
<query>
    <for value="collections"/>
    <dataCenterId>
        <list>
            <value>GSFCECS</value>
            <value>ORNL_DAAC</value>
        </list>
    </dataCenterId>
    <where>
        <collectionCondition negated="y">
            <processingLevel>
                <list>
                    <value>'1A'</value>
                    <value>'2'</value>
                </list>
            </processingLevel>
        </collectionCondition>
    </where>
</query>

 Code Listing 11: Sample Collection Query with Temporal and Spatial Constraints (Discovery)

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//CMR CatalogService (v{*}10{*})//EN" "http://api.cmr.nasa.gov/cmr/dtd/IIMSAQLQueryLanguage.dtd">
<!-- Search for collections from ORNL_DAAC with: temporal range: periodic range between Jan 1, 1990 and Dec. 31 1998from the 1st to the 300th day of each year, AND spatial extent: bounding box 60S, 70W to 60N, 70E. -->
<query>
    <for value="collections"/>
    <dataCenterId>
        <value>ORNL_DAAC</value>
    </dataCenterId>
    <where>
        <collectionCondition>
            <temporal>
                <startDate>
                    <Date YYYY="1990" MM="01" DD="01"/>
                </startDate>
                <stopDate>
                    <Date YYYY="1998" MM="12" DD="31"/>
                </stopDate>
                <startDay value="1"/>
                <endDay value="300"/>
            </temporal>
        </collectionCondition>
        <collectionCondition negated="n">
        <spatial operator="RELATE">
            <IIMSPolygon>
                <IIMSLRing>
                    <IIMSPoint long='-10' lat='85'/> <IIMSPoint long='10' lat='85'/> <IIMSPoint long='10' lat='89'/> <IIMSPoint long='-10' lat='89'/> <IIMSPoint long='-10' lat='85'/>
                </IIMSLRing>
            </IIMSPolygon>
        </spatial>
    </collectionCondition>
    </where>
</query>

Code Listing 12: Sample Collection Query with Complex Temporal and Spatial Conditions (Discovery)

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//CMR CatalogService (v{*}10{*})//EN" "http://api.cmr.nasa.gov/cmr/dtd/IIMSAQLQueryLanguage.dtd">
<!-- Search for collections from ORNL_DAAC with
temporal range: periodic range between Jan 1, 1990 and Dec. 31 1998 from the 1st to the 300th day of each year, AND
some days of January. source name: L7 or AM-1 AND
spatially covering any 'temperate' region or USA -->
<query>
    <for value="collections"/>
    <dataCenterId>
        <list>
            <value>ORNL/value>
        </list>
    </dataCenterId>
    <where>
        <collectionCondition>
            <temporal>
                <startDate>
                    <Date YYYY="1990" MM="01" DD="01"/>
                </startDate>
                <stopDate>
                    <Date YYYY="1998" MM="12" DD="31"/>
                </stopDate>
                <startDay value="1"/>
                <endDay value="300"/>
            </temporal>
        </collectionCondition>
        <collectionCondition negated='n'>
            <sourceName>
                <list>
                    <value>'L7'</value>
                    <value>'AM-1'</value>
                </list>
            </sourceName>
        </collectionCondition>
        <collectionCondition>
            <spatialKeywords>
                <list>
                    <value>'temperate'</value>
                    <value>'USA'</value>
                </list>
            </spatialKeywords>
        </collectionCondition>
        <collectionCondition>
            <temporalKeywords>
                <textPattern>'%january%'</textPattern>
            </temporalKeywords>
        </collectionCondition>
    </where>
</query>

Code Listing 13: Sample Collection Query Using Provider Specific Attributes (Discovery)

 

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE query PUBLIC "-//CMR CatalogService (v10)//EN" 
"http://api.cmr.nasa.gov/cmr/dtd/IIMSAQLQueryLanguage.dtd"> 
<query>
    <for value="collections"/> 
    <dataCenterId>
        <value>ORNL_DAAC</value> 
    </dataCenterId>
    <where>
        <collectionCondition>
            <additionalAttributeNames>
                <list> 
                    <value>'Provider_Specific_Attribute_1'</value> 
                    <value>'Provider_Specific_Attribute_3'</value>
                </list>
            </ additionalAttributeNames > 
        </collectionCondition>
    </where>
</query>

 

The CMR alternative query language

ECHO Alternative Query Language (AQL) is a query language that defines the format for searches on collections and granules in the ECHO system. AQL is an XML-based language. You can find the DTD for AQL at http://api.echo.nasa.gov/echo/dtd/IIMSAQLQueryLanguage.dtd

 

Code Listing 14: General AQL Structure

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//ECHO CatalogService (v10)//EN" "http://api.echo.nasa.gov/echo/dtd/IIMSAQLQueryLanguage.dtd"
<query>
    <for value= "collections"/>
    //"granules" can be substituted for "collections" 
        <dataCenterId>
            <all/>
        </dataCenterId>
    <where>
        <list of conditions ... > 
    </where>
</query>

 

Icon

Note: The <for/> tag shown in this example does not require that you set a value attribute; if you do not explicitly set this attribute, it will default to "collections." Your query will validate correctly, but you may still experience an error if you use granule settings for other attributes within the same query. 

There is no discussion regarding the strong suggestion that clients include dataset IDs. Might want to have more high level information regarding the structure of an AQL query and general contructs (list, all, value, etc). 
You can specify the data centers that you wish to search by explicitly listing them or by using the empty element <all/> to indicate that you want all the data centers searched. This is the default condition, that is, if you do not specify a condition for the dataCenterId element, ECHO will search all data centers. Do not enclose dataCenterId values in single-quotes. Is this still needed? 
To search all data providers:

 

<dataCenterId><all/></dataCenterId>

 

To search for collections/granules in the ORNL data provider's metadata only:

 

<dataCenterId> 
    <value>ORNL_DAAC</value>
</dataCenterId>

 

To search for collections/granules in the LPDAAC_ECS data providers' metadata only:

 

<dataCenterId>
<list> <value>ORNL_DAAC</value> <value>LPDAAC_ECS</value>
</list>
</dataCenterId>

 

The list of conditions consists of collectionCondition elements for Discovery or granuleCondition elements for Inventory Search. The fields you can search on within collections occur as children of the collectionCondition element. The fields you can search on within granules occur as children of the granuleCondition element. ECHO will return only those granules or collections that satisfy all the conditions of the query, that is, ECHO applies the Boolean AND between all conditions of the query. 
The where tag can have any number of collectionCondition or granuleCondition elements. Each of these tags can contain any one of the search elements listed in the Inventory Search and Discovery Search tables below. For the query to be valid, each of the search elements may appear only once.

Code Listing 15 shows the general structure of a Discovery query with multiple constraints.

Code Listing 15: Structure of a Discovery Query with Multiple Collection Conditions

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//ECHO CatalogService (v10)//EN" "http://api.echo.nasa.gov/echo/dtd/IIMSAQLQueryLanguage.dtd"
<query>
    <for value="collections"/> 
        <dataCenterId>
            <value>ORNL_DAAC</value> 
        </dataCenterId>
    <where>
        <collectionCondition>… </collectionCondition> 
        <collectionCondition>… </collectionCondition>
        
    </where>
</query>

 

Code Listing 16 shows the general structure of an Inventory query with multiple constraints. 

Code Listing 16: Structure of an Inventory Query with Multiple Granule Conditions

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE query PUBLIC "-//ECHO CatalogService (v10)//EN" "http://api.echo.nasa.gov/echo/dtd/IIMSAQLQueryLanguage.dtd"
<query>
    <for value="granules"/> 
        <dataCenterId>
            <value>ORNL_DAAC</value> 
        </dataCenterId>
    <where>
        <granuleCondition>… </granuleCondition> 
        <granuleCondition>… </granuleCondition>
        
    </where>
</query>

 

If you specify a list or a single value, then the search looks for an exact match between the string specified and the data stored. For example, if the search value is 'Imagery' and the data stored has the value 'Satellite Imagery', the data will not be returned since there was no exact match. In this instance, it is more useful to use the textPattern element for the search.

Collection/Discovery Search

Searches for collections must enclose the search criteria in a collectionCondition element. If you want to search the negated criteria, you should set the negated attribute in the collectionCondition element to 'Y'.

Code Listing 17 shows how to create a search for all collections except the ones with processing level 1, 1A, 1B, or 2. 

Code Listing 17: Using the Negated Attribute on Collection Conditions

 

<collectionCondition negated='Y'
    <processingLevel>
        <list>
            <value>'1'</value>
            <value caseInsensitive="Y">'1A'</value>
            <value>'1B'</value>
            <value>'2'</value>
        </list>
    </processingLevel>
</collectionCondition>

 

You can set the negated attribute to 'Y' for a criterion. 
The following table lists the criteria you can use to search for collections. For details about each of these criteria, refer to Common Search Elements (same chapter)

Table 4: Collection Search Criteria (Discovery)

Search Criteria
XML Element
Campaign Short Name<CampaignShortName>...</CampaignShortName>
Dataset ID<dataSetId>...</dataSetId>
ECHO Insert Date<ECHOInsertDate>...</ECHOInsertDate>
ECHO Last Update<ECHOLastUpdate>...</ECHOLastUpdate>
Online Collections Only<onlineOnly/>
Parameter<parameter>...</parameter>
Processing Level<processingLevel>...</processingLevel>
Sensor Name<sensorName>...</sensorName>
Short Name<shortName>...</shortName>
Source Name<sourceName>...</sourceName>
Spatial<spatial>...</spatial>
Spatial Keywords<spatialKeywords>...</spatialKeywords>
Temporal<temporal>...</temporal>
Temporal Keywords<temporalKeywords>...</temporalKeywords>
Additional Attribute Names<additionalAttributeNames>...</additionalAttributeNames>
Orderable Items<orderable/>
Version ID<versionId>...</versionId>
Archive Center<archiveCenter>...</archiveCenter>
Additional Attributes<additionalAttributes>… </additionalAttributes>
Instrument Short Name<instrumentShortName>…</instrumentShortName>

Granule/Inventory Search

Searches for granules must enclose the search criteria in the granuleCondition element. As in the case of collectionCondition, if you want to search the negated criteria, set the negated attribute in the granuleCondition element to 'Y'. You can set the negated attribute to 'Y' for any criterion. 
The following table lists the criteria you can use to search for granules. 

Table 5: Granule Search Criteria (Inventory)

Search Criteria
XML Element
Only Granules with Browse Data<browseOnly/>
Campaign Short Name<CampaignShortName>...</CampaignShortName>
Percentage of cloud Cover<cloudCover>...</cloudCover>
Dataset ID<dataSetId>...</dataSetId>
ECHO Insert Date<ECHOInsertDate>...</ECHOInsertDate>
ECHO Last Update<ECHOLastUpdate>...</ECHOLastUpdate>
Either Day or Night Granules Only<dayNightFlag/>
Search on ECHO granule IDs (formerly granuleId)<ECHOGranuleID>...</ECHOGranuleID>
Search on Granule UR (provider specific)<GranuleUR>...</GranuleUR>
Online Granules Only<onlineOnly/>
Two-D Coordinate System<TwoDCoordinateSystem>...</TwoDCoordinateSystem>
Producer Granule ID<ProducerGranuleID>...</ ProducerGranuleID>
Additional Attributes<additionalAttributes>...</additionalAttributes>
Sensor Name<sensorName>...</sensorName>
Source Name<sourceName>...</sourceName>
Spatial<spatial>...</spatial>
Temporal<temporal>...</temporal>
Orderable Items<orderable/>
Version ID<versionId>...</versionId>
PGE Name<PGEName>...</PGEName>
PGE Version<PGEVersion>...</PGEVersion>
Measured Parameters<measuredParameters>...</measuredParameters>
Provider Production Date<providerProductionDate>…</providerProductionDate>
Provider Insert Date<providerInsertDate>…</providerInsertDate>
Instrument Short Name<instrumentShortName>…</instrumentShortName>
Icon

Effective with ECHO Release 7.0, the LocalGranuleID search criterion was renamed ProducerGranuleID. 

 

Common Search Elements

You may use the following search criteria for both collection and granule searches. 
Case Insensitive Searching 
Any value or textPattern tag has an attribute caseInsensitive that you can set to Y or N to indicate whether the search value or textPattern is case insensitive. The default is N, that is, the default is case sensitive searching. Refer to the dataSet ID example on the next page for an example. 
CampaignShortName 
CampaignShortName is the name(s) of the campaign or project that gathered data associated with the collection or granule. In CampaignShortName, you can use a single-quoted string in a value, a list of single-quoted strings in a list, or a textPattern element as defined in the section 6.8, Miscellaneous Elements. 
This example shows a search for collections/granules where CampaignShortName = 'River'.

 

<CampaignShortName>
    <value>'River'</value>
</CampaignShortName>

 

This example shows a search for collections/granules where CampaignShortName = 'River' or 
CampaignShortName = 'Lake'.

 

<CampaignShortName>
    <list>
        <value>'River'</value>
        <value>'Lake'</value>
    </list>
</CampaignShortName>

 

This example shows a search for collections/granules where CampaignShortName contains the string 'AS_A%D', where the % represents zero or more numbers or letters between the A and the D in the text string 'AS_A%D'

 

<CampaignShortName>
    <textPattern operator="LIKE">'AS_A%D'</textPattern> 
</CampaignShortName>

 

DataSetID 
dataSetID specifies the universal name of a collection. You can use this element to restrict the search to a few collections, using the value element to specify a single collection, a list for a list of collections, or a textPattern. For the value and list elements, you must know the exact name of the collection. For example, you may have performed a Discovery search to locate the collection of interest and now want to perform an Inventory search for granules. 
This example shows a search for all collections whose dataSetId ends with '1A'.

 

<dataSetId>
    <textPattern caseInsensitive="Y">'%1A'</textPattern>
</dataSetId>

 

This example shows a search for all granules whose dataSetId is either 'LEAF CHEMISTRY, 1992-1993 (ACCP)' or 'ASTER DEM Product V002'.

 

<dataSetId>
    <list>
        <value>'LEAF CHEMISTRY, 1992-1993 (ACCP)'</value> 
        <value>'ASTER DEM Product V002'</value>
    </list>
</dataSetId>

 

OnlineOnly 
Use OnlineOnly to search for granules or collections that are available online.

 

<onlineOnly/>

 

ECHO Insert Date 
Use ECHOInsertDate to specify a search for collections or granules based on their insertion date into ECHO. You can only specify a dateRange.

 

<ECHOInsertDate>
    <dateRange>
        <startDate>
            <Date YYYY="2001" MM="04" DD="05"/> // endDate is not required
        </startDate>
    </dateRange>
</ECHOInsertDate>

 

ECHO Last Update 

Use ECHOLastUpdate to specify a search for collections or granules based on the date of their last update within ECHO. You can only specify a dateRange.

 

<ECHOLastUpdate>
    <dateRange>
        <startDate>
            <Date YYYY="2001" MM="01" DD="01"/> 
        </startDate>
        <stopDate>
            <Date YYYY="2001" MM="06" DD="01"/> 
        </stopDate>
    </dateRange>
</ECHOLastUpdate>

 

Sensor Name 
Use sensorName to search for collections or granules based on the name of the sensor. known value in a value, a list of known values in a list, or a text pattern in a textPattern. relationship between each value with the Boolean "AND" or "OR".

The "AND" relationship means that results must match every value specified.
 
You can search for a You can specify the 
The "OR" relationship means that results must match either or both of the values specified. "OR" is the default setting for searching with multiple values.

 

<granuleCondition> 
    <sensorName operator="AND">
        <list>
            <value>'human observer'</value> 
            <value>'rain gauge'</value>
        </list>
    </sensorName>
</granuleCondition>

 

Instrument Short Name 
Use instrumentShortName to search for collections or granules based on the name of the instrument. You can search for a known value in a value, a list of known values in a list, or a text pattern in a textPattern. You can specify the relationship between each value with the Boolean "AND" or "OR".

The "AND" relationship means that results must match every value specified.

The "OR" relationship means that results must match either or both of the values specified. "OR" is the default setting for searching with multiple values.

 

<granuleCondition> 
    <instrumentShortName operator="AND">
        <list>
            <value>'GPS'</value>
            <value>'Telescope'</value>
        </list>
    </instrumentShortName>
</granuleCondition>

 

Source Name 
Use sourceName to search for collections or granules based on the name of the source. You may specify the name using a value, a list of known values in a list, or a text pattern in a textPattern. You can specify the relationship between each value with the Boolean "AND" or "OR".

The "AND" relationship means that results must match every value specified.

The "OR" relationship means that results must match either or both of the values specified. "OR" is the default setting for searching with multiple values

 

<granuleCondition> 
    <sourceName operator="AND">
        <list> 
            <value>'CV-580'</value> 
            <value>'C-130'</value>
        </list>
    </sourceName>
</granuleCondition>

 

Spatial

Use spatial constraints to restrict the search within a spatial extent of the earth. Specify the spatial extent using the elements IIMSPolygonIIMSMultiPolygonIIMSBox or IIMSLine
You may also specify a TwoDCoordinate element along with a spatial element in a spatial constraint. This is useful when you wish to find spatially coincident granules between collections that support TwoDCoordinate searches and those that do not. When you use TwoDCoordinate together with a spatial element, ECHO will return all granules that satisfy either the TwoDCoordinate constraint or the spatial element, or both. You may only use TwoDCoordinate in a spatial constraint for granule (inventory) queries, not collection queries. 
You may also use TwoDCoordinate outside of a spatial constraint. In this case, list TwoDCoordinate inside a granuleCondition. ECHO will return results that satisfy the TwoDCoordinate constraint and all other conditions (including any spatial conditions if they are present). 
Polygon consists of one or more rings. Some rings may be embedded within others that define the interior of the polygon. The ECHO system can handle polygons with only one external ring and multiple internal rings. 

                   

                                                                                                                                      Figure 6: Allowed Geometries for Spatial Data and Query Windows

                                                                                                                   

To define a ring, the last point in the ring must be the same as the first point in the ring. You must specify the points in each polygonal ring in counterclockwise order. 

 


                                                                                                                                       Figure 7: Order of Points in a Polygonal Ring

                                                                                                                                            

 

To specify multiple outer rings, use the MultiPolygon or IIMSMultiPolygon element, with each outer ring in a separate Polygon. There should be no overlap between any of the outer rings defined. Refer to Code Listing 19: A Multi-Polygon Spatial Query for examples. 
Use IIMSBox to specify a bounding box on the Earth. A bounding box contains two points. The first point is the lower left corner of the box. The second point is the upper right corner of the box. The horizontal lines of the box will follow the latitude lines of the earth. This means the points of the box will not connect by lines following great circle arcs but will curve to stay at the same latitude. 
Use IIMSLine or LString to specify a line on the Earth. You must specify the points in the line from one endpoint to the other. You can also use IIMSPoint to specify a single point on the Earth. Note that although IIMSPoint is used to describe corner points in a polygon or endpoints in a line, it also describes a specific searchable geometry. Refer to Code Listing 20: A Single Point Spatial Query and for examples. 
The table below describes Spatial Operators available in the ECHO System, regarding the relationship between two objects.

Table 6: Spatial Operators

Spatial Operator
Description
EQUALThey have the same boundary and interior.
TOUCHThe boundaries intersect but the interiors do not.
WITHINInterior and boundary of the first object are completely contained in the interior of the second.
CONTAINSThe interior and boundary of the second object are completely contained in the interior of the first.
RELATEThe objects are non-disjoint, that is, their bodies and/or boundaries intersect.

 

                                                                                                                                                               Figure 8: Examples of Spatial Regions

                                                                                 

 

Define the query so that the user-specified spatial extent is the second object in the query.
Use CONTAINS to retrieve granules/collections that contain the specified polygon.
Use WITHIN to retrieve granules/collections that are within the specified spatial extent.
Use RELATE to retrieve granules/collections that overlap in some way. RELATE is the default operator. 
ECHO supports multiple spatial representations (or SpatialTypes). Spatial data of different spatial representations are described differently and hence are stored and queried differently. 
The SpatialType tag is an optional field in AQL used to specify the spatial type. If the user opts not to specify this field, ECHO performs a default search. By default, ECHO performs the search on NORMAL (Cartesian and Geodetic), and ORBIT

Code Listing 18: Spatial Search Element

 

<spatial operator="RELATE">
    <IIMSPolygon>
        <IIMSLRing>
            <IIMSPoint lon="-120" lat="-30" /> 
            <IIMSPoint lon="-100" lat="-60" /> 
            <IIMSPoint lon="5" lat="-90" /> 
            <IIMSPoint lon="-120" lat="-60" /> 
            <IIMSPoint lon="160" lat="5" /> 
            <IIMSPoint lon="160" lat="60" /> 
            <IIMSPoint lon="120" lat="85" /> 
            <IIMSPoint lon="5" lat="85" /> 
            <IIMSPoint lon="-120" lat="30" /> 
            <IIMSPoint lon="-120" lat="-30" />
        </IIMSLRing>
        <IIMSLRing>
            <IIMSPoint lon="80" lat="20" /> 
            <IIMSPoint lon="80" lat="60" /> 
            <IIMSPoint lon="20" lat="60" /> 
            <IIMSPoint lon="20" lat="20" /> 
            <IIMSPoint lon="80" lat="20" />
        </IIMSLRing>
    </IIMSPolygon>
    <TwoDCoordinateSystem>
        <TwoDCoordinateSystemName>
            <value>'WRS2'</value>
        </TwoDCoordinateSystemName>
        <Coordinate1><range lower='15' upper='20'/></Coordinate1> <Coordinate2><range lower='33' upper='42'/></Coordinate2>
    </ TwoDCoordinateSystem> 
    <SpatialType>
        <list>
            <value>NORMAL</value>
            <value>ORBIT</value>
        </list>
    </SpatialType>
</spatial>

 

Spatial Type: NORMAL 
Conventional spatial data are described as shapes such as polygons, multi-polygons, boxes, or lines. NORMAL is the spatial type to use for searching this type of data. Spatial data are stored in the database as Oracle objects to record the shape, spatial locations, and coordinate system used; i.e., Cartesian or Geodetic. 
All spatial objects with the exception of Box in AQL, ECHO interprets as Geodetic. Geodetic spatial data has some restrictions. The total area of a single polygon cannot exceed half the earth. Lines, either alone or in a polygon, cannot be longer than half the circumference of the earth. 
The same points in Cartesian and Geodetic describe two different areas. Great circle arcs connect points in Geodetic. These follow the shortest paths on the earth between two points. Latitude lines connect points in Cartesian. The image below shows a geodetic area Google Earth below as a red outlined polygon overlayed over a white polygon representing the Cartesian area described with the same points.

Figure 9: Spatial differences between a Geodetic area and a Cartesian Area 

 

As noted previously, Geodetic and Cartesian represent polygons in different ways. There are other differences though besides how the lines define the shape. These differences stem from the fact that Geodetic and Cartesian are different representations of the earth. Geodetic is an ellipsoidal model of the earth whereas Cartesian describes the surface of the earth as a flat plane.

Figure 10: Ellipsoid


Figure 11: Flat Cartesian plane

These fundamental differences lead to some polygons being valid in Geodetic and not valid in Cartesian. Polygons and lines follow Geodesics so ECHO uses them as-is for searching geodetic data. Boxes, on the other hand, follow the latitude lines of the earth so ECHO uses them as-is for searching Cartesian data. ECHO converts polygons and lines from Geodetic for searching the Cartesian data and converts boxes from Cartesian when searching Geodetic data. The converted areas are valid approximations of the original areas. ECHO performs the conversion first by dividing the spatial area into pieces so that each new area fits within the bounds of sections of the earth. ECHO uses eight octants when converting from Geodetic to Cartesian. ECHO uses four quadrants when converting from Cartesian to Geodetic. The Cartesian graph below shows the octant bounds. ECHO divides the spatial area so that it does not cross the antimeridian, the prime meridian, or either of the poles.

Figure 12: Bounds of the eight octants 

After dividing the spatial area, the lines of the spatial area are "densified". Densification means that ECHO adds more points along the lines between the original points. This has the effect of making the lines in Cartesian space approximate the lines in geodetic space and vice versa. ECHO adds points every 10 km during densification. We found this number to be a good compromise between performance and accuracy. It is important that client developers understand ECHO uses an approximation of the area so in a small number of cases there may be some missed or extra results. Images, shown below, illustrate the Geodetic to Cartesian Conversion process.

 

                                                 

Figure 13: Example geodetic polygon                                                                                                           Figure 14: Geodetic polygon divided by octants  

 

 

 

 

                                                                           

Figure 15: Cartesian polygon before densification                                                                                   Figure 16: Cartesian polygon after densification 

 

Spatial Type: ORBIT 
Spatial data are orbit-based and generated from satellites running along orbits. Because an orbit travels at a fixed direction with a fixed declination angle and the covered area is a stripe of fixed width, the spatial coverage of a granule can be derived from the latitude where the granule starts and ends and the crossing longitude on the equator where its orbit originally starts. Thus, the orbit-based spatial data are not stored as shape objects but as the original data. ECHO uses an algorithm called ―Backtrack‖ to perform searches on orbit-based data. Spatial coverage can be as large as the entire earth surface including polar area. ECHO does simple validation against the spatial window to make sure it does not exceed the scope of the earth (the latitude is within the range –90 to 90 and the longitude is within the range –180 to 180). 
There is one limitation in the current implementation: the only supported spatial operator is RELATE. With ECHO 10.0, multi-orbit as well as single orbit searches are supported. 
This example shows a multi-polygon spatial query. 

 

<spatial operator='RELATE'
    <IIMSMultiPolygon>
        <IIMSPolygon>
            <IIMSLRing>
                <IIMSPoint lat="85" long="-50"/> 
                <IIMSPoint lat="70" long="-60"/> 
                <IIMSPoint lat="60" long="-50"/> 
                <IIMSPoint lat="70" long="-40"/> 
                <IIMSPoint lat="85" long="-50"/>
            </IIMSLRing>
        </IIMSPolygon>
        <IIMSPolygon>
            <IIMSLRing>
                <IIMSPoint lat="-85" long="-50"/> 
                <IIMSPoint lat="-70" long="-40"/> 
                <IIMSPoint lat="-60" long="-50"/> 
                <IIMSPoint lat="-70" long="-60"/> 
                <IIMSPoint lat="-85" long="-50"/>
            </IIMSLRing>
        </IIMSPolygon>
    </IIMSMultiPolygon>
</spatial>

 

Icon

Refer to Figure 6: Allowed Geometries for Spatial Data and Query Windows for an example of an image of a multi-polygon. 

This example shows a single point spatial query. 

 

<spatial operator='RELATE'>
    <IIMSPoint long='-75.0' lat='35.0'/> 
</spatial>

 

Temporal

Use temporal constraints to specify the temporal extent of the data. The dates are stored as Gregorian dates, and the times are stored in GMT. This search allows only dates in YYYY-DD-MM format. You can specify a range of time represented by beginning and ending dates or a periodic temporal range specified by start date and end date. For a periodic temporal range, you can specify the start and end day of each year. You should use integers between 1 and 365 to specify the start and end dates, with start day =< end day. You can specify the end day as 366, but if the temporal range contains a non-leap year, then an error will be generated. 
This example shows a search for granule/collections whose temporal range overlaps with the time between May 12, 1990, and June 13, 1992.

Code Listing 21: Temporal Search Example

 

<temporal>
    <startDate>
        <Date YYYY="1990" MM="5" DD="12"/>
    </startDate> 
    <stopDate>
        <Date YYYY="1992" MM="2" DD="13"/>
    </stopDate> 
</temporal> 

 

This example shows a search for granules/collections whose temporal range overlaps with all of these time ranges:

  • May 16 - July 14, 1990
  • January 5 - March 5, 1991
  • January 5 - February 10, 1992 

Code Listing 22: Temporal Example with Different Day Notations

 

<temporal>
    <startDate>
        <Date YYYY="1990" MM="5" DD="12"/>
    </startDate> 
    <stopDate>
        <Date YYYY="1992" MM="2" DD="10"/>
    </stopDate> 
    <startDay value="5"/>
    <endDay value="60"/> 
</temporal> 

 

Version ID 
Use versionId to search for collections or granules based on the version identifier of the data collection. You can search for a known value in a value, a list of known values in a list, or a text pattern in a textPattern. As of 
ECHO 10.0, versionId is stored as a string so that it may look like 3,0033,0 …. 

Code Listing 23: Version ID in a Collection Condition

 

<versionId>
    <value>'0'</value>
</versionId>

 

Code Listing 24: Version ID in a Granule Condition with a Pattern

 

<versionId>
    <textPattern operator="LIKE">'3.%'</textPattern> 
</versionId> 

 

Additional Attributes 
Use additionalAttributes to search for collections or granules based on one or many groups of the additional attributes by specifying the additional attribute name/value pair for an exact match. This function includes searching on multiple additional attributes. You may specify the relationship between groups with either "AND" or "OR".

The "AND" relationship means that result granules must match across every group.

The "OR" relationship means that result granules match with any of the specified groups. "OR" is the default setting. 
Within each additional attribute, you must specify an additionalAttributeName in single quotation marks (that is, apostrophes) for an exact match. You may specify the additionalAttributeValue using valuelisttextPatternrange, or dateRange
This example shows the "AND" relationship between two additional attribute groups. You can use this sample search with either granuleCondition or collectionCondition

Code Listing 25: Additional Attributes Example with an AND Relationship

 

<additionalAttributes operator='AND'
    <additionalAttribute>
        <additionalAttributeName>
            'AveragedFocalPlane1Temperature'
        </additionalAttributeName>
        <additionalAttributeValue>
            <range lower='169' upper='170'/> 
        </additionalAttributeValue>
    </additionalAttribute>
    <additionalAttribute>
        <additionalAttributeName>
            'AveragedFocalPlane2Temperature'
        </additionalAttributeName>
        <additionalAttributeValue>
            <range lower='269' upper='270'/> 
        </additionalAttributeValue>
    </additionalAttribute>
</additionalAttributes> 

 

This example shows the "OR" relationship between two additional attribute groups. 

Code Listing 26: Additional Attribute Example with an OR Relationship

 

<additionalAttributes operator='OR'
    <additionalAttribute>
        <additionalAttributeName>
            'AveragedFocalPlane1Temperature'
        </additionalAttributeName>
        <additionalAttributeValue>
            <range lower='169' upper='170'/> 
        </additionalAttributeValue>
    </additionalAttribute>
    <additionalAttribute>
        <additionalAttributeName>
            'AveragedFocalPlane2Temperature'
        </additionalAttributeName>
        <additionalAttributeValue>
            <range lower='269' upper='270'/> 
        </additionalAttributeValue>
    </additionalAttribute>
</additionalAttributes>

 


Search Elements for Collection/Discovery Queries 

This section describes elements used specifically for collection (Discovery) searches. 
Science Keywords
Use scienceKeywords to specify the science keywords associate with a collection. Science Keywords are based on the GCMD managed list of science keywords. They have the following hierarchical structure Category> Topic > Term > Variable Level 1 > Variable Level 2 > Variable Level 3 > Detailed Variable. A value at any of the specific hierarchy levels can be specified or anykeyword can be used to search all the levels. Science Keywords are all stored in upper case. Queries with science keywords will automatically be changed to upper case for searching. 
If you specify a list or a single value, then the search looks for an exact match between the string specified and the data stored. For example, if the search value is 'IMAGERY' and the data stored has the value 'SATELLITE IMAGERY', the data will not be returned since there was no exact match. In this instance, it is more useful to use the textPattern element for the search. 

Code Listing 27: Sample Science Keyword Search

 

<collectionCondition> 
    <scienceKeywords operator="AND">
        <scienceKeyword>
            <categoryKeyword>
                <value>'category'</value>
            </categoryKeyword>
            <topicKeyword>
                <value>'topic'</value>
            </topicKeyword>
            <termKeyword>
                <value>'term'</value>
            </termKeyword>
            <variableLevel1Keyword>
                <value>'level1'</value>
            </variableLevel1Keyword>
            <variableLevel2Keyword>
                <value>'level2'</value>
            </variableLevel2Keyword>
            <variableLevel3Keyword>
                <value>'level3'</value>
            </variableLevel3Keyword>
            <detailedVariableKeyword>
                <value>'detailed'</value>
            </detailedVariableKeyword>
        </scienceKeyword>
    </scienceKeywords>
<collectionCondition>
 

 


Code Listing 28: Sample Science Keyword Search with anyKeyword

 

<collectionCondition>
    <scienceKeywords operator="AND">
        <scienceKeyword>
            <anyKeyword>
                <textPattern>'%WATER%'</textPattern>
            </anyKeyword>
        </scienceKeyword>
    </scienceKeywords>
<collectionCondition>

 

Processing Level
Use processingLevel to specify the level at which the data (collection/granule) has been processed, for example, level 0, 1, 1A, 1B, 2, 3, 4. The search can specify one or more processing levels. The values must be single-quoted strings. 
This example shows a search for all collections at processing level 1, 1A, or 1B. 

Code Listing 29: Processing Level Search Element

 

<collectionCondition>
    <processingLevel>
        <list>
            <value>'1'</value>
            <value>'1A'</value>
            <value>'1B'</value>
        </list>
    </processingLevel>
</collectionCondition>

 

This example shows a search for all collections at processing level 1, 1A, or 1B—any value starting with the digit 1. This also returns results for collections with processing levels 13, 14, etc. 

Code Listing 30: Processing Level Element with Text Pattern

 

 <collectionCondition>
    <processingLevel>
        <textPattern operator="LIKE">'1_'</textPattern> 
    </processingLevel>
</collectionCondition>

 

Additional Attribute Name 
Use additionalAttributeName to search for collections based on the names of the additional attributes in the collections. You can search for a known value in a value, a list of known values in a list, or a text pattern in a textPattern. 
This example shows a search for data with an additionalAttributeName value of 1 or 3. 

Code Listing 31: Additional Attribute Search Element

 

<collectionCondition>
    <additionalAttributeName>
        <list>
            <value>'value_1'</value> 
            <value>'value_3'</value>
        </list>
    </additionalAttributeName>
</collectionCondition> 

 

Short Name
Use shortName to specify a search for the short name of collections, which may or may not be unique for a particular provider. 
This example shows a search for all collections that have shortNames starting with ‗BOREAS.' 

Code Listing 32: Short Name Search Element

 

<collectionCondition>
    <shortName>
        <textPattern>'BOREAS%'</textPattern>
    </shortName>
</collectionCondition>

 

Spatial Keywords
Use spatialKeywords to specify a word or phrase that summarizes the spatial region covered by the collection. A collection may cover several regions. 
This example shows a search for all collections that cover Africa or Bermuda or the Indian Ocean. 

Code Listing 33: Spatial Keywords Search Element

 

<collectionCondition>
    <spatialKeywords>
        <list>
            <value>'Africa'</value>
            <value>'Bermuda'</value> 
            <value>'Indian Ocean'</value>
        </list>
    </spatialKeywords>
</collectionCondition>

 

This example shows a search for all collections that cover some region(s) of the Americas. 

Code Listing 34: Spatial Keywords Element with Text Pattern

 

<collectionCondition>
    <spatialKeywords>
        <textPattern operator="LIKE">'%america%'</textPattern> 
    </spatialKeywords>
</collectionCondition>

 

Temporal Keywords
Use temporalKeywords to specify a word or phrase that summarizes the temporal characteristics referenced in the collection. 
This example shows a search for all collections that have accumulated data during the spring or fall. 

Code Listing 35: Temporal Keywords Element

 

<collectionCondition>
    <temporalKeywords>
        <list>
            <value>'spring'</value>
            <value>'fall'</value>
        </list>
    </temporalKeywords>
</collectionCondition>

 

Archive Center
Use archiveCenter to search for collections based on the center where a collection is archived. You may search for a known value in a value, a list of known values in a list, or a text pattern in a textPattern

Code Listing 36: Archive Center Search Element

 

<collectionCondition>
    <archiveCenter> 
        <value>'ORNL_DAAC'</value>
    </archiveCenter>
</collectionCondition>

 

Search Elements for Granule/Inventory Queries

This section describes elements used specifically for granule (Inventory) searches. 
Granules with Browse Data 
Use browseOnly to specify that you want only granules that have browse data available. 

Code Listing 37: Browse-only Search Element

 

<granuleCondition>
    <browseOnly/>
</granuleCondition>

 

Percentage of Cloud Cover 
Use cloudCover to specify a range of percentage of scene cloud coverage in a granule. For the value in each attribute of the range, you should use a floating number between 0 and 100 that specifies the range in percentage of cloud coverage in a granule. You cannot use the negated condition for this search. 
This example shows a search for only those granules that have cloud cover between 10% and 20%. 

Code Listing 38: Cloud Cover Search Element

 

<granuleCondition>
    <cloudCover>
        <range lower="10" upper="20"/> 
    </cloudCover>
</granuleCondition>

 

Day, Night, or Both Granules 
Use dayNightFlag to specify a search for granules that are gathered during daylight only, nighttime only, or both. If you do not specify this criterion, then your results will include granules gathered at all times of day. 
This example shows a search for granules gathered at least partly during daylight. 

Code Listing 39: Search Element for Granules Gathered During Daylight Only

 

<granuleCondition> 
    <dayNightFlag value="DAY"/>
</granuleCondition>

 

This example shows a search for granules gathered at least partly during the night. 

Code Listing 40: Search Element for Granules Gathered During the Nighttime Only

 

<granuleCondition> 
    <dayNightFlag value="NIGHT"/>
</granuleCondition>

 

This example shows a search for granules gathered partly at night and partly during the daylight. 

Code Listing 41: Search Element for Granules Gathered During Daylight, Nighttime, or Both

 

<granuleCondition> 
    <dayNightFlag value="Both"/>
</granuleCondition>

 

ECHO Granule IDs 
Use ECHOGranuleID to specify an inventory search for specific granules. This search does not need to specify any spatial or temporal constraint. You can use this as a second stage query when you know the list of granules you are interested in from a previous query to hone results. The search is then limited to granules in the list. The list may contain granules from different data sets. ECHO performs the search on ECHO_GRANULE_ID, an ECHO-wide unique ID. You must enclose the names of the granules in single quotation marks (that is, apostrophes). 

Code Listing 42: Granule ID Search Element

 

<granuleCondition>
    <ECHOGranuleID>
        <list> 
            <value>'G1984-ORNL_DAAC'</value>
        </list>
    </ECHOGranuleID>
</granuleCondition>

 

Granule UR 
Use GranuleUR to specify an inventory search for specific granules. Like granule ID, this criterion can be used as a secondary stage query. Instead of using the ECHO-specific ID for the granules, this criterion allows you to use the provider-given name for the granules. Provider-given names are more meaningful and easier to remember. Since the granule names given by the provider are not guaranteed to be unique within ECHO, if a granule with the same name exists for more than one dataCenterId specified in the query, all will be returned in the results. You must enclose the names of the granules in single quotation marks (that is, apostrophes). Note that the GranuleUR can contain value, list, textPattern or patternList children. 

Code Listing 43: Granule UR Search Element

 

<granuleCondition>
    <GranuleUR>
        <list> 
            <value>'ACCP_CANOPYCHEM.df_can_calc.dat'</value> 
            <value>'ANGLIA_10YRCLIMATE.cfrs1120.zip'</value>
        </list>
    </GranuleUR>
</granuleCondition>

 

Two-Dimensional Coordinate System 
Use TwoDCoordinateSystem as an alternative to specifying a spatial or temporal range. For some collections, granules can be located by searching a range of values on a two dimensional grid, (for example, Path/Row for Landsat, X/Y for MODIS Grid data). 
The TwoDCoordinateSystem criterion needs three elements:

  • the TwoDCoordinateSystemName
  • the Coordinate1 range
  • the Coordinate2 range 

Coordinate1 and Coordinate2 may also take a single value. The query returns all granules that match your specified TwoDCoordinateSystemName and overlap with the Coordinate1 and Coordinate2 ranges. Coordinate1 and Coordinate2 ranges must have both lower and upper attributes specified. 
This example shows a search for a range value. 

Code Listing 44: TwoDCoordinateSystem Search Element

 

<granuleCondition>
    <TwoDCoordinateSystem>
        <TwoDCoordinateSystemName>
            <value>'WRS2'</value>
        </TwoDCoordinateSystemName>
        <Coordinate1>
            <range lower='15' upper='20'/>
        </Coordinate1> 
        <Coordinate2>
            <range lower='33' upper='42'/>
        </Coordinate2>
    </TwoDCoordinateSystem> 
</granuleCondition>

 

This example shows a search for a single value. 

Code Listing 45: TwoDCoordinateSystem Search Element with a Single Value

 

<granuleCondition>
    <TwoDCoordinateSystem>
        <TwoDCoordinateSystemName>
            <value>'WRS2'</value>
        </TwoDCoordinateSystemName>
        <coordinate1>
            <value>15<value/>
        </coordinate1> 
        <coordinate2>
            <range lower='33' upper='42'/>
        </coordinate2>
    </TwoDCoordinateSystem > 
</granuleCondition>

 

ProducerGranuleID 
Use ProducerGranuleID to specify an inventory search for specific granules. ProducerGranuleID represents the ID assigned to data by the Science team that produced the data. Instead of using the ECHO-specific IDs for the granules, this criterion allows the user to use the producer's given name for the granules. Granule names are available to the Science teams and are easier to search on. Since the granule names given by the producer are not guaranteed to be unique within ECHO, if a granule with the same name exists for more than one dataCenterId specified in the query, all will be returned in the results. You must enclose the names of the granules in single quotation marks (that is, apostrophes). Note that the ProducerGranuleID can contain value, list, textPattern or patternList children. 

Code Listing 46: ProducerGranuleID Search Element

 

<granuleCondition>
    <ProducerGranuleID>
        <list>
            <value>'MOD03.A2000107.0930.003.2002056052717.hdf'</value>
            <value>'MOD01.A2000107.0740.003.2002056051321.hdf'</value>
        </list>
    </ProducerGranuleID>
</granuleCondition>

 

PGE Name 
Use PGEName to search for granules based on the name of the product generation executive (PGE). You can search for a known value in a value element, a list of known values in a list, or a text pattern in a textPattern

Code Listing 47: PGE Name Search Element

 

<granuleCondition>
    <PGEName> 
        <value>'test_PGEName'</value>
    </PGEName>
</granuleCondition>

 

PGE Version 
Use PGEVersion to search for granules based on the version of PGE that originally produced the granule. You can search for a known value in a value element, a list of known values in a list, or a text pattern in a textPattern. 

Code Listing 48: PGE Version Search Element

 

<granuleCondition>
    <PGEVersion>
        <value>'3.0.0'</value>
    </PGEVersion>
</granuleCondition>

 

Collection Short Name 
Use collectionShortName to search for granules based on the short name of the collection they belong to. You can search for a known value in a value element, a list of known values in a list, or a text pattern in a textPattern

Code Listing 49: Collection Short Name Search Element

 

<granuleCondition>
    <collectionShortName>
        <value>'MOD03'</value>
    </collectionShortName>
</granuleCondition>

 

Measured Parameters 
Use measuredParameters to search for granules based on one or more groups of measured science parameters. You can specify the relationship between groups of parameters with either AND or OR.

An AND relationship means that result granules must match across all groups.

An OR relationship means that result granules can match any of the groups. OR is the default setting. 
Within each measured parameter, you must specify a measuredParameterName in single quotation marks (that is, apostrophes) for exact matching. The detailed measured parameters can be valuelist, and textPattern type, or range and dateRange type. 
This example shows a search that specifies an "AND" relationship between two measured parameter groups. 

Code Listing 50: Measured Parameter Search Element

 

<granuleCondition>
    <measuredParameters operator="AND">
        <measuredParameter>
            <measuredParameterName>'EV_1KM_RefSB'</measuredParameterName>
            <operationalQualityFlag>
                <value>'Passed'</value>
            </operationalQualityFlag>
            <QAPercentOutOfBoundsData> <range lower='30' upper='40'/>
            </QAPercentOutOfBoundsData>
        </measuredParameter>
        <measuredParameter>
            <measuredParameterName>'EV_1KM_RefSB'</measuredParameterName>
                <operationalQualityFlag>
                    <value>'Passed'</value>
                </operationalQualityFlag>
            <QAPercentOutOfBoundsData>
                <range lower='39' upper='50'/> 
            </QAPercentOutOfBoundsData>
        </measuredParameter>
    </measuredParameters>
</granuleCondition>

 


This example shows a search that specifies an "OR" relationship between two measured parameter groups. 

Code Listing 51: Measured Parameter Search Element

 

<granuleCondition>
    <measuredParameters operator="OR">
        <measuredParameter>
            <measuredParameterName>'EV_1KM_RefSB'</measuredParameterName>
            <operationalQualityFlag>
                <value>'Passed'</value>
            </operationalQualityFlag>
            <QAPercentOutOfBoundsData> <range lower='30' upper='40'/>
            </QAPercentOutOfBoundsData>
        </measuredParameter>
        <measuredParameter>
            <measuredParameterName>'EV_1KM_RefSB'</measuredParameterName>
                <operationalQualityFlag>
                    <value>'Passed'</value>
                </operationalQualityFlag>
            <QAPercentOutOfBoundsData>
                <range lower='39' upper='50'/> 
            </QAPercentOutOfBoundsData>
        </measuredParameter>
    </measuredParameters>
</granuleCondition>

 

ProviderInsertDate
Use providerInsertDate to search for granules that are within a desired date-time range. StartDate is a required field, and StopDate is optional. The Date format is:

 

<Date YYYY="2001" MM="01" DD="01" HH="00" MI="00" SS="00"/>

 

Where YYYY is year; MM is month, DD is day of the month; HH is hour; MI is minute, and SS is second. 
This example shows a search using providerInsertDate

Code Listing 52: Provider Insert Date Search Element

 

<granuleCondition>
    <providerInsertDate>
        <dateRange>
            <startDate>
                <Date YYYY="2001" MM="01" DD="01" HH="00" MI="00" SS="00"/>
            </startDate>
            <stopDate>
                <Date YYYY="2003" MM="12" DD="01" HH="23" MI="59" SS="59"/> 
            </stopDate>
        </dateRange>
    </providerInsertDate>
</granuleCondition>

 

ProviderProductionDate
Use ProviderProductionDate to search for granules that are within a desired date-time range. StartDate is a required field, and StopDate is optional. The Date format is:

 

<Date YYYY="2001" MM="01" DD="01" HH="00" MI="00" SS="00"/>

 

Where YYYY is year; MM is month, DD is day of the month; HH is hour; MI is minute, and SS is second. 
This example shows a search of the Data Provider's production date search element. 

Code Listing 53: Provider Production Date Search Element

 

<granuleCondition>
    <providerProductionDate>
        <dateRange>
            <startDate>
                <Date YYYY="2001" MM="01" DD="01" HH="00" MI="00" SS="00"/> 
            </startDate>
            <stopDate>
                <Date YYYY="2003" MM="12" DD="01" HH="23" MI="59" SS="59"/> 
            </stopDate>
        </dateRange>
    </providerProductionDate>
</granuleCondition>

 

Miscellaneous Elements

Use the following elements to search for other elements using AQL. 
List
Use List to specify a list of values. The values may be numbers, dates, or strings. Each individual value must appear as text of the value element. If you specify a list of strings, you must use a single-quoted string with no wild-card characters. ECHO searches the parent element using Oracle's IN operator for an exact match with any value in the list. 
In general, interpretation of the list will be dependent on the parent element in which it appears. 

Code Listing 54: The List Element

 

<list>
    <value>'Africa'</value>
    <value>'Bermuda'</value> 
    <value>'Indian Ocean'</value>
</list>

 

Pattern List 
Use patternList to specify a list of text patterns and/or values. See section 6.8.4 for rules associated with values and section 6.8.3 for rules associated with text patterns. 
The values may be numbers, dates, or strings. Each individual value must appear as text of the value element. If you specify a list of string values, you must use a single-quoted string with no wild-card characters. 
The text patterns must conform to the rules specified in section 6.8.3. 
ECHO searches the parent element using Oracle's IN operator for an exact match with any value in the list. 
In general, interpretation of the list will be dependent on the parent element in which it appears.

 

<patternList>
    <value>'Africa'</value>
        <textPattern operator="LIKE" caseInsensitive="Y">'america%'</textPattern>
    <value>'Indian Ocean'</value> 
</patternList>

 

Text Pattern 
Use textPattern to search using the Oracle operator ―LIKE‖ to perform pattern matching. Because of pattern matching, exact specification of what is desired is not needed. The code listing below shows how to invoke the pattern matching. Note that you must specify the operator, and you must use a single-quoted string with or without wild-card characters. 
The wild-card characters supported are '%' and ''. The character ‗%' is a placeholder that represents any number of characters. The character ―‖ is a placeholder that represents a single character.

Table 7: AQL Wildcard Use

Wildcard pattern
Interpretation
‗%JOHN%'Strings containing ‗JOHN' as a sub-string
‗MARY%'Strings beginning with the characters ‗MARY'
‗%BOB'Strings ending in ‗BOB'
‗D_VE'Strings like ‗DAVE', ‗DOVE', etc.

You can include the actual characters "%" or "" in the pattern by using the ESCAPE character '\'. If the escape character appears in the pattern before the character "%" or "", then Oracle interprets this character literally in the pattern, rather than as a special pattern-matching character. 

Table 8: Wildcard Examples with ESCAPE Character

Wildcard pattern with ESCAPE character

Interpretation

‗JOHN%THAN'

String ‗JOHN%THAN'

‗JOHN%THAN'

Strings ‗JOHNNATHAN', ‗JOHNASDTHAN', etc.

‗JOHN\\MARY'

String ‗JOHN\MARY'

If the parent element (collectionCondition or granuleCondition) has the attribute negated with value 'Y', then the search will look for a string NOT like the pattern specified. 

Code Listing 55: Text Pattern Element

 

<spatialKeywords>
    <textPattern operator="LIKE" caseInsensitive="Y">'america%'</textPattern>
</spatialKeywords>

 

Value
Use value to specify one value. Refer to each individual parent element for a detailed explanation. In general, if the element represents a string pattern, the search will be case sensitive unless the caseInsensitive attribute is set to Y.

 

<value>12.6</value>

 

or

 

<value caseInsensitive="Y">'Asx'</value>

 

Date 
Use Date to specify a date value.

 

<Date YYYY="2000" MM="05" DD="03"/>

 

or

 

<Date YYYY="2000" MM="10" DD="09" HH="21" MI="04" SS="32"/>

 

Date Range 
Use dateRange to specify a range of time. The range can include just a startDate, just a stopDate or both. If you only include a startDate, ECHO searches for data from that time forward with no stop date. If you only include a stopDate, ECHO searches for data from the current time up until the stop date. If you include both a startDate and a stopDate, then ECHO searches for data falling between those two dates, for example, between January 1, 2005 and January 31, 2005.

 

<dateRange>
    <startDate><Date YYYY="2005" MM="01" DD="01"/></startDate> 
    <stopDate><Date YYYY="2005" MM="01" DD="31"/></stopDate>
</dateRange>

 

or

 

<dateRange>
    <stopDate>
        <Date YYYY="2000" MM="10" DD="09" HH="04" MI="12" SS="34"/> 
    </stopDate>
</dateRange>

 

DifEntryId 
Use DifEntryId to find collections by their GCMD (Global Change Master Directory) DIF (Directory Interchange Format) Entry-ID. You can find the GCMD at the following URL:  http://gcmd.nasa.gov.

 

Accessing data

Metadata subscriptions

Appendices

 

  • No labels