Skip to content

O2A INDEX API

The O2A INDEX API provide access to harvested metadata content collected from different sources.

The service provides full-text search capabilities based on Elasticsearch query string syntax.

Search Requests

The original search endpoint supports GET and POST requests. Use POST requests for fine-grained or more complex customized search requests.

GET  /index/rest/serch/{index}?

POST /index/rest/search

The search response is provided as JSON document. Next to the default index response format following formats are supported:

  • datacite renders the payload according to the Datacite schema
  • original renders the original source payload in the response

Examples

Following examples search or filter for water temperature in the harvest and harvest-extern indices.

Parameters

The following table describes GET query parameters and JSON encoded field names for POST requests with examples. The query parameter index or the field indices are mandatory.

GETPOSTDescriptionExample GETExample POST
qqueryFull-text queryclimate AND arctic"climate AND arctic"
qfqueryFacetsQuery facets (filter map by field and values)expedition/PS101
qgqueryGeometriesQuery geometries (GeoJSON filter map by field)geometry/{"type":"Point","coordinates":[8.57,53.53]}{ "geometry": [{"type":"Point","coordinates":[8.57,53.53]}] }
ffacetsFields to aggregate values (field or field:N, where N is the number of results)expeditions:20["expeditions:20"]
offsetoffsetStart offset for pagination00
hitshitsNumber of records to return1010
sortsortsSort field(s), use :desc for descendingdate:desc["date:desc"]
excludeexcludesFields excluded from response payloadevents["events"]
includeincludesFields explicitly included in response payloadtitle["title"]
scrollscrollEnable / continue scrolling for large result sets (true or the scroll value from last response)truetrue
operatoroperatorBoolean operator for terms (AND or OR)AND"AND"
formatformatResponse metadata format (unset, datacite, original)datacite"datacite"
indexindicesList of index names to search in (required)harvest,harvest-extern["harvest", "harvest-extern"]

A maximum of 10000 records will be returned. To get more search results, set the scroll parameter to true initially. The response will return the next scroll token that can be used for subsequent requests.

GET Scroll Example

bash
curl -X GET 'https://o2a-data.de/index/rest/search/harvest,harvest-extern?q=climate%20AND%20arctic&qf=expeditions/PS101&f=expeditions:20&offset=0&hits=10&sort=date&exclude=events&include=title&scroll=true&operator=AND&format=datacite'

POST Scroll Example

bash
curl -X POST "https://o2a-data.de/index/rest/search" \
	-H "Content-Type: application/json" \
	-d '{
		"query": "climate AND arctic",
		"queryFacets": { "expeditions": ["PS101", "PS102"] },
		"queryGeometries": { "geometry": [{"type":"Point","coordinates":[8.57,53.53]}] },
		"facets": ["expeditions:20"],
		"offset": 0,
		"hits": 10,
		"sorts": ["date"],
		"excludes": ["events"],
		"includes": ["title"],
		"scroll": "true",
		"operator": "AND",
		"format": "datacite",
		"indices": ["harvest", "harvest-extern"]
	}'

Original Source

During harvesting the original metadata source document is stored.

To get the original source, use the original format in search requests or download the original source directly per uniqueId. Since this operation is IO expensive, use it carefully.

Example

Download the original harvested source document with uniqueId oai:pangaea.de:doi:10.1594/PANGAEA.266536.

bash
curl https://o2a-data.de/index/rest/source/oai:pangaea.de:doi:10.1594/PANGAEA.266536

Adapters

The index service provides experimental adapters for standardized interfaces.

OGC Records API Endpoints

Following GET endpoints are provided. The path parameter collectionId defines the index to query. Use _all to search in all indices. The path parameter itemId targets to the uniqueId of a document.

These query parameters are available

  • q Full-text query
  • limit Number of records to return
  • offset Starting offset for pagination
  • f Response metadata format, e.g. json or geojson