Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The SEQUENCE type triggers iff the input events match the given pattern. The request is based on the SASE operator. The query parameter expects a query formulated in the SASE query language. See. SASE

 

Code Block
languagepql
SASE({query = 'PATTERN SEQ(person p, bid b)
WHERE skip_till_next_match(p,b)
{p.id = b.bidder, b.price > 200}
RETURN p.id, p.name, b.price', schema=[['id','Integer'],'name','String'], type='PersonEvent1'} , person, bid) 

The query selects attributes of people and the commandments of the respective persons for whom the person appears before the commandment and his commandment is greater than 200.

FIRST-N

Beschreibung

Die Anfrage wählt alle zehn Sekunden die ersten drei Gebote aus, die größer als 100 sind und gibt die angegebenen Attribute aus.

Benötigte Parameter

count, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Der Ausgabemodus SIMPLE ist zwar möglich, macht aber in diesem Kontext normalerweise keinen Sinn.

The FIRST-N type returns the first N events.

 

Code Block
languagepql
PATTERN(
Code Block
languagejavascript
PATTERN({type = 'FIRST_N', eventTypes = ['bid'],
time = 10, timeUnit = 'SECONDS',
count = 3,
assertions = ['bid.price > 100'],
outputmode = 'EXPRESSIONS',
return = ['bid.timestamp', 'bid.bidder',
'bid.price']}, bid)

LAST-N

Beschreibung

Die Anfrage wählt alle zehn Sekunden die letzten drei relevanten Events aus. Dies können Gebote und Auktionen sein.

Benötigte Parameter

count, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Der Ausgabemodus SIMPLE ist zwar möglich, macht aber in diesem Kontext normalerweise keinen Sinn. Beinhaltet die Ausgabe verschiedene Event-Typen macht der Ausgabemodus TUPLE_CONTAINER Sinn, da bei dort das Schema der Daten keine Rolle spielt. Bei anderen Ausgabemodi entstehen unter Umständen null-Werte oder ähnliches.

Code Block
languagejavascript
PATTERN({type = 'LAST_N', eventTypes = ['person',
'auction'],
time = 10, timeUnit = 'SECONDS',
count = 3,
outputmode = 'TUPLE_CONTAINER'}, auction, person)

Trend Pattern

INCREASING

Beschreibung

Das Pattern ist erfüllt, wenn die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden streng monoton steigen.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

The query selects every ten seconds, the first three bids from greater than 100, and outputs the specified attributes from. The output mode SIMPLE is possible, but in this context usually makes no sense.

LAST-N

The LAST-N type returns the last N events.

 

Code Block
languagepql
PATTERN({type = 'LAST_N', eventTypes = ['person',
'auction'],
time = 10, timeUnit = 'SECONDS',
count = 3,
outputmode = 'TUPLE_CONTAINER'}, auction, person)


The query selects every ten seconds from the last three relevant events. This can be bids and auctions. The output mode SIMPLE is possible, but in this context usually makes no sense. Contains the output various types of events makes the output mode TUPLE_CONTAINER sense, since there the schema of the data does not matter. For other output modes may arise null values or the like.

Trend Pattern

INCREASING

The INCREASING type triggers if the value of the event expression rise monotonically.

Code Block
languagepql
PATTERN({type = 'INCREASING', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

The pattern is met when the values of the bids rise monotonically within the fixed time interval of 2 seconds. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

DECREASING

The DECREASING type triggers if the value of the event expression fall monotonically.

 

Code Block
languagejavascript
PATTERN({type = 'INCREASINGDECREASING', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

DECREASING

Beschreibung

Das Pattern ist erfüllt, wenn die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden streng monoton fallen.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

The pattern is met when the values of the bids within the fixed time interval 2 seconds fall monotonically. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

STABLE

The STABLE type triggers if the value of the event expression does not changeIst der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

Code Block
languagejavascriptpql
PATTERN({type = 'DECREASINGSTABLE', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

STABLE

Beschreibung

Das Pattern ist erfüllt, wenn sich die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden nicht ändern.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

The pattern is met if not change the values of the bids within the fixed time interval of 2 seconds. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

NON-INCREASING

 Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

Code Block
languagejavascriptpql
PATTERN({type = 'STABLENON_INCREASING', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

NON-INCREASING

Beschreibung

Das Pattern ist erfüllt, wenn die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden monoton fallen.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

Code Block
languagejavascript
PATTERN({type = 'NON_INCREASING', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

NON-DECREASING

Beschreibung

Das Pattern ist erfüllt, wenn die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden monoton steigen.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

The pattern is met when the values of the bids within the fixed time interval 2 seconds fall monotonically. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

NON-DECREASING

 

Code Block
languagepql
PATTERN({type = 'NON_DECREASING', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

The pattern is met when the values of the bids rise monotonically within the fixed time interval of 2 seconds. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

NON-STABLE

Code Block
languagepql
PATTERN({type = 'NON_STABLE
Code Block
languagejavascript
PATTERN({type = 'NON_DECREASING', eventTypes = ['bid'],
attribute = 'price',
time size = 2, timeUnit = 'SECONDS'3}, bid)

NON-STABLE

Beschreibung

Das Pattern ist das Gegenstück zum Stable-Pattern. Es ist erfüllt, wenn sich die Werte von drei aufeinanderfolgenden Gebote ändern.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

Code Block
languagejavascript
PATTERN({type = 'NON_STABLE', eventTypes = ['bid'],
attribute = 'price', size = 3}, bid)

MIXED

Beschreibung

Das Pattern ist erfüllt, wenn die Werte der Gebote innerhalb des festen Zeitintervalls von 2 Sekunden mindestens einmal streng monoton steigen und mindestens einmal streng monoton fallen.

Benötigte Parameter

attribute, time oder size

Mögliche Parameter

assertions, outputMode, return, inputPort, timeUnit

Besonderheiten

Ist der Ausgabemodus nicht SIMPLE, werden bei der Erfüllung des Patterns alle relevanten Events ausgegeben, die die Assertions erfüllen.

The pattern is the counterpart to the stable pattern. It is true if the value changes of three consecutive bids. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

MIXED

 

Code Block
languagepql
Code Block
languagejavascript
PATTERN({type = 'MIXED', eventTypes = ['bid'],
attribute = 'price',
time = 2, timeUnit = 'SECONDS'}, bid)

The pattern is met when the values of the bids within the fixed time interval 2 seconds to rise at least once a strictly monotonic and strictly monotonic fall at least once. Is not the output mode SIMPLE be spent in the performance of the pattern all the relevant events that satisfy the assertions.

Spatial Pattern

MIN-DISTANCE

...