Signomix provides a Data Query Language (DQL) that allows the service user to define the type and scope of data presented by dashboard controls and retrieved via the API.
A DQL expression consists of conditions and their parameters.
In general, a DQL expression has 2 possible forms:
[USING] {report specification} [WHERE] {selection definition} [GET] {data range definition} [{operation definition}] [[AS] {format definition}]
[GET] virtual
Whereby:
uSING
, GET
, WHERE
, AS
keywords are informational only and may be omitted,report className
- where className
is the name of the Java class that implements the report logic (see Report Server)class className
- the same as report className
project name
- retrieve data tagged with project name equal to name
status n
- retrieve data for which the device had a status equal to n
eui ident
ifier - retrieving data for a device with identifier identifier
group identifier
- getting data concerning devices belonging to the group with identifier identifier
channel definition
- retrieval of measurements with names contained in the definition
field - names separated by commas or *
sign meaning all names of measurements for the given sourcenotnull
- discard records (measurements with the same timestamp) that do not have complete values (see channel definition
)deltas
- retrieve increments of measurement valuesExamples:
project test status 1 project test status 1 eui 010203040506 channel * eui 010203040506 channel temperature,humidity
limit n
- retrieve the last n values of the specified dataaverage n [new v]
- retrieve the average value calculated from the last n
measurements, optionally including the additional value v
minimum n [new v]
- download the minimum value from the last n
measurements, optionally taking into account the additional value v
maximum n [new v]
- get the maximum value from the last n
measurements, optionally taking into account the additional value v
from {d1} [to {d2}]
- from the time point defined by {d1}
, to the time point defined by {d1}
.sback n
- include data recorded up to n
seconds earlierascending
- sort the result according toascending
measurement datedescending
- sort the result according to decreasing measurement datedeltas
- get increments of measurement valuesinterval n intervalName
- download data for the n
most recent time intervals with intervalName
zoneTime
zone - take into account the time zoneTime zone
when specifying time points (e.g. Europe/Warsaw
, UTC
). By default, the UTC
time zone is used.gapfill
- fill in gaps in the measurement data that have no value for the time interval. If the measurement value is missing, the value recorded in the previous time interval will be returned.IntervalName interval
names are defined in the Signomix server configuration. By default, the available ones are:
second
- a time interval with a length of 1 secondminute
- time interval with a length of 1 minutehour
- time interval with a length of 1 hourday
- a time interval of 1 dayweek
- a time interval of 1 weekmonth
- a time interval of 1 monthquarter
- a time interval of 3 monthsyear
- a time interval of 1 yearThe sback
parameter is taken into account when retrieving the last group measurements. If it is not specified, data recorded up to one hour earlier are taken into account. This parameter allows you to discard data from sources that have not sent data recently (e.g., they stopped working, but there is historical data that should not be presented in the report).
Definition of time points {d1, d2}
:
yyyy-MM-dd'T'HH:mm:ss.SSSX
or yyyy-MM-dd'T'HH:mm:ssX
or as Unix time
(https://en.wikipedia.org/wiki/Unix_time) (can also be given as number of milliseconds)Xd
- X days backward from the current time - THIS DOES NOT WORK0d-TimeZone
- from the beginning of the current day in the specified time zone0d-UTC
from the beginning of the day in the UTC zone0M-Time
Zone-from the beginning of the current month in the specified time zone0M-UTC
from the beginning of the current month in the UTC zoneXh
- X hours backward from the current momentXm
- X minutes backward from the current momentExamples:
get last 10 last 10 from -2h to -1h from 2023-03-10T00:00:00Z to 2023-03-10T12:00:00Z from 2023-03-23T00:05:00~01:00 to 2023-03-23T00:07:00~01:00 from 1679363129 to 1679395529 from -0M-Europe_Warsaw from -0M-UTC from -0d-Europe/Warsaw to -0m
Selected reports may support additional operations that are performed on the data before it is returned. These operations are defined in the report specification and can be different for different reports. In the case of the IntervalReport
, an operation is available to multiply a measurement value by a value taken from another source.
mpy
- the name of the multiplier - the measurement by which the measurement values returned by the report are to be multipliedmpyeui
- identifier of the device from which the multiplier value is to be takenExample: retrieve the incremental values (every 30 days) of the counter
measurement from the WATERMETTER
device and multiply them by the value of the water
measurement (price of 1m3 of water) stored in the PRICES
data source:
report IntervalReport eui WATERMETTER channel counter interval 30 day mpy water mpyEui PRICES
The default data format is JSON. For selected reports, it is also possible to download data in CSV or HTML format. In this case, you can select the data format by adding the format
keyword and format name to the DQL expression.
json format
- data in JSON format (default)csv
format - data in CSV formathtml format
- data in HTML format