Loading

PARSESELECTOR


gts
Since v1.0.0
Available on all platforms
See also

The PARSESELECTOR function parses a GTS Selector (STRING) returnss the class selector and labels selectors.

In order for PARSESELECTOR to parse correctly a selector, the following characters MUST appear percent-encoded in the STRING to parse, the equal sign (=, %3D), the comma (, %2C) and closing curly brace (} %7D). Due to the way WarpScript parses STRING constants, the % sign MUST be percent-encoded (%25) in the STRING if it appears in WarpScript code:

The STRING class{label=comm%2Cequal%3Dsign} must appear in WarpScript as:

'class{label=comm%252Cequal%253Dsign'

Combined with TOSELECTOR, it can be used to build a selector from a subset of GTS.

[
  'READ_TOKEN'
  'io.senx.tutorial.sensors.temperature'
  { 'sensorId' '=01' }
  '2014-01-05T00:00:00.000Z'
  '2014-01-05T23:59:59.999Z'
]
FETCH

This can be used to simplify the syntax of a FETCH or FIND request.

[
  'READ_TOKEN'
  'io.senx.tutorial.sensors.temperature{sensorId=01}' PARSESELECTOR
  '2014-01-05T00:00:00.000Z'
  '2014-01-05T23:59:59.999Z'
]

FETCH

Signature

Examples

'io.senx.tutorial.sensors.temperature{sensorId=01,sensortype~numeric.*}' PARSESELECTOR