How-To Guide for Implementing ESIP Federated Search Servers

From Federation of Earth Science Information Partners
Jump to: navigation, search



ESIP Federated Search is a simple framework for doing a federated (distributed) query among participating members for Earth science data. It is based on the OpenSearch convention for distributed searches, which centers around OpenSearch Description Documents. These XML documents include a template that shows how to construct a URL in order to execute a query against a particular search engine.

The ESIP Federated Search includes certain conventions to support a two-step dataset/granule (file) query. In the first step, a keyword query (and sometimes space-time criteria) is issued for datasets. In the second step, each selected dataset is queried for granules matching space-time (and possibly keyword) criteria.

Esip 2step.png

The key element linking the two steps is an OpenSearch Description document for each dataset which describes how to do the granule (file) search for that dataset.

What Do I Need for an ESIP Federated Search Server?

In a nutshell, you need four things:

  1. A dataset search engine that supports at least keyword (free-text) search, and optionally space-time constraints
  2. An OpenSearch Description Document describing the dataset search engine
  3. A granule-level search engine supporting space-time query
  4. An OpenSearch Description Document for each dataset that describes the granule-level search template for that dataset

Let's look at each of these in detail.

Dataset Search Engine

The Dataset Search Engine should return an Atom document with the dataset results.

<?xml version="1.0"?>
<feed xmlns="" xmlns:opensearch="" xmlns:georss="" 
            xmlns:geo="" xmlns:time="">
<author><name>GES DISC</name><email>[email protected]</email></author>
<title>Mirador collection results for Monoxide</title>
<subtitle type="html">Monoxide (distributed by GES DISC)
<link rel="self" href=""/>
<link rel="" href=""/>
<author><name>GES DISC</name><email>[email protected]</email></author>
<title>MLS/Aura L2 Carbon Monoxide (CO) Mixing Ratio (ML2CO) </title>
<link href=",-180),(90,180)&location=(-90,-180),(90,180)&searchType=Location&event=&startTime=2009-10-10&endTime=2009-10-11 23:59:59&search=&CGISESSID=f408c488319554acd03731525a55f5a8&nr=4&temporalres=1%20Day(s)&prodpg= L2 Carbon Monoxide (CO) Mixing Ratio&granulePresentation=ungrouped" rel=""/>
<summary type="html">Dataset:ML2CO.002(1)</summary>
<link rel="search" type="application/opensearchdescription+xml" title="ML2CO.002" href=""/>
<link rel="enclosure" type="text/html" href="" title="/OpenSearch/mirador_opensearch_ML2CO.002.xml info"/>

Note especially the <link> entry with type "application/opensearchdescription+xml". This is the URL to the OpenSearch Description Document describing how to construct a URL to search for ML2CO.002 data.

Dataset Search OpenSearch Description Document

Once your have a dataset search that can return Atom results of the kind above, the next step is to create an OpenSearch Description Document for the dataset-level search. Here is an example:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="">
  <ShortName>Mirador Dataset Search</ShortName>
  <Description>Use Mirador Dataset Search to obtain a list of Earth Science Data Sets</Description>
  <Tags>Mirador Dataset Search</Tags>
  <Contact>[email protected]</Contact>
  <Url type="application/atom+xml" 

The key here is the <Url> tag, which includes a template showing how to form a URL to execute a search for datasets. Simply replace the placeholders with the search criteria and fetch the resulting URL. THe search engine will return an Atom document with links to the granule-level OpenSearch Description Documents (see above).

Granule (File) search engine

This is probably the hardest aspect. The Granule (or File) search engine should support queries based on some sort of dataset identifier, time and space (if appropriate). Note however, that because of the way the 2-step search works, you can actually have different search engines for different datasets, say, if you have a specialized search algorithm for some data. Also, if your data are global, you need not offer the spatial part of the search. How does the client know which search engine, what dataset identifier to use and whether spatial criteria area allowed? Easy, it's in the OpenSearch Description Document template described in the following section.

The response to the query should again be in Atom form. Here is a partial example:

<link href="" 
  length="2254522" rel=""/>
<link rel="" type="text/xml" title="Metadata" length="10000" 
<link rel="" type="image/jpeg" title="Browse Image" length="10000" 
<link rel="" type="application/netcdf" title="Same File in NetCDF Format" length="10000000" 
<georss:box>29.141, 48.0441, 3.8571, 24.5844</georss:box>

<summary type="html">format:HDF, start:2009-10-10T00:59:24Z, end:2009-10-10T01:05:24Z, size:2254522  (8)</summary>

This is a more complicated picture than than dataset level search. Here are some of the key features to note:

  1. The first <link> element points to the data URL, identified by the rel value of "". These rel values are ESIP conventions for identifying Earth Science file types. This is the one link that is required.
  2. The second <link> element points to an external metadata file URL. (At this point, there is no standard for the metadata format.)
  3. The third <link> element points to a Browse image for the data. Note that this image is actually served on the fly, though it could be a static file.
  4. The fourth <link> element points to a netCDF conversion service for that file. This aspect of the convention is still in work and may eventually link up with the ESIP convention for servicecasting.
  5. Note also the <georss:box>, <time:start> <time:stop> elements, which give some key information to the client for presentation to the user.
  6. The <summary> is somewhat freeform at this point, though a convention may be defined in future for consistency sake

Now, how does the client know which search engine, what dataset identifier to use and whether spatial criteria area allowed? Easy, it's in the OpenSearch Description Document template described in the following section.

Granule Engine OpenSearch Description Documents

These documents are the key to making the link between the Dataset-level and Granule-level searches. They describe how to do a space-time query for a particular dataset. Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/xsl/frost.xsl"?>
<OpenSearchDescription xmlns:os=""
  <os:Description>Obtain a list of URLs:AIRX2RET.005:</os:Description>
  <os:Contact>[email protected]</os:Contact>
  <os:Url type="application/atom+xml" 

Note that this URL template searches only for AIRX2RET.005 and no other dataset. Now, you don't have to have a single static OpenSearch Description document for each dataset (though you can). Some implementations may generate this on the fly, filling in the dataset requested in the appropriate location in the template.

Personal tools