aivis-engine-v2-cn-sdk-c
0.0.0-master.5224.aec3e3c7x
|
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | List_u8 |
struct | Error |
struct | DtoBooleanDataPoint |
struct | DtoBooleanDataPointWithAvailability |
struct | DtoFloatDataPoint |
struct | DtoFloatDataPointWithAvailability |
struct | DtoStringDataPoint |
struct | DtoStringDataPointWithAvailability |
struct | List_DtoBooleanDataPoint |
struct | List_DtoFloatDataPoint |
struct | List_DtoStringDataPoint |
struct | List_String |
struct | DtoExpressionInfo |
struct | DtoBooleanCell |
struct | DtoFloatCell |
struct | DtoStringCell |
struct | List_DtoBooleanCell |
struct | List_DtoFloatCell |
struct | List_DtoStringCell |
struct | DtoFloatCostValue |
struct | DtoFloatConstraintValue |
struct | List_DtoFloatConstraintValue |
struct | DtoFloatConstraintValues |
struct | List_DtoFloatConstraintValues |
struct | DtoFloatCostValueWithNextNormal |
struct | DtoFloatConstraintValueWithNextNormal |
struct | List_DtoFloatConstraintValueWithNextNormal |
struct | DtoFeatureValueWithNextNormal |
struct | List_DtoFeatureValueWithNextNormal |
struct | DtoFloatConstraintValuesWithNextNormal |
struct | List_DtoFloatConstraintValuesWithNextNormal |
Macros | |
#define | EPS 1e-12 |
Typedefs | |
typedef uint64_t | ModelContextHandle |
typedef uint64_t | ConstraintNavigatorHubHandle |
typedef uint64_t | ConstraintNavigatorInferenceHandle |
typedef uint64_t | TimeseriesDataHandle |
typedef uint64_t | TabularDataHandle |
typedef int64_t | Time |
Functions | |
ModelContextHandle | aivis_model_context_create (const struct Error **out_err) |
ModelContextHandle | aivis_model_context_add_signal_prediction (ModelContextHandle model_context_handle, const char *model_id, const uint8_t *dto_model_json_ptr, size_t dto_model_json_len, const struct Error **out_err) |
ModelContextHandle | aivis_model_context_add_anomaly_detection (ModelContextHandle model_context_handle, const char *model_id, const uint8_t *dto_model_json_ptr, size_t dto_model_json_len, const struct Error **out_err) |
ModelContextHandle | aivis_model_context_add_state_detection (ModelContextHandle model_context_handle, const char *model_id, const uint8_t *dto_model_json_ptr, size_t dto_model_json_len, int64_t segment_id, const struct Error **out_err) |
void | aivis_model_context_destroy (ModelContextHandle handle, const struct Error **out_err) |
ConstraintNavigatorHubHandle | aivis_constraint_navigator_hub_create (ModelContextHandle model_context_handle, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
const struct List_u8 * | aivis_constraint_navigator_hub_get_model (ConstraintNavigatorHubHandle handle, const struct Error **out_err) |
const struct List_u8 * | aivis_constraint_navigator_hub_get_report (ConstraintNavigatorHubHandle handle, const struct Error **out_err) |
void | aivis_constraint_navigator_hub_destroy (ConstraintNavigatorHubHandle handle, const struct Error **out_err) |
ConstraintNavigatorInferenceHandle | aivis_constraint_navigator_inference_create_by_hub_handle (ConstraintNavigatorHubHandle hub_handle, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
void | aivis_free (const void *ptr) |
void | aivis_setup_register_logger (void(*callback)(uint8_t, const char *, const char *, const char *), const struct Error **out_err) |
void | aivis_setup_init_thread_count (uint32_t max_threads, const struct Error **out_err) |
void | aivis_setup_init_api_key (const char *api_key, const struct Error **out_err) |
TimeseriesDataHandle | aivis_timeseries_data_create (const struct Error **out_err) |
void | aivis_timeseries_data_destroy (TimeseriesDataHandle handle, const struct Error **out_err) |
void | aivis_timeseries_data_add_boolean_signal (TimeseriesDataHandle handle, const char *signal_id, const struct DtoBooleanDataPoint *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_boolean_signal_with_availability (TimeseriesDataHandle handle, const char *signal_id, const struct DtoBooleanDataPointWithAvailability *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_boolean_signal_by_expression (TimeseriesDataHandle handle, const char *signal_id, const char *expression, const struct Error **out_err) |
void | aivis_timeseries_data_add_float_signal (TimeseriesDataHandle handle, const char *signal_id, const struct DtoFloatDataPoint *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_float_signal_with_availability (TimeseriesDataHandle handle, const char *signal_id, const struct DtoFloatDataPointWithAvailability *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_float_signal_by_expression (TimeseriesDataHandle handle, const char *signal_id, const char *expression, const struct Error **out_err) |
void | aivis_timeseries_data_add_string_signal (TimeseriesDataHandle handle, const char *signal_id, const struct DtoStringDataPoint *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_string_signal_with_availability (TimeseriesDataHandle handle, const char *signal_id, const struct DtoStringDataPointWithAvailability *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_timeseries_data_add_string_signal_by_expression (TimeseriesDataHandle handle, const char *signal_id, const char *expression, const struct Error **out_err) |
const struct List_DtoBooleanDataPoint * | aivis_timeseries_data_get_boolean_signal (TimeseriesDataHandle handle, const char *signal_id, const struct Error **out_err) |
const struct List_DtoFloatDataPoint * | aivis_timeseries_data_get_float_signal (TimeseriesDataHandle handle, const char *signal_id, const struct Error **out_err) |
const struct List_DtoStringDataPoint * | aivis_timeseries_data_get_string_signal (TimeseriesDataHandle handle, const char *signal_id, const struct Error **out_err) |
const struct DtoExpressionInfo * | aivis_timeseries_data_get_expression_info (TimeseriesDataHandle handle, const char *signal_id, const struct Error **out_err) |
const struct DtoExpressionInfo * | aivis_timeseries_data_parse_expression (const char *expression, const struct Error **out_err) |
TabularDataHandle | aivis_tabular_data_create (const struct Error **out_err) |
void | aivis_tabular_data_destroy (TabularDataHandle handle, const struct Error **out_err) |
void | aivis_tabular_data_add_boolean_column (TabularDataHandle handle, const char *column_id, const struct DtoBooleanCell *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_tabular_data_add_float_column (TabularDataHandle handle, const char *column_id, const struct DtoFloatCell *data_ptr, size_t data_len, const struct Error **out_err) |
void | aivis_tabular_data_add_string_column (TabularDataHandle handle, const char *column_id, const struct DtoStringCell *data_ptr, size_t data_len, const struct Error **out_err) |
const struct List_DtoBooleanCell * | aivis_tabular_data_get_boolean_column (TabularDataHandle handle, const char *column_id, const struct Error **out_err) |
const struct List_DtoFloatCell * | aivis_tabular_data_get_float_column (TabularDataHandle handle, const char *column_id, const struct Error **out_err) |
const struct List_DtoStringCell * | aivis_tabular_data_get_string_column (TabularDataHandle handle, const char *column_id, const struct Error **out_err) |
void | aivis_timeseries_data_read_files (TimeseriesDataHandle handle, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
void | aivis_tabular_data_read_files (TabularDataHandle handle, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
ConstraintNavigatorInferenceHandle | aivis_constraint_navigator_inference_create_by_hub_model (const uint8_t *hub_model_json_ptr, size_t hub_model_json_len, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
const struct List_u8 * | aivis_constraint_navigator_inference_get_data_specification (ConstraintNavigatorInferenceHandle handle, const struct Error **out_err) |
const struct List_DtoFloatConstraintValues * | aivis_constraint_navigator_inference_infer_float (ConstraintNavigatorInferenceHandle inference_handle, TimeseriesDataHandle data_handle, const Time *timestamps_ptr, size_t timestamps_len, const struct Error **out_err) |
const struct List_DtoFloatConstraintValuesWithNextNormal * | aivis_constraint_navigator_inference_infer_float_with_next_normal (ConstraintNavigatorInferenceHandle inference_handle, TimeseriesDataHandle data_handle, const Time *timestamps_ptr, size_t timestamps_len, const uint8_t *config_json_ptr, size_t config_json_len, const struct Error **out_err) |
void | aivis_constraint_navigator_inference_destroy (ConstraintNavigatorInferenceHandle handle, const struct Error **out_err) |
#define EPS 1e-12 |
typedef uint64_t ConstraintNavigatorHubHandle |
typedef uint64_t ConstraintNavigatorInferenceHandle |
Handle for constraint navigator inference
typedef uint64_t ModelContextHandle |
Handle for constraint navigator inference
typedef uint64_t TabularDataHandle |
Handle for tabular data context
typedef int64_t Time |
timestamps and durations
typedef uint64_t TimeseriesDataHandle |
Handle for data context
ConstraintNavigatorHubHandle aivis_constraint_navigator_hub_create | ( | ModelContextHandle | model_context_handle, |
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Create constraint navigator hub for given model context handle and config. Returned handle uniquely identifies this hub for use in other functions. Make sure to delete this instance with aivis_constraint_navigator_hub_destroy()
.
Flavour requirement: FULL
[in] | model_context_handle | Handle to model context |
[in] | config_json_ptr | Pointer to JSON byte array of DtoHubConfig |
[in] | config_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. void aivis_constraint_navigator_hub_destroy | ( | ConstraintNavigatorHubHandle | handle, |
const struct Error ** | out_err | ||
) |
Destroy constraint navigator hub. It's always safe to destroy an instance. Internally the destruction only takes place after all references to this object have been released.
Flavour requirement: FULL
[in] | handle | Handle to constraint navigator hub |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
const struct List_u8* aivis_constraint_navigator_hub_get_model | ( | ConstraintNavigatorHubHandle | handle, |
const struct Error ** | out_err | ||
) |
Get DtoConstraintModel
as JSON byte array for given hub handle
Flavour requirement: FULL
[in] | handle | Handle to constraint navigator hub |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoHubModel
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_u8* aivis_constraint_navigator_hub_get_report | ( | ConstraintNavigatorHubHandle | handle, |
const struct Error ** | out_err | ||
) |
Get DtoReport
as JSON byte array for given hub handle
Flavour requirement: FULL
[in] | handle | Handle to constraint navigator hub |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoHubReport
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) ConstraintNavigatorInferenceHandle aivis_constraint_navigator_inference_create_by_hub_handle | ( | ConstraintNavigatorHubHandle | hub_handle, |
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Create constraint navigator inference for given hub and config. Returned handle uniquely identifies this inference for use in other functions. Make sure to delete this inference with aivis_constraint_navigator_inference_destroy()
.
To create predictions with this inference instance, use any of:
aivis_constraint_navigator_inference_infer_models_with_next_normal()
Flavour requirement: FULL
[in] | hub_handle | Handle to constraint navigator hub |
[in] | config_json_ptr | Pointer to JSON byte array of DtoInferenceConfig |
[in] | config_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. ConstraintNavigatorInferenceHandle aivis_constraint_navigator_inference_create_by_hub_model | ( | const uint8_t * | hub_model_json_ptr, |
size_t | hub_model_json_len, | ||
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Create constraint navigator inference for given DtoConstraintModel
and config. Returned handle uniquely identifies this inference for use in other functions. Make sure to delete this inference with aivis_constraint_navigator_inference_destroy()
.
To create predictions with this inference instance, use any of:
Flavour requirement: FULL
, INFERENCE
[in] | constraint_model_json_ptr | Pointer to JSON byte array of DtoHubModel |
[in] | constraint_model_json_len | Length of JSON byte array of DtoHubModel |
[in] | config_json_ptr | Pointer to JSON byte array of DtoInferenceConfig |
[in] | config_json_len | Length of JSON byte array of DtoInferenceConfig |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. void aivis_constraint_navigator_inference_destroy | ( | ConstraintNavigatorInferenceHandle | handle, |
const struct Error ** | out_err | ||
) |
Destroy constraint navigator inference. It's always safe to destroy an inference. Internally the destruction only takes place after all references to this object have been released.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to constraint navigator inference |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
const struct List_u8* aivis_constraint_navigator_inference_get_data_specification | ( | ConstraintNavigatorInferenceHandle | handle, |
const struct Error ** | out_err | ||
) |
Get DtoInferenceDataSpecification
as JSON byte array for given inference handle
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to constraint navigator inference |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoInferenceDataSpecification
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoFloatConstraintValues* aivis_constraint_navigator_inference_infer_float | ( | ConstraintNavigatorInferenceHandle | inference_handle, |
TimeseriesDataHandle | data_handle, | ||
const Time * | timestamps_ptr, | ||
size_t | timestamps_len, | ||
const struct Error ** | out_err | ||
) |
Calculate the inference on the float valued models within the hub model. The result will be a list of DtoFloatConstraintValues
instances corresponding to given timestamps. Make sure to fill the data context with all data needed for calculation. Check the hub model's DtoInferenceDataSpecification
for needed signals and time ranges.
Flavour requirement: FULL
, INFERENCE
Parameters:
[in] | inference_handle | Handle to constraint navigator inference |
[in] | data_handle | Handle to data context |
[in] | timestamps_ptr | Pointer to array of Time |
[in] | timestamps_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoFloatConstraintValues
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoFloatConstraintValuesWithNextNormal* aivis_constraint_navigator_inference_infer_float_with_next_normal | ( | ConstraintNavigatorInferenceHandle | inference_handle, |
TimeseriesDataHandle | data_handle, | ||
const Time * | timestamps_ptr, | ||
size_t | timestamps_len, | ||
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Calculate the inference and the closest point that satisfies the given conditions on the provided float valued models. The result will be a list of DtoFloatConstraintValuesWithNextNormal
instances corresponding to given timestamps. Make sure to fill the data context with all data needed for calculation. Check the hub model's DtoInferenceDataSpecification
for needed signals and time ranges.
Flavour requirement: FULL
, INFERENCE
Parameters:
[in] | inference_handle | Handle to constraint navigator inference |
[in] | data_handle | Handle to data context |
[in] | timestamps_ptr | Pointer to array of Time |
[in] | timestamps_len | Length of data array |
[in] | config_json_ptr | Pointer to JSON byte array of DtoFloatNextNormalConfig |
[in] | config_json_len | Length of byte array/// |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoFloatConstraintValuesWithNextNormal
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) void aivis_free | ( | const void * | ptr | ) |
Destroy engine's pointer resource. Every pointer returned by the engine must be destroyed with aivis_free()
.
Flavour requirement: FULL
, INFERENCE
[in] | ptr | Pointer to any resource, returned by the engine. It's always safe to call this function, as the function is null checking and only deallocating pointers created by the engine. |
ModelContextHandle aivis_model_context_add_anomaly_detection | ( | ModelContextHandle | model_context_handle, |
const char * | model_id, | ||
const uint8_t * | dto_model_json_ptr, | ||
size_t | dto_model_json_len, | ||
const struct Error ** | out_err | ||
) |
Add a anomaly detection model (DtoModel
) to model context. The added model will be used for constructing constraints.
Flavour requirement: FULL
[in] | model_context_handle | Handle to model context |
[in] | model_id | Model-ID as string |
[in] | dto_model_json_ptr | Pointer to JSON byte array of DtoModel of Anomaly Detection |
[in] | dto_model_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. ModelContextHandle aivis_model_context_add_signal_prediction | ( | ModelContextHandle | model_context_handle, |
const char * | model_id, | ||
const uint8_t * | dto_model_json_ptr, | ||
size_t | dto_model_json_len, | ||
const struct Error ** | out_err | ||
) |
Add a signal prediction model (DtoModel
) to model context. The added model will be used for constructing constraints.
Flavour requirement: FULL
[in] | model_context_handle | Handle to model context |
[in] | model_id | Model-ID as string |
[in] | dto_model_json_ptr | Pointer to JSON byte array of DtoModel of Signal Prediction |
[in] | dto_model_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. ModelContextHandle aivis_model_context_add_state_detection | ( | ModelContextHandle | model_context_handle, |
const char * | model_id, | ||
const uint8_t * | dto_model_json_ptr, | ||
size_t | dto_model_json_len, | ||
int64_t | segment_id, | ||
const struct Error ** | out_err | ||
) |
Add a state detection model (DtoModel
) of a given segment id to model context. The added model will be used for constructing constraints.
Flavour requirement: FULL
[in] | model_context_handle | Handle to model context |
[in] | model_id | Model-ID as string |
[in] | dto_model_json_ptr | Pointer to JSON byte array of DtoModel of Anomaly Detection |
[in] | dto_model_json_len | Length of byte array |
[in] | segment_id | DtoSegmentId as i64 |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. ModelContextHandle aivis_model_context_create | ( | const struct Error ** | out_err | ) |
Create model context. Returned handle uniquely identifies this context for use in other functions. Make sure to delete this context with aivis_model_context_destroy()
.
Flavour requirement: FULL
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. void aivis_model_context_destroy | ( | ModelContextHandle | handle, |
const struct Error ** | out_err | ||
) |
Destroy model context. It's always safe to destroy a context. Internally the destruction only takes place after all references to this object have been released.
Flavour requirement: FULL
[in] | handle | Handle to model context |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_setup_init_api_key | ( | const char * | api_key, |
const struct Error ** | out_err | ||
) |
Set the licensing key to authenticate API calls with.
If the licensing key is not specified through this function, the engine will use the value in the environment variable AIVIS_ENGINE_V2_API_KEY
.
Flavour requirement: FULL
, INFERENCE
[in] | api_key | API license key |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_setup_init_thread_count | ( | uint32_t | max_threads, |
const struct Error ** | out_err | ||
) |
Initialize library to use parallel computation up to given thread count. If count is set to 0
(default), library will automatically use all available threads from MAX_CPU_THREADS
.
Flavour requirement: FULL
, INFERENCE
[in] | max_threads | Maximum number of threads used for computation |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_setup_register_logger | ( | void(*)(uint8_t, const char *, const char *, const char *) | callback, |
const struct Error ** | out_err | ||
) |
Initialize library to use given callback for logging. If no logger is set, the library will not log anything. This callback is called whenever the engine writes a log message.
Flavour requirement: FULL
, INFERENCE
[in] | callback | Function pointer implementing a logging function:
|
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_tabular_data_add_boolean_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct DtoBooleanCell * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add boolean column to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing column with respective type allows to add data to this column (overriding duplicated row ids; for duplicated row ids in the given List, the last one will determine the value). Trying to add data to an already existing synthesized column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[in] | data_ptr | Pointer to array of DtoBooleanCell |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_tabular_data_add_float_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct DtoFloatCell * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add float column to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing column with respective type allows to add data to this column (overriding duplicated row ids; for duplicated row ids in the given List, the last one will determine the value). Trying to add data to an already existing synthesized column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[in] | data_ptr | Pointer to array of DtoFloatCell |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_tabular_data_add_string_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct DtoStringCell * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add string column to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing column with respective type allows to add data to this column (overriding duplicated row ids; for duplicated row ids in the given List, the last one will determine the value). Trying to add data to an already existing synthesized column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[in] | data_ptr | Pointer to array of DtoStringCell |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
TabularDataHandle aivis_tabular_data_create | ( | const struct Error ** | out_err | ) |
Create new data context. Returned handle uniquely identifies this data context for use in other functions. Make sure to delete this context with aivis_tabular_data_destroy()
.
Fill this context with data:
aivis_tabular_data_add_boolean_column()
aivis_tabular_data_add_boolean_column_by_expression()
(TODO ra add expression language for tabular data)aivis_tabular_data_add_float_column()
aivis_tabular_data_add_float_column_by_expression()
(TODO ra add expression language for tabular data)aivis_tabular_data_add_string_column()
aivis_tabular_data_add_string_column_by_expression()
(TODO ra add expression language for tabular data)Get information about this context:
aivis_tabular_data_get_boolean_column()
aivis_tabular_data_get_float_column()
aivis_tabular_data_get_string_column()
aivis_tabular_data_get_expression_info()
(TODO ra add expression language for tabular data)Flavour requirement: FULL
, INFERENCE
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. void aivis_tabular_data_destroy | ( | TabularDataHandle | handle, |
const struct Error ** | out_err | ||
) |
Destroy data context and all its data. It's always safe to destroy a data context. Internally the destruction only takes place after all references to this context have been released.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
const struct List_DtoBooleanCell* aivis_tabular_data_get_boolean_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct Error ** | out_err | ||
) |
Get boolean data of a column with given column_id
from this tabular data context. Requesting a non-existing column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoBooleanCell
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoFloatCell* aivis_tabular_data_get_float_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct Error ** | out_err | ||
) |
Get float data of a column with given column_id
from this tabular data context. Requesting a non-existing column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoFloatCell
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoStringCell* aivis_tabular_data_get_string_column | ( | TabularDataHandle | handle, |
const char * | column_id, | ||
const struct Error ** | out_err | ||
) |
Get string data of a column with given column_id
from this tabular data context. Requesting a non-existing column or a column of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | column_id | Column-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoStringCell
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) void aivis_tabular_data_read_files | ( | TabularDataHandle | handle, |
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Read and ingest files to tabular data context. This function does NOT free the pointer memory.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to tabular data context |
[in] | config_json_ptr | Pointer to JSON byte array of DtoTabularFilesReaderConfig |
[in] | config_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_boolean_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoBooleanDataPoint * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add boolean signal to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoBooleanDataPoint |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_boolean_signal_by_expression | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const char * | expression, | ||
const struct Error ** | out_err | ||
) |
Add a synthesized boolean signal to the data context. Data is created by the given expression from already added signals. Check UserGuide to see how expressions can be used. Trying to add an already existing signal or invalid expression usage will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | expression | Expression defining boolean data |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_boolean_signal_with_availability | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoBooleanDataPointWithAvailability * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add boolean signal (with availabilities) to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoBooleanDataPointWithAvailability |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_float_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoFloatDataPoint * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add float signal to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoFloatDataPoint |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_float_signal_by_expression | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const char * | expression, | ||
const struct Error ** | out_err | ||
) |
Add a synthesized float signal to the data context. Data is created by the given expression from already added signals. Check UserGuide to see how expressions can be used. Trying to add an already existing signal or invalid expression usage will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | expression | Expression defining float data |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_float_signal_with_availability | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoFloatDataPointWithAvailability * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add float signal (with availabilities) to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoFloatDataPointWithAvailability |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_string_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoStringDataPoint * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add string signal to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoStringDataPoint |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_string_signal_by_expression | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const char * | expression, | ||
const struct Error ** | out_err | ||
) |
Add a synthesized string signal to the data context. Data is created by the given expression from already added signals. Check UserGuide to see how expressions can be used. Trying to add an already existing signal or invalid expression usage will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | expression | Expression defining string data |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
void aivis_timeseries_data_add_string_signal_with_availability | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct DtoStringDataPointWithAvailability * | data_ptr, | ||
size_t | data_len, | ||
const struct Error ** | out_err | ||
) |
Add string signal (with availabilities) to data context. Given data is copied. This function does NOT free the pointer memory. Calling this method on an existing signal with respective type allows to add data to this signal (overriding duplicated timestamps; for duplicated timestamps in the given List, the last one will determine the value). Trying to add data to an already existing synthesized signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[in] | data_ptr | Pointer to array of DtoStringDataPointWithAvailability |
[in] | data_len | Length of data array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
TimeseriesDataHandle aivis_timeseries_data_create | ( | const struct Error ** | out_err | ) |
Create new data context. Returned handle uniquely identifies this data context for use in other functions. Make sure to delete this context with aivis_timeseries_data_destroy()
.
Fill this context with data:
aivis_timeseries_data_add_boolean_signal()
aivis_timeseries_data_add_boolean_signal_with_availability()
aivis_timeseries_data_add_boolean_signal_by_expression()
aivis_timeseries_data_add_float_signal()
aivis_timeseries_data_add_float_signal_with_availability()
aivis_timeseries_data_add_float_signal_by_expression()
aivis_timeseries_data_add_string_signal()
aivis_timeseries_data_add_string_signal_with_availability()
aivis_timeseries_data_add_string_signal_by_expression()
Get information about this context:
aivis_timeseries_data_get_boolean_signal()
aivis_timeseries_data_get_float_signal()
aivis_timeseries_data_get_string_signal()
aivis_timeseries_data_get_expression_info()
Flavour requirement: FULL
, INFERENCE
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
0
if an error occurs. void aivis_timeseries_data_destroy | ( | TimeseriesDataHandle | handle, |
const struct Error ** | out_err | ||
) |
Destroy data context and all its data. It's always safe to destroy a data context. Internally the destruction only takes place after all references to this context have been released.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
const struct List_DtoBooleanDataPoint* aivis_timeseries_data_get_boolean_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct Error ** | out_err | ||
) |
Get boolean data of a signal with given signal_id
from this timeseries data context. Requesting a non-existing signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoBooleanDataPoint
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct DtoExpressionInfo* aivis_timeseries_data_get_expression_info | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct Error ** | out_err | ||
) |
Get expression info of a synthesized signal with given signal_id
from this timeseries data context. Requesting a non-existing or non-synthesized signal will result in an exception. DtoExpressionInfo
contains a list of IDs of all involved signals, that have been used to create this signal's data.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoExpressionInfo
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoFloatDataPoint* aivis_timeseries_data_get_float_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct Error ** | out_err | ||
) |
Get float data of a signal with given signal_id
from this timeseries data context. Requesting a non-existing signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoFloatDataPoint
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct List_DtoStringDataPoint* aivis_timeseries_data_get_string_signal | ( | TimeseriesDataHandle | handle, |
const char * | signal_id, | ||
const struct Error ** | out_err | ||
) |
Get string data of a signal with given signal_id
from this timeseries data context. Requesting a non-existing signal or a signal of wrong type will result in an exception.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | signal_id | Signal-ID as string |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoStringDataPoint
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) const struct DtoExpressionInfo* aivis_timeseries_data_parse_expression | ( | const char * | expression, |
const struct Error ** | out_err | ||
) |
Parse given expression and return a list of involved signals IDs. DtoExpressionInfo
contains a list of IDs of signals that are necessary to create a signal with this expression.
Flavour requirement: FULL
, INFERENCE
[in] | expression | Expression defining signal data |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |
DtoExpressionInfo
, or null
if an error occurs (Non-Null pointer must be freed with aivis_free()
) void aivis_timeseries_data_read_files | ( | TimeseriesDataHandle | handle, |
const uint8_t * | config_json_ptr, | ||
size_t | config_json_len, | ||
const struct Error ** | out_err | ||
) |
Read and ingest files to timeseries data context. This function does NOT free the pointer memory.
Flavour requirement: FULL
, INFERENCE
[in] | handle | Handle to timeseries data context |
[in] | config_json_ptr | Pointer to JSON byte array of DtoTimeseriesFilesReaderConfig |
[in] | config_json_len | Length of byte array |
[out] | out_err | If an error occurs, instance of Error is written to this pointer, otherwise null (Non-Null pointer must be freed with aivis_free() ) |