Previous | Table of Contents | Next |
This section defines a little language that is used to describe logical expressions and navigation in structures. A logical
expression evaluates to true or false and can be used in filters for collection of data or definition of states, etc. The
condition_logic described in
Section 5.2.7, “DAISConditionSpace IDL,? on page 5-32 is used to define states.
In DAIS the data model seen through the API is a hierarchical structure of typed nodes. A typed node may contain other typed
nodes and/or property values (called items). This
data model is described in more detail in Section 4.1, “Information Model,? on page 4-1.
In addition to this hierarchy DAIS supports data models where a property value may refer to one or more other nodes. Hence
navigation via such references is needed as well. An information model that includes both hierarchy and references is the
IEC 61970
briefly described in Section 4.1.5, “Utility SCADA/EMS Measurement Model,? on
page 4-5.
To be able to navigate to nodes in the structure the little language shall include support for describing paths. XML Path
Language (XPath) [13] is a language that supports navigation in structures and this specification uses a subset of XPath as
the logical expression language. XPath requires the exposed data model to be hierarchical (even though a model is exposed
as hierarchical it may internally be organized in other ways).
A logical expression in XPath is called “PredicateExpr? (statement 9 in the XPath specification [13]). A PredicateExpr evaluates
to true or false. A logical expression in DAIS is called DAIS_Expression. The rules for a DAIS_expression are:
• The union operator "|" is not supported, refer to statement 18 in [13].
• The arithmetic operators "+", "-", "div", "*" and "mod" are not supported, refer to statements 25, 26 and 27 in [13].
• unabbreviated location paths is not supported.
• abbreviated location paths is supported.
• the following axes are supported; child, parent, descendant, attribute, and self.
• the following XPath functions are supported; id(), position(), not(), true(), false().
• DAIS_Expression ::= PredicateExpr
The following restrictions of the functionality described in the XPath specification are defined for DAIS_Expression:
The mapping between DAIS and XML data models is listed below.
Table 3-1 Mapping between DAIS and XML data models
DAIS entity |
XML entity |
Comment |
|||
Node | A DAIS Node element that may be contained by another DAIS node element. | The DAIS Node element name is the DAIS::Type name (DAIS::Type::Description.label) referenced by DAIS::Node::Description.type. If the DAIS Node element has a parent element, the parent is given by Node::Description.parent. | |||
Node::Description.id | An id attribute of type ID at a DAIS Node element. | Accessed by the id() function | |||
Node::Description.label | A child element of a DAIS Node element. | The element name is “label.? The value is Node::Description.label. |
Table 3-1 Mapping between DAIS and XML data models
DAIS entity |
XML entity |
Comment |
|||
Node::Description. descrip | A child element of a DAIS Node element. | The element name is “description.? The value is Node::Description.descrip. | |||
Item | A DAIS Item element that is child of a DAIS Node element. | The element name is the DAIS::Property name (DAIS::Property:: Description.label) concatenated with the DAIS Node element name separated by a “.?. The DAIS::Property is given by Item::Description.id.property. The DAIS Node parent element is given by Item::Description.id.resource. | |||
Item::Description.value | The value of the DAIS Item element. |
XML data example
<MeasurementModel>
<Measurement id="_100"> <label>M100</label> <description/> <Measurement.LimitSets>_200</Measurement.LimitSets> <MeasurementValue
id="_500">
<label>TM100</label><description/><MeasurementValue.value>30</MeasurementValue.value>
<MeasurementValue.MeasurementValueSource>_400 </MeasurementValue.MeasurementValueSource> </MeasurementValue>
</Measurement>
<LimitSet id="_200"><label>summer</label><description/><Limit id="_300">
<label>highalarm</label> <description/> <Limit.value>50</Limit.value>
</Limit>
<Limit id="_301"> <label>lowalarm</label> <description/> <Limit.value>-50</Limit.value>
</Limit> </LimitSet> <MeasurementValueSource id="_400">
<label>telemetry</label>
<description/>
</MeasurementValueSource>
</MeasurementModel>
The XML data example is based on the UML schema in Figure 4-3 on page 4-6 and the
mapping from Table 3-1.