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
.
Operator | Description | Data Types | Sample (pseudo code) |
---|---|---|---|
EQUALS | Checks equality | Scalar | 'Name' Equals 'John' |
NOT_EQUALS | Checks non-equality | Scalar | 'Name' NotEquals 'John' |
LESS_THAN | Checks if the comparison value is less than the source value | Int, Int64, Double | 'Power' LessThan 1000 |
LESS_EQUAL_THAN | Checks if the comparison value is less than or or equal to the source value | Int, Int64, Double | 'Power' LessEqualThan 1000 |
GREATER_THAN | Checks if the comparison value is greater than the source value | Int, Int64, Double | 'Power' LessThan 1000 |
GREATER_EQUAL_THAN | Checks if the comparison value is greater than or or equal to the source value | Int, Int64, Double | 'Power' LessEqualThan 1000 |
IN | Checks if the value is in a list of values | Int, Int64, Double | 'Power' In 1,2,3 |
NOT_IN | Checks if the value is not in a list of values | Int, Int64, Double | 'Power' NotIn 1,2,3 |
LIKE | Match the comparison value case-insensitive with wildcards to the source value | String | 'Power' Like 'Sample' |
MATCH_REG_EX | Match the comparison value as regex to the source value | String | 'Power' MatchRegEx '^[aA]*$' |
ANY_EQ | Check equality of any element to the comparison value | Scalar array | 'PowerArray' AnyEq 1000 |
ANY_LIKE | Check equality of any element to a string comparison value, e.g. value | StringArray | '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
- Open the Admin Panel.
- Select the Repository tab.
- Select Runtime Query Builder.
- Click on the Create button.
- Select the Construction Kit Type.
- Select the columns to filter.
- Execute the query.
- Save the query, if the result is as expected.
Edit Query
- Open the Admin Panel.
- Select the Repository tab.
- Select Runtime Query Builder.
- Select the query to edit.
- Edit the query.
- Execute the query.