The seventh example provides an illustration a request in which a Clientwants to display part of the AddressSpacebased on a starting point that was obtained via browsing. This request includes listing Referencesas something that is to be returned. In this case the Person Browsed to Area2 and wanted to Queryfor information below this starting point.
Example 7: Get PersonType.NodeId, AnimalType.NodeId, PersonType.HasChild Reference, PersonType.HasAnimal Reference where the person is in Area2 (Cleveland nodes) and the person has a child.
Table B.22describes the NodeTypeDescription parameters used in the example.
Table B.22– Example 7 NodeTypeDescription
Type Definition Node |
Include Subtypes |
QueryDataDescription |
||
|
|
Relative Path |
Attribute |
Index Range |
PersonType |
FALSE |
“.NodeId” |
Value |
N/A |
|
|
<12:HasChild> |
Value |
N/A |
|
|
<12:HasAnimal>NodeId |
Value |
N/A |
|
|
<12:HasAnimal> |
Value |
N/A |
The corresponding ContentFilteris illustrated in Figure B.11. Note that the Browsecall would typically return a NodeId, thus the first filter is for the BaseObjectTypewith a NodeIdof 95 where 95 is the NodeIdassociated with the Area2 node, all Nodesdescend from BaseObjectType, and NodeIdis a base Propertyso this filter will work for all Queriesof this nature.
Figure B.11– Example 7 Filter Logic Tree
Table B.23describes the elements, operators and operands used in the example.
Table B.23– Example 7 ContentFilter
Element[] |
Operator |
Operand[0] |
Operand[1] |
Operand[2] |
Operand[3] |
0 |
RelatedTo |
ElementOperand = 2 |
ElementOperand = 1 |
AttributeOperand = Node:HierachicalReference, BrowsePath “.”, Attribute:NodeId |
LiteralOperand = ‘1’ |
1 |
RelatedTo |
AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId |
AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId |
AttributeOperand = NodeId: 12:HasChild, BrowsePath “.”, Attribute: NodeId |
LiteralOperand = ‘1’ |
2 |
Equals |
AttributeOperand = NodeId: BaseObjectType, BrowsePath “.”, Attribute: NodeId, |
LiteralOperand = ‘95 |
|
|
The results from this Querywould contain the QueryDataSetsshownin Table B.24.
Table B.24– Example 7 QueryDataSets
NodeId |
TypeDefinition NodeId |
RelativePath |
Value |
12:42 (HFamily1) |
PersonType |
“.NodeId” |
12:42 (HFamily1) |
|
|
<12:HasChild> |
HasChild ReferenceDescription |
|
|
<12:HasAnimal>12:AnimalType.NodeId |
NULL |
|
|
<12:HasAnimal> |
HasFarmAnimal ReferenceDescription |
12:48 (HFamily2) |
PersonType |
“.NodeId” |
12:48 (HFamily2) |
|
|
<12:HasChild> |
HasChild ReferenceDescription |
|
|
<12:HasAnimal>12:AnimalType.NodeId |
12:91 (Pig1) |
|
|
<12:HasAnimal> |
HasFarmAnimal ReferenceDescription |
NOTE The RelativePathand browse name (in parentheses) is not in the QueryDataSetand is only shown here for clarity and the TypeDefinition NodeIdwould be an integer not the symbolic name that is included in the table. The value field would in this case be the NodeIdwhere it was requested, but for the example the browse name is provided in parentheses and in the case of Referencetypes on the browse name is provided. For the Referenceslisted in Table B.24, the value would be a ReferenceDescription which are described in 7.25.