Skip to main content

Runtime Query Builder

Runtime Queries are used to filter data from the Asset Repository. The query builder is a tool to create, edit, and delete runtime queries. The query builder is available in the Admin Panel.

Queries

Runtime Queries depend on a certain Construction Kit Type and derived types. The query builder allows you to filter data based on the selected columns. Data is filtered using field filters, that are based on an attribute path, comparison operator and comparison value.

Attribute Path

Attribute paths are expressions to select a field within the construction kit type. The attribute path is a dot-separated list of field names. The field names are case-sensitive using camelCase notation and must match the field names of the construction kit type.

A typical attribute path looks like this: name, power, location.latitude, location.longitude. Arrays are accessed by index, e.g. powerArray[0], locationArray[0].latitude, where the index is zero-based. The wildcard * can be used to access all elements of an array, e.g. powerArray[*].

Comparison Value

The comparison value is the value to compare with the field value. The comparison value must match the datatype of the field. The comparison value case-sensitivity depends on the comparison operator and must match the datatype of the field. The comparison value can be a single value or a list of values separated by commas.

Compare Operator

The compare operator is used to compare values of the database (source) with a comparison value. Depending on the datatype of the field, different operators are available.

Datatypes

We distinguish between scalar datatypes, array datatypes, complex datatypes, and array of complex datatypes.

  • Scalar: Int, String, Binary, Boolean, DateTime, Double, Enum, Int64.
  • Scalar array: StringArray, IntArray.
  • Complex: Record, GeospatialPoint.
  • Array of complex: RecordArray.
OperatorDescriptionData TypesSample (pseudo code)
EQUALSChecks equalityScalar'Name' Equals 'John'
NOT_EQUALSChecks non-equalityScalar'Name' NotEquals 'John'
LESS_THANChecks if the comparison value is less than the source valueInt, Int64, Double'Power' LessThan 1000
LESS_EQUAL_THANChecks if the comparison value is less than or or equal to the source valueInt, Int64, Double'Power' LessEqualThan 1000
GREATER_THANChecks if the comparison value is greater than the source valueInt, Int64, Double'Power' LessThan 1000
GREATER_EQUAL_THANChecks if the comparison value is greater than or or equal to the source valueInt, Int64, Double'Power' LessEqualThan 1000
INChecks if the value is in a list of valuesInt, Int64, Double'Power' In 1,2,3
NOT_INChecks if the value is not in a list of valuesInt, Int64, Double'Power' NotIn 1,2,3
LIKEMatch the comparison value case-insensitive with wildcards to the source valueString'Power' Like 'Sample'
MATCH_REG_EXMatch the comparison value as regex to the source valueString'Power' MatchRegEx '^[aA]*$'
ANY_EQCheck equality of any element to the comparison valueScalar array'PowerArray' AnyEq 1000
ANY_LIKECheck equality of any element to a string comparison value, e.g. valueStringArray'PowerArray' AnyLike 1000

Runtime Query Builder

The query builder is a tool to create, edit, and delete runtime queries. The query builder is available in the Admin Panel.

Create Query

  1. Open the Admin Panel.
  2. Select the Repository tab.
  3. Select Runtime Query Builder.
  4. Click on the Create button.
  5. Select the Construction Kit Type.
  6. Select the columns to filter.
  7. Execute the query.
  8. Save the query, if the result is as expected.

Edit Query

  1. Open the Admin Panel.
  2. Select the Repository tab.
  3. Select Runtime Query Builder.
  4. Select the query to edit.
  5. Edit the query.
  6. Execute the query.