Fig. 5.3 Usage example of < filter > element
Fig. 5.4 Usage example of
expr contains anXPath [ 7 ] expression that sets the filter condition; and outputvariable
defines variable that will receive the output of filter processing.
element is responsible for handling the control structures if-elseif-else
in scripts. The elements
are optional. An example of this
element is shown in Fig. 5.4 .
5.3.2 Extending EMML
< macro >
element allows creating user-defined statements to be used in
mashup scripts. Macros are snippets of mashup logic that can accept input parameters
and produce output. Macros can be defined within a single mashup or they can be
defined in macro libraries so that they can be shared among mashups. The macro
functionality is used in PEM to create a mashup domain-specific language (DSL) for
WSN. This DSL is implemented as a macro library of PEM that provides additional
functionality to manipulate WSM information.
The following macros are currently implemented:
ShowRSSFs : Macro responsible for querying the PEM Data Manager about avail-
able WSNs (identification, sensing capabilities, etc.).
SortbyData :Macro that order the data received fromWSN sensors by date (ascend-
ing or descending order).
SortbyDate : Macro responsible for ordering, in chronological order, the values
collected by a sensor of a WSN.
FilterSensor : Macro that filters WSN data according to a given type of sensor (i.e.,
temperature, light, etc.).
FilterPlatform : Macro that filters WSN data according to a particular platform (i.e.
Arduino or TinyOS).