B.3.9 Example 6

The sixth example provides an illustration a different type of request, one in which the Client is interested in displaying part of the AddressSpace of the Server. This request includes listing a Reference as something that is to be returned.

Example 6: Get PersonType.NodeId, AnimalType.NodeId, PersonType.HasChild Reference, PersonType.HasAnimal Reference where a person has a child who has a Animal.

Table B.25 describes the NodeTypeDescription parameters used in the example.

Table B.25 – Example 6 NodeTypeDescription
Type Definition Node

Include

Subtypes

QueryDataDescription
Relative PathAttributeIndex Range
PersonTypeFALSE“.12:NodeId”valueN/A
<12:HasChild>12:PersonType<12:HasAnimal>12:AnimalType.NodeIdvalueN/A
<12:HasChild>valueN/A
<12:HasChild>12:PersonType<12:HasAnimal>valueN/A

The corresponding ContentFilter is illustrated in Figure B.10.

Figure B.10 – Example 6 filter logic tree

Table B.26 describes the elements, operators and operands used in the example.

Table B.26 – Example 6 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0RelatedToAttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId ElementOperand = 1AttributeOperand = Node: 12:HasChild, BrowsePath “.”,Attribute:NodeId LiteralOperand = ‘1’
1RelatedToAttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: 12:AnimalType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: 12:HasAnimal, BrowsePath “.”, Attribute: NodeId LiteralOperand = ‘1’

The results from this query would contain the QueryDataSets shown in Table B.27.

Table B.27 – Example 6 QueryDataSets
NodeId

TypeDefinition

NodeId

RelativePathValue
12:42 (HFamily1)PersonType“.NodeId” 12:42 (HFamily1)

<12:HasChild>12:PersonType<12:HasAnimal>

12:AnimalType.NodeId

12:91 (Pig1)
<12:HasChild>

HasChild

ReferenceDescription

<12:HasChild>12:PersonType<12:HasAnimal>

HasFarmAnimal

ReferenceDescription

12:48 (HFamily2)PersonType“.NodeId” 12:48 (HFamily2)

<12:HasChild>12:PersonType<12:HasAnimal>

12:AnimalType.NodeId

12:91 (Pig1)
<12:HasChild>

HasChild

ReferenceDescription

<12:HasChild>12:PersonType<12:HasAnimal>

HasPet

ReferenceDescription

Table B.28 provides an example of the same QueryDataSet as shown in Table B.27 without any additional fields and minimal symbolic Ids. There is an entry for each requested Attribute, in the cases where an Attribute would return multiple entries the entries are separated by comas. If a structure is being returned then the structure is enclosed in square brackets. In the case of a ReferenceDescription the structure contains a structure and DisplayName and BrowseName are assumed to be the same and defined in Figure B.4.

Table B.28 – Example 6 QueryDataSets without additional information
NodeId

TypeDefinition

NodeId

Value
12:42 PersonType12:42
12:91
[HasChild,TRUE,[48,HFamily2,HFamily2,PersonType]],
[HasFarmAnimal,TRUE[91,Pig1,Pig1,PigType]
12:48 PersonType12:54
12:91
[HasChild,TRUE,[ 54,HFamily3,HFamily3,PersonType]]
[HasPet, TRUE,[ 91,Pig1,Pig1,PigType]]

The PersonType, HasChild, PigType, HasPet, HasFarmAnimal identifiers used in the above table would be translated to actual ExpandedNodeId.