Single Asset Semantic Model Filter¶
The foglamp-filter-sam plugin is designed to gather data together from one or more readings creating a single, new reading with a defined asset name and asset structure. The plugin guarantees that all the data points defined in the asset model are populated with values read in the incoming data stream or with default values provided in the model definition.
The filter will only send the asset model it creates upstream in the pipeline and all other assets will be blocked by the filter.
The purpose of this filter is to form a single asset reading based on the data in the pipeline. The model for how that asset is structured is defined in the configuration of the filter. It can be used to transform real world data from multiple sources into a semantic model for an asset, holding all the data related to the asset in a single location.
Configuration¶
The configuration of the plugin is divided into a number of tabs within the configuration page, each of these tabs is documented below.
Datapoints¶
The Datapoints tab allows the set of datapoints in the resultant model to be defined. The data points are defined in a key/value list, with the key of each list item being the name of the datapoint to create in the result asset.
To add a new item to the list click on the Add new item button at the bottom of the current list. A blank new item will appear.
Key: This is the name of the new datapoint to add to the model asset that is being defined.
Source Asset: The name of the source asset in the data pipeline that will be used to supply the value for this data point in the model.
Source Datapoint: The name of the datapoint in the source asset that will supply the value for the datapoint in the model.
Type: The type of the datapoint value.
Default: A default value to use for the datapoint if no value has arrived for this datapoint in the pipeline.
Model¶
The Model tab allows you to define the name of the asset that is the result of the model and also to enable or disable application of the model to the data stream. If the model is enabled then any data in the pipeline that enters the filter will not be forwarded on in the pipeline, only the newly modeled asset is forwarded along the pipeline.
Asset: The name of the asset to create to hold the modeled data.
Enable: Enable or disable the operation of the filter.
Reporting¶
The Reporting tab allows the way the filter reports readings upstream to be configured.
Reporting method: This defines what triggers the reporting of the model upstream in the pipeline
Periodically: If periodic reporting is selected the model will be reported at a maximum rate defined by two further settings, see below. Reports are only made if the model has changed since the last report.
On Any Change: This reporting method will report the model whenever a change is detected to the model in a block of readings processed by the model. Intermediate changes within a block of readings will not be published, only the final state of the asset at the end of the block.
On All Changes: A report will be made for all changes, including intermediate changes within a block of data processed by the filter.
On Significant Change: A report will be made when a significant percentage of the datapoints within the modeled asset have changed. This percentage is configurable.
Reporting Rate: If periodic reporting is selected this defines the rate at which the model is reported. The units for the rate are configured also.
Rate Unit: This defines the units that apply to the reading rate above.
Significant %: This defines the percentage of datapoints that need to change to be considered a significant percentage and is only used if the reporting method is to to “On Significant Change”.
Timestamp: This controls the timestamp that will be used when reporting the model asset upstream.
Time of last change: The timestamp and user timestamp in the reading will be that of the last item of data read in the pipeline that is included in the asset model.
Time of forwarding: The timestamp and user timestamp will be set the to time when the filter forwards the asset reading upstream.
See Also¶
foglamp-filter-asset - A FogLAMP processing filter that is used to block or allow certain assets to pass onwards in the data stream
foglamp-filter-enumeration - A filter to map between symbolic names and numeric values in a datapoint.
foglamp-filter-metadata - A FogLAMP processing filter plugin that adds metadata to the readings in the data stream
foglamp-filter-normalise - Normalise the timestamps of all readings that pass through the filter. This allows data collected at different rate or with skewed timestamps to be directly compared.
foglamp-filter-python35 - A FogLAMP processing filter that allows Python 3 code to be run on each sensor value.
foglamp-filter-rename - A FogLAMP processing filter that is used to modify the name of an asset, datapoint or both.