Understand Analytics Objects

Use analytics objects to define the structure of the data that your read from a link, or data that you want to write to a link. Oracle IoT Cloud Service automatically generates analytics objects for device streams and analyzed streams.

Use analytics objects to define the fields and data types of the data that you read and write from links. You must also use analytics objects to define the type for the input parameters and the return parameter of a batch analytics processor.

You can access analytics objects from your analytics processors and use them to analyze data, perform calculations, and make predictions based on their values. To access analytics objects from the analytics processors code, you must use the generated Java class name that you specified when creating the analytics object.

Analytics objects can be automatically generated by Oracle IoT Cloud Service, or you can create them manually.

You can also use analytics objects to define aliases for simple types.

Analytics Objects Generated from Data Messages

For each device message format in the IoT application, an analytics object is automatically generated. Message formats contain a subset of the data in a data message. These analytics objects contain all the fields defined in the Oracle IoT Cloud Service data message, including time stamp, source ID, message ID, and IoT annotations.

When you add a new device model to the IoT application, Oracle IoT Cloud Service automatically defines a new analytics object for each of the message formats associated to that device model. If you modify a message format, then the definition of the corresponding analytics object is updated, and the next time that you build your application, the analytics objects are updated.

Modifying message formats might affect the existing analytics objects. Some of those changes, such as deleting a field, changing the type of a field, or deleting a message format in use, are incompatible with the existing analytics objects. Thus you must evaluate the impact before modifying a message format. Other changes such as changing the description or the name of the message format are compatible with the existing analytics object, so they’re automatically applied.

You can use these automatically generated analytics objects from your device message links to store the data that you receive from your devices. You can access automatically generated objects only from device message links. For more information on how to access these analytics objects from device message links, see Use Analytics Objects Generated from Data Messages.

Manually Created Analytics Objects

You can create analytics objects to model the data used when analyzing the data in your application. Analytics objects have a type that can be a primitive type or an object. Use primitive types to model isolated values, and use objects to model a related and cohesive set of data. To learn how to create analytics objects, see Creating Analytics Objects.

For analytics objects of type object, you can define their structure using one of the following ways: