Class: RecursiveRelated

olympe.dc.transformers. RecursiveRelated

A transformer that returns all related instance (by recursively following the specified relation type in the specified direction).


new RecursiveRelated(rel [, direction] [, minHops] [, maxHops])

Creates a RecursiveRelated transformer.

Parameters:
Name Type Argument Default Description
rel olympe.dc.Tag

Tag of the relation.

direction olympe.dc.Direction <optional>

Relation direction, if null follows both directions.

minHops number <optional>
1

Minimum number of hops required, that is segments to follow.

maxHops number <optional>

Maximum number of hops allowed, that is segments to follow (-1 for unlimited).

Implements:

Extends

Members


<protected, non-null> direction :olympe.dc.Direction

Type:
Inherited From:
Overrides:

<protected> tag :string

Type:
  • string
Inherited From:
Overrides:

Methods


<package, static> makeIndex(parentIndex, relationDirection, relationTag, hopCount, relatedTag)

Computes an index value for a related instance.

Parameters:
Name Type Description
parentIndex string

Parent instance index value.

relationDirection string

Relation direction.

relationTag string

Relation tag.

hopCount number

Number of hops needed to reach the related instance.

relatedTag string

Related instance tag.

Returns:

The generated index.

Type
string

equals(r)

Return true if the specified relation is equal to this one.

Parameters:
Name Type Description
r Object
Inherited From:
Overrides:
Returns:
Type
boolean

getDirection()

Gets the relation direction.

Inherited From:
Overrides:
Returns:

The direction.

Type
olympe.dc.Direction

getInverse()

Gets the inverse relation.

Inherited From:
Overrides:
Returns:

The inverse relation.

Type
olympe.dc.registry.Relation

getMaxHops()

Gets the maximum number of hops allowed (-1 means unlimited).

Returns:

The maximum number of hops.

Type
number

getMinHops()

Gets the minimum number of hops required.

Returns:

The minimum number of hops.

Type
number

getName()

Gets this Transformer unique name.

Implements:
Returns:

The name.

Type
string

getTag()

Return the relation tag

Inherited From:
Overrides:
Implements:
Returns:
Type
string

getTransform(manager, stateResolver, callback)

Get the transformer's transform function. This is the method that implementations of Transformer must provide and is where the actual transformation will take place.

Parameters:
Name Type Description
manager olympe.dc.Manager

The DC manager.

stateResolver olympe.dc.ranking.StateResolver

The state resolver.

callback olympe.dc.Manager.TransformationCallback

The callback.

Implements:
Returns:

The transform function.

Type
olympe.dc.Manager.TransformationCallback

getValueType()

Gets the transformed item's value type. A null value means that the transformer will not change the type of the values (e.g. a sort transformer).

Implements:
Returns:

Returns the transformed listDef value new type or null if this transformer does not change it

Type
function

originType()

Return the origin type of this relation.

Inherited From:
Overrides:
Returns:
Type
function

serialize(parameters)

Serializes the transformer.

Parameters:
Name Type Description
parameters olympe.dc.query.Parameters

The parameters for the serialization.

Implements:
Throws:

If the transformer is not serializable.

Type
Error
Returns:

The JSON representation.

Type
string

toString()

Gets a string representation of the transformer.

Inherited From:
Overrides:
Implements:
Returns:

The representation.

Type
string

type()

Return the destination type of this relation.

Inherited From:
Overrides:
Returns:
Type
function