Openseach » History » Version 1
Herve Caumont, 2013-06-19 18:05
1 | 1 | Herve Caumont | h1. OpenSearch in Virtual Archive 4 |
---|---|---|---|
2 | |||
3 | This is a more detailed explaining the OpenSearch interface provided by the Virtual Archive 4 Catalogue Access Service. |
||
4 | |||
5 | Note that the procedure described here does not need to be followed entirely. In many scenarios the series to be queried is already known and therefore it is often possible to skip the first two steps. The series description URL for step *3* can be easily guessed as it follows always the schema: @http://eo-virtual-archive4.esa.int/search/<series-name>/description@ |
||
6 | |||
7 | Following the steps described in the previous section, with @curl@ you have to do the following: |
||
8 | |||
9 | h3. Step 1: Get URL Template for Series Query |
||
10 | |||
11 | Request (using curl): @curl "http://eo-virtual-archive4.esa.int/search/description@" |
||
12 | |||
13 | Response (formatted and shortened): |
||
14 | <pre><code class="xml"> |
||
15 | <OpenSearchDescription ...> |
||
16 | <ShortName>Supersite</ShortName> |
||
17 | <LongName>Discover the different search feeds available at this Supersite</LongName> |
||
18 | <Description>The Supersites have data for the study of natural hazards in geologically active regions, ...</Description> |
||
19 | <Tags> Supersite, ESA, NASA, GEO, NSF, JAXA, UNAVCO, SAR, GPS, Digital Earth Communities, Catalogue</Tags> |
||
20 | <Contact>info@terradue.com</Contact> |
||
21 | <Image height="38" width="120" type="image/png">http://www.terradue.com/images/terradue.png</Image> |
||
22 | <Image height="16" width="16" type="image/vnd.microsoft.icon">http://www.terradue.com/images/terradue.ico</Image> |
||
23 | <Query role="example" geo:box="-25,30,45,70"/> |
||
24 | <Developer>Terradue GeoSpatial Development Team</Developer> |
||
25 | <Attribution>Terradue Srl. Copyright 2008-11, All Rights Reserved</Attribution> |
||
26 | <SyndicationRight>open</SyndicationRight> |
||
27 | <AdultContent>false</AdultContent> |
||
28 | <Language>en-us</Language> |
||
29 | <OutputEncoding>UTF-8</OutputEncoding> |
||
30 | <InputEncoding>UTF-8</InputEncoding> |
||
31 | <Url type="application/rdf+xml" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/rdf/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
32 | <Url type="text/plain" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/wkt/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
33 | <Url type="text/plain" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/txt/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
34 | <Url type="text/tab-separated-values" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/eoli/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
35 | <Url type="text/html" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/html/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
36 | <Url type="application/atom+xml" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/atom/?count={count?}&startPage={startPage?}&startIndex={startIndex?}&q={searchTerms?}&uid={geo:uid?}&bbox={geo:box?}&start={time:start?}&stop={time:end?}"/> |
||
37 | </OpenSearchDescription> |
||
38 | </code></pre> |
||
39 | |||
40 | The @<Url>@ elements contain the information necessary for the querying step *2*, one for each supported output format. |
||
41 | |||
42 | The terms between curly brackets in the @template@ URLs represent the information that can be provided by the client for refining the query: |
||
43 | |||
44 | |_<. Search parameter |_. Required? |_<. Description |_<. Default value | |
||
45 | | @{count?}@ |=. no | Number of records to be returned | @20@ | |
||
46 | | @{startPage?}@ |=. no | Number of result page to be returned (starting with 0, each page contains @count@ records; applies only if there are more than @count@ results) | @0@ | |
||
47 | | @{startIndex?}@ |=. no | Index of first result record to be returned (starting with 0) | @0@ | |
||
48 | | @{searchTerms?}@ |=. no | Textual search string containing key words | _empty_ | |
||
49 | | @{geo:uid?}@ |=. no | Identifier of record to be returned | _empty_ | |
||
50 | | @{geo:box?}@ |=. no | Spatial coverage: rectangular area to be covered in the format @minlon,minlat,maxlon,maxlat@. | @-180,-90,180,90@ | |
||
51 | | @{time:start?}@ |=. no | Temporal coverage: Start date of the period to be covered in the format @YYYY-MM-DD@ or @YYYY-MM-DDThh:mm:ssZ | _minimum possible date value_ | |
||
52 | | @{time:end?}@ |=. no | Temporal coverage: End date of the period to be covered in the format @YYYY-MM-DD@ or @YYYY-MM-DDThh:mm:ssZ | _maximum possible date value_ | |
||
53 | |||
54 | Note that the curly brackets with the contained terms must be removed when performing a query. The connected URL query string parameter *must not* be removed if the parameter is not used. For example if the @uid={geo:uid?}@ is not used, the query URL must still contain @uid=@ (at the end of the URL or followed by an @&@). |
||
55 | |||
56 | h3. Step 2: Query the Series |
||
57 | |||
58 | Example request (using curl, in the following ATOM output is used): @curl "http://eo-virtual-archive4.esa.int/search/atom/?count=&startPage=&startIndex=&q=ENVISAT&uid=&bbox=&start=2004-10-01&stop=2004-12-31"@ |
||
59 | |||
60 | This request queries series related to ENVISAT and containing data sets within that period for which there is data of the last quarter of 2004. |
||
61 | |||
62 | Response (shortened and formatted): |
||
63 | <pre><code class="xml"> |
||
64 | <feed xmlns="http://www.w3.org/2005/Atom" xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/" xml:lang="en"> |
||
65 | <title>Discovery feed for Search Services</title> |
||
66 | <subtitle type="html"> |
||
67 | Found 3 results. |
||
68 | |||
69 | <br/> |
||
70 | </subtitle> |
||
71 | <generator uri="http://www.terradue.com" version="1.4.0">Terradue CAS</generator> |
||
72 | <updated>2013-05-07T16:42:35ZZ</updated> |
||
73 | <id>http://eo-virtual-archive4.esa.int/search/atom/</id> |
||
74 | <link rel="self" type="application/atom+xml" href="http://eo-virtual-archive4.esa.int/search/atom//?startIndex=0&q=ENVISAT&start=2004-12-09&stop=2004-12-31"> |
||
75 | </link> |
||
76 | <link rel="first" type="application/atom+xml" href="http://eo-virtual-archive4.esa.int/search/atom//?startIndex=0&q=ENVISAT&start=2004-12-09&stop=2004-12-31"> |
||
77 | </link> |
||
78 | <link rel="last" type="application/atom+xml" href="http://eo-virtual-archive4.esa.int/search/atom//?startIndex=0&q=ENVISAT&start=2004-12-09&stop=2004-12-31"> |
||
79 | </link> |
||
80 | <link rel="search" type="application/opensearchdescription+xml" href="http://eo-virtual-archive4.esa.int/search/description"> |
||
81 | </link> |
||
82 | <os:totalResults>3</os:totalResults> |
||
83 | <os:startIndex>0</os:startIndex> |
||
84 | <os:itemsPerPage>20</os:itemsPerPage> |
||
85 | <os:Query role="request" searchTerms="ENVISAT" time:start="2004-12-09" time:end="2004-12-31"> |
||
86 | </os:Query> |
||
87 | <entry> |
||
88 | <id>http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/atom</id> |
||
89 | <title>ASAR Image Mode source packets Level 0 (ASA_IM__0P)</title> |
||
90 | <published>2011-01-21T11:05:29.511Z</published> |
||
91 | <updated>2013-04-18T13:44:56.872Z</updated> |
||
92 | <rights> |
||
93 | </rights> |
||
94 | <dc:date>2002-10-18T08:07:37.387Z/2012-04-06T08:24:56.723Z</dc:date> |
||
95 | <georss:where> |
||
96 | <gml:Polygon> |
||
97 | <gml:exterior> |
||
98 | <gml:LinearRing> |
||
99 | <gml:posList srsDimension="2">...</gml:posList> |
||
100 | </gml:LinearRing> |
||
101 | </gml:exterior> |
||
102 | </gml:Polygon> |
||
103 | </georss:where> |
||
104 | <link rel="alternate" type="application/atom+xml" title="ATOM feed" href="http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/atom"> |
||
105 | </link> |
||
106 | <link rel="search" type="application/opensearchdescription+xml" href="http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/description/" title="Search the ASA_IM__0P"> |
||
107 | </link> |
||
108 | <link rel="via" type="application/rdf+xml" title="RDF metadata entry" href="http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/rdf?count=0"> |
||
109 | </link> |
||
110 | <content type="html"> |
||
111 | <b> Search Feed </b> |
||
112 | <ul> |
||
113 | <li> Title: ASAR Image Mode source packets Level 0 (ASA_IM__0P) </li> |
||
114 | The ASAR Image Mode source packets Level 0 data product offers Level 0 data for possible images processing on an other processing site. It includes some mandatory information for SAR processing ... |
||
115 | </content> |
||
116 | </entry> |
||
117 | <entry> |
||
118 | <id>http://eo-virtual-archive4.esa.int/search/ASA_IMS_1P/atom</id> |
||
119 | <title>ENVISAT ASAR Image Mode Single Look Complex Image (ASA_IMS_1P)</title> |
||
120 | <published>2011-01-21T11:05:29.511Z</published> |
||
121 | <updated>2013-04-18T13:44:56.872Z</updated> |
||
122 | <rights> |
||
123 | </rights> |
||
124 | <dc:date>2002-10-21T08:13:28.350Z/2022-02-26T08:26:09.501Z</dc:date> |
||
125 | <georss:where> |
||
126 | <gml:Polygon> |
||
127 | <gml:exterior> |
||
128 | <gml:LinearRing> |
||
129 | <gml:posList srsDimension="2">...</gml:posList> |
||
130 | </gml:LinearRing> |
||
131 | </gml:exterior> |
||
132 | </gml:Polygon> |
||
133 | </georss:where> |
||
134 | <link rel="alternate" type="application/atom+xml" title="ATOM feed" href="http://eo-virtual-archive4.esa.int/search/ASA_IMS_1P/atom"> |
||
135 | </link> |
||
136 | <link rel="search" type="application/opensearchdescription+xml" href="http://eo-virtual-archive4.esa.int/search/ASA_IMS_1P/description/" title="Search the ASA_IMS_1P"> |
||
137 | </link> |
||
138 | <link rel="via" type="application/rdf+xml" title="RDF metadata entry" href="http://eo-virtual-archive4.esa.int/search/ASA_IMS_1P/rdf?count=0"> |
||
139 | </link> |
||
140 | <content type="html"> |
||
141 | <b> Search Feed </b> |
||
142 | <ul> |
||
143 | <li> Title: ENVISAT ASAR Image Mode Single Look Complex Image (ASA_IMS_1P) </li> |
||
144 | The ASAR Image Mode Single Look Complex Image represents a single-look, complex, slant-range, digital image generated from Level 0 ASAR data collected when the instrument is in image mode ... |
||
145 | </content> |
||
146 | </entry> |
||
147 | <entry> |
||
148 | <id>http://eo-virtual-archive4.esa.int/search/ASA_WS__0P/atom</id> |
||
149 | <title>ASAR Wide Swath Level 0 product (ASA_WS__0P)</title> |
||
150 | <published>2011-06-10T11:05:29.511Z</published> |
||
151 | <updated>2013-04-18T08:25:35.099Z</updated> |
||
152 | <dc:date>2004-02-19T03:03:23.736Z/2010-09-12T15:57:36.072Z</dc:date> |
||
153 | <georss:where> |
||
154 | <gml:Polygon> |
||
155 | <gml:exterior> |
||
156 | <gml:LinearRing> |
||
157 | <gml:posList srsDimension="2">...</gml:posList> |
||
158 | </gml:LinearRing> |
||
159 | </gml:exterior> |
||
160 | </gml:Polygon> |
||
161 | </georss:where> |
||
162 | <link rel="alternate" type="application/atom+xml" title="ATOM feed" href="http://eo-virtual-archive4.esa.int/search/ASA_WS__0P/atom"> |
||
163 | </link> |
||
164 | <link rel="search" type="application/opensearchdescription+xml" href="http://eo-virtual-archive4.esa.int/search/ASA_WS__0P/description/" title="Search the ASA_WS__0P"> |
||
165 | </link> |
||
166 | <link rel="via" type="application/rdf+xml" title="RDF metadata entry" href="http://eo-virtual-archive4.esa.int/search/ASA_WS__0P/rdf?count=0"> |
||
167 | </link> |
||
168 | <content type="html"> |
||
169 | <b> Search Feed </b> |
||
170 | <ul> |
||
171 | <li> Title: ASAR Wide Swath Level 0 product (ASA_WS__0P) </li> |
||
172 | The WS Mode Level 0 product consists of time-ordered AISPs collected while the instrument is in WS Mode. The echo samples in the AISPs have been compressed to 4 bits/sample using FBAQ ... |
||
173 | </content> |
||
174 | </entry> |
||
175 | </feed> |
||
176 | </code></pre> |
||
177 | |||
178 | When writing this document, there were 3 matching series out of 15. |
||
179 | |||
180 | In order to proceed with step *3*, a series must be chosen the OpenSearch description URL for finding data sets must be used. This URL is taken from the @<link rel="search">@ element of the corresponding @<entry>@ (this applies to ATOM; in other output formats the description URL is found in different elements). |
||
181 | |||
182 | h3. Step 3: Get URL Template for Data Set Query |
||
183 | |||
184 | Example request (using curl and the series description URL): @curl "http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/description/"@ |
||
185 | |||
186 | Response (shortened and formatted): |
||
187 | <pre><code class="xml"> |
||
188 | <OpenSearchDescription> |
||
189 | ... |
||
190 | <Url type="application/atom+xml" indexOffset="0" pageOffset="0" template="http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/atom/?count={count?}&name={geo:name?}&startPage={startPage?}&startIndex={startIndex?}&sort={sru:sortKeys?}&q={searchTerms?}&start={time:start?}&stop={time:end?}&bbox={geo:box?}&geometry={geo:geometry?}&uid={geo:uid?}&processingCenter={eop:processingCenter?}&acquisitionStation={eop:acquisitionStation?}&orbitDirection={eop:orbitDirection?}&orbitNumber={eop:orbitNumber?}&frame={eop:wrsLatitudeGrid?}&track={eop:wrsLongitudeGrid?}&submitted={dct:dateSubmitted?}" /> |
||
191 | </OpenSearchDescription> |
||
192 | </code></pre> |
||
193 | |||
194 | The result is similar to the one of step one, but applies to data sets of one series and shows additional search parameters (e.g. for the orbit direction), some of which specific to just that series. |
||
195 | |||
196 | |_<. Search parameter |_. Required? |_<. Description |_<. Possible values |_<. Default value | |
||
197 | | @{count?}@ |=. no |/8\3. see above | |
||
198 | | @{startPage?}@ |=. no | |
||
199 | | @{startIndex?}@ |=. no | |
||
200 | | @{searchTerms?}@ |=. no | |
||
201 | | @{geo:uid?}@ |=. no | |
||
202 | | @{geo:box?}@ |=. no | |
||
203 | | @{time:start?}@ |=. no | |
||
204 | | @{time:end?}@ |=. no | |
||
205 | | @{geo:name?}@ |=. no | ??? | | | |
||
206 | | @{sru:sortKeys?}@ |=. no | Result sorting | Sorting expression,| _empty_ | |
||
207 | | @{geo:geometry?}@ |=. no | Spatial coverage | a "WKT":http://en.wikipedia.org/wiki/Well-known_text string (e.g. a @POLYGON((...))@ | _empty_ | |
||
208 | |/5. @{eop:processingCenter?}@ |/5=. no |/5. Processing centre | @I-PAC@ |/5. _empty_ | |
||
209 | | @PDAS-F@ | |
||
210 | | @PDAS-M@ | |
||
211 | | @PDHS-E@ | |
||
212 | | @PDHS-K@ | |
||
213 | | @{eop:acquisitionStation?}@ |=. no | Acquisition station | | _empty_ | |
||
214 | |/2. @{eop:orbitDirection?}@ |/2=. no |/2. Orbit direction | @ASCENDING@ |/2. _empty_ | |
||
215 | | @DESCENDING@ | |
||
216 | | @{eop:orbitNumber?}@ |=. no | Orbit number | | _empty_ | |
||
217 | | @{eop:wrsLatitudeGrid?}@ |=. no | Frame??? | | _empty_ | |
||
218 | | @{eop:wrsLongitudeGrid?}@ |=. no | Track??? | | _empty_ | |
||
219 | |/2. @{dct:dateSubmitted?}@ |/2=. no |/2. Date of insertion of record into the catalogue | Date in interval format @[YYYY-MM-DD,YYYY-MM-DD]@ |/2. _empty_ | |
||
220 | | Date/time in interval format @[YYYY-MM-DDThh:mm:ssZ,YYYY-MM-DD:hh:mm:ssZ]@ | |
||
221 | |||
222 | h3. Step 4: Query the Data Sets |
||
223 | |||
224 | Example request (using curl, in the following ATOM output is used): @curl "http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/atom/?count=50&name=&startPage=&startIndex=&sort=&q=&start=2004-01-01&stop=2004-12-31&bbox=5,35,15,45&geometry=&uid=&processingCenter=&acquisitionStation=&orbitDirection=ASCENDING&orbitNumber=&frame=&track=&submitted="@ |
||
225 | |||
226 | The request queries for ASA_IM__0P data sets over Italy in the year 2004. It results in 75 matching records, of which 50 are shown (as specified in the query string parameter @count=50@). |
||
227 | |||
228 | In order to have an XML document that is parsable more easily, it is recommendable to use the RDF output format. For the example above, the @curl@ command would be: |
||
229 | @curl "http://eo-virtual-archive4.esa.int/search/ASA_IM__0P/rdf/?count=50&name=&startPage=&startIndex=&sort=&q=&start=2004-01-01&stop=2004-12-31&bbox=5,35,15,45&geometry=&uid=&processingCenter=&acquisitionStation=&orbitDirection=ASCENDING&orbitNumber=&frame=&track=&submitted="@ |