The GEOSS Discovery And Access Broker APIs
Authors: Fabrizio Papeschi, Mattia Santoro, Stefano Nativi
API version: 1.4.3-beta

Refiner

Module: Refinement
Parent Module: ResultSet

This object is optionally provided as property of a result set.
A new instance is created every time a discover is performed, and it is maintained with its chronology, until a new discover is performed.

The Refiner is initialized as follows:

  1. the cursor value is 0
  2. the chronology.length is 1 and contains the constraints and the options of the origin discover

The Refiner provides the following main features:

Methods

browse

(
  • onResponse
  • who
  • [options]
)
async

Browses the content of the composed node having the given who identifier.
The correspondent result set is the same that could be retrieved by calling the expand method on the composed node having the given who identifier. However the Refiner allows to take advantage of the chronology.
If who corresponds to a non existent node or to a Report/simple:property node, the correspondent result set is empty.

Parameters:

  • onResponse Function

    callback function for receiving asynchronous query response

  • who String

    identifier of the composed node

  • [options] Object optional

    all the options are allowed except start, termFrequency and extension

chronology

() Object[]

Returns the chronology of the constraints used to refine the related result set

Returns:

cursor

() Integer

Returns the chronology cursor, an integer value indicating the current constraints of the chronology.
The value satisfies the following statement: cursor >= 0 && cursor <= history.length

Returns:

Integer:

an integer value indicating the current constraint of the chronology

forward

(
  • [onResponse]
)
Boolean async

Scrolls ahead the chronology:

  1. increases the cursor by one
  2. restores the chronology to the current cursor value
The method is executed only if cursor is less than chronology.length and onResponse is provided

Parameters:

  • [onResponse] Function optional

    callback function for receiving asynchronous query response; if omitted the method is only tested but not executed

Returns:

Boolean:

true if the cursor is less than chronology.length, false otherwise

refine

(
  • onResponse
  • constraints
  • [options]
)
async

Refines the related result set:

  1. merges the given constraints with the original discover constraints
  2. increases the cursor by 1
  3. refines the related result set with the merged constraints and the given options

Only basic constraints are supported. See also mergeConstraints

Parameters:

reset

()

Resets the Refiner to its initial state:

  1. the cursor value is set to 0
  2. the chronology.length is set to 1 and contains the constraints and the options of the origin discover

restore

(
  • [onResponse]
  • cursor
)
Boolean async

Refines the the related result set by restoring the constraints and the options in the chronology at the specified cursor.
The method is executed only if cursor >= 0 && cursor <= chronology.length and onResponse is provided

Parameters:

  • [onResponse] Function optional

    callback function for receiving asynchronous query response; if omitted the method is only tested but not executed

  • cursor Integer

    an integer value indicating the constraints in the chronology to restore

Returns:

Boolean:

true if cursor >= 0 && cursor <= chronology.length , false otherwise

rewind

(
  • [onResponse]
)
Boolean async

Scrolls back the chronology:

  1. decreases the cursor by 1
  2. restores the chronology to the current cursor value
The method is executed only if cursor is greater than 0 and onResponse is provided

Parameters:

  • [onResponse] Function optional

    callback function for receiving asynchronous query response; if omitted the method is only tested but not executed

Returns:

Boolean:

true if the cursor is greater than 0, false otherwise