Interface: Predicate

olympe.dc. Predicate

A predicate is commonly understood to be a Boolean-valued function P: X→ {true, false}, called the predicate on X. The olympe.dc.Predicate interface is used by some Transformers, like filter, to decide whether an instance should be included in the resulting set. Examples of predicates are:

  • Equals: Tests whether the instance is equal to another value.
  • Contains: Tests whether a instance contains another string.

Methods


<abstract> getInternalPaths()

Returns the path in the graph followed by this predicate to be evaluated.

Returns:
Type
Array.<!Array.<!olympe.dc.query.Relation>>

<abstract> getName()

Gets the name of this Predicate.

Returns:

The name.

Type
string

<abstract> serialize(parameters)

Serializes the predicate.

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

Serialization parameters.

Throws:

If the predicate is not serializable.

Type
Error
Returns:

A string containing the serialized form.

Type
string

<abstract> test(dcManager, tag)

Checks whether an instance matches this predicate.

Parameters:
Name Type Description
dcManager olympe.dc.Manager

The DC manager.

tag string

The tag of the instance to test.

Returns:

The result of the test as a boolean (or OBoolean) or a node (or proxy) of those types

Type
boolean | olympe.df.Node | olympe.df.OBoolean | olympe.df.Proxy

<abstract> toString()

Gets a string representation of this Predicate.

Returns:

The string representation.

Type
string