CMR OpenSearch Documentation
- CMR OpenSearch overview
- Searching for CMR collections using OpenSearch
- Searching for CMR granules using OpenSearch
- Retrieving OpenSearch Holdings
- Validating the standards compliance of the CMR OpenSearch implementation
- XML and RELAX NG schemas used for validating the CMR OpenSearch Descriptor Document
CMR OpenSearch Overview
CMR OpenSearch is a CMR collections and granules search implementation based on the OpenSearch 1.1 (Draft 5) specification. It allows clients to formulate OpenSearch compliant queries against the CMR collections and granules inventory and specify the desired search results format as OpenSearch compliant ATOM or HTML. The typical two-step usage scenario is described in the ESIP Earth Data discovery OpenSearch best practices document.
Specifications of interest
CMR OpenSearch is compliant with the following specifications, best practices and implementation guides:
- OpenSearch 1.1 (Draft 5) specification
- OpenSearch Geo extension 1.0 (Draft 2)
- OpenSearch Time extension 1.0 (Draft 1)
- OpenSearch Parameter extension 1.0 (Draft 1)
- OpenSearch Relevance extension 1.0 (Draft 1)
- OGC OpenSearch Geo and Time extensions
- OGC OpenSearch extension for Earth Observation
- OASIS Search Retrieve via URL 2.0
- CEOS OpenSearch best practices 1.1
- ESIP Earth Data discovery OpenSearch best practices
- CEOS OpenSearch developer guide 1.4
Searching for CMR collections (datasets) using OpenSearch
The CMR OpenSearch root OSDD describes the supported search query parameters for CMR OpenSearch collection searches. CMR OpenSearch provides an alternate facet-enabled CMR OpenSearch root OSDD , which allows the client to request the presentation of the faceted search results as specified in the OASIS Search Retrieve via URL 2.0 specification. When requested, facet information is added to the end of the ATOM feed in order to maintain the ATOM response compatibility. It is recommended that OSDD requests include a clientId query paramater, which is used to uniquely identify the client as illustrated in the examples below:
- GET CMR root OSDD with a clientId = cswOpenSearchDoc: https://cmr.earthdata.nasa.gov/opensearch /collections/descriptor_document.xml?clientId=cswOpenSearchDoc
- GET the facet enabled CMR root OSDD with a clientId = cswOpenSearchDoc: https://cmr.earthdata.nasa.gov/opensearch /collections/descriptor_document_facets.xml?clientId=cswOpenSearchDoc
- GET the first 10 CMR collections with results in the ATOM format: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR collections with results in the ATOM format and facet information in the output: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?numberOfResults=10&facetLimit=100&clientId=cswOpenSearchDoc
- GET the first 10 CMR collections with results in the HTML format: https://cmr.earthdata.nasa.gov/opensearch /collections?numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR collections containing the term MODIS with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?keyword=MODIS&numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR collections containing the term MODIS and intersecting the -179,-89,179,89 bounding box with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?keyword=MODIS&spatial_type=bbox&boundingBox=-179,-89,179,89&numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR collections containing the term MODIS, with the temporal coverage between 2000-09-06T00:00:00Z and 2016-09-06T00:00:00Z and intersecting the -179,-89,179,89 bounding box with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?keyword=MODIS&startTime=2000-09-06T00:00:00Z&endTime=2016-09-06T00:00:00Z&spatial_type=bbox&boundingBox=-179,-89,179,89&numberOfResults=10&clientId=cswOpenSearchDoc
Sample CMR OpenSearch collections searches:
Searching for CWIC CMR collections using OpenSearch
CMR OpenSearch can restrict the scope of the search queries to CEOS WGISS Integrated Catalog (CWIC) collections via the queryParamter isCwic = true. CWIC collections are tagged in the CMR inventory as special collections for which granules are provided via a CWIC OpenSearch interface according to the ESIP Earth Data discovery OpenSearch best practices. Details about CWIC can be found at Committee for Earth Observation Satellites CWIC project page.
- GET the first 10 CWIC CMR collections with results in the ATOM format and facet information in the output: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?numberOfResults=10&facetLimit=100&isCwic=true&clientId=cswOpenSearchDoc
- GET the first 10 CWIC CMR collections with results in the HTML format: https://cmr.earthdata.nasa.gov/opensearch /collections?numberOfResults=10&isCwic=true&clientId=cswOpenSearchDoc
- GET the first 10 CWIC CMR collections containing the term MODIS with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /collections.atom?keyword=MODIS&isCwic=true&numberOfResults=10&clientId=cswOpenSearchDoc
Sample CMR OpenSearch CWIC CMR collections searches:
Searching for CMR granules using OpenSearch
A CMR collection specific OSDD allow searches for granules within a specified collection. There is no facet-enabled collection specific OSDD. An OpenSearch CMR collection must be uniquely identified by its shortName, versionId and dataCenter as illustrated by the sample CMR OpenSearch collection specific OSDD below:
- GET CMR OpenSearch collection specific OSDD with a clientId = cswOpenSearchDoc: https://cmr.earthdata.nasa.gov/opensearch /granules/descriptor_document.xml?dataCenter=LARC_ASDC&shortName=ARESE_ER2_MAS&versionId=1&clientId=cswOpenSearchDoc
- GET the first 10 CMR granules in the specified collection with results in the ATOM format: https://cmr.earthdata.nasa.gov/opensearch /granules.atom?dataCenter=LARC_ASDC&shortName=ARESE_ER2_MAS&versionId=1&numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR granules in the specified collection with results in the HTML format: https://cmr.earthdata.nasa.gov/opensearch /granules?dataCenter=LARC_ASDC&shortName=ARESE_ER2_MAS&versionId=1&numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR granules in the specified collection and the granule spatial coverage intersecting the -179,-89,179,89 bounding box with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /granules.atom?dataCenter=LARC_ASDC&shortName=ARESE_ER2_MAS&versionId=1&spatial_type=bbox&boundingBox=-179,-89,179,89&numberOfResults=10&clientId=cswOpenSearchDoc
- GET the first 10 CMR granules in the specified collection with the granules temporal coverage between 1995-09-06T00:00:00Z and 2016-09-06T00:00:00Z and the granule temporal coverage intersecting the -179,-89,179,89 bounding box with results in the ATOM output format: https://cmr.earthdata.nasa.gov/opensearch /granules.atom?dataCenter=LARC_ASDC&shortName=ARESE_ER2_MAS&versionId=1&startTime=1995-09-06T00:00:00Z&endTime=2016-09-06T00:00:00Z&spatial_type=bbox&boundingBox=-179,-89,179,89&numberOfResults=10&clientId=cswOpenSearchDoc
Sample CMR OpenSearch granules searches within the above collection:
Retrieving OpenSearch Holdings
To retrieve information related to the holdings across supported OpenSearch providers (in JSON format) visit the holdings endpoint.
For each provider, the endpoint will provide the number of collections, and the sum of all of their granules. Errors and timestamps are also returned for debugging purposes. An example response is provided below:
{ "provider_name": { "collections": 263, "granules": 0, "last_error": null, "last_requested_at": "2022-07-22T14:38:02Z", "updated_at": "2022-07-22T14:38:04Z" } }
To retrieve information for a specific provider and their collections (in JSON format) visit the provider holdings endpoint, ensure to change `provider_name` to a supported OpenSearch provider.
{ "count": 263, "last_requested_at": "2022-07-28T18:24:15Z", "items": { "C1000000001-TEST": { "last_error": "No granule url found in tags or related url metadata.", "last_requested_at": "2022-07-28T18:24:15Z" }, "C1000000002-TEST": { "count": 2733598, "updated_at": "2022-07-28T18:24:17Z" } ... } }
Validating the standards compliance of the CMR OpenSearch implementation
The CMR OpenSearch or any other implementation which has a publicly accessible OpenSearch Description Document can be validated for compliance with all off the Specifications of interest by providing the URL of the OSDD to be validated to the CWICSmart OSDD validation tool.
The tool will provide individual validation scores for OpenSearch features as well as an overall validation score. For features which failed validation, the tool will suggest ways to achieve compliance.
XML and RELAX NG schemas used for validating the CMR OpenSearch Descriptor Document:
- XML schemas:
- OpenSearch.xsd was developed by developed by the CWICSmart team based on an existing public domain schema at http://weblogs.asp.net/wkriebel/archive/2008/02/04/opensearch-xsd.aspx
- ATOM.xsd public domain schema identical with https://tools.oasis-open.org/version-control/browse/wsvn/cmis/trunk/SchemaProject/schema/ATOM.xsd
- xml.xsd public domain schema referenced by ATOM.xsd identical with the OASIS https://tools.oasis-open.org/version-control/browse/wsvn/cmis/trunk/SchemaProject/schema/xml.xsd
- RELAX NG compact syntax schemas: Becuase the OGC OpenSearch extension for Earth Observation and theOGC OpenSearch Geo and Time extensions specifications are in different maturity levels, their individual RELAX NG schemas have not yet been unified into a single set of RELAX NG schemas that can be applied to both specifications.
- Schemas used by the OGC OpenSearch extension for Earth Observation: