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.18 describes the NodeTypeDescription parameters used in the example.
Table B.18 – Example 6 NodeTypeDescription
Type Definition Node |
Include Subtypes |
QueryDataDescription |
Relative Path |
Attribute |
Index Range |
PersonType |
FALSE |
“.12:NodeId” |
value |
N/A |
<12:HasChild>12:PersonType<12:HasAnimal>12:AnimalType.NodeId |
value |
N/A |
<12:HasChild> |
value |
N/A |
<12:HasChild>12:PersonType<12:HasAnimal> |
value |
N/A |
The corresponding ContentFilter is illustrated in Figure B.10.
Figure B.10 – Example 6 filter logic tree
Table B.19 describes the elements, operators and operands used in the example.
Table B.19 – Example 6 ContentFilter
Element[] |
Operator |
Operand[0] |
Operand[1] |
Operand[2] |
Operand[3] |
0 |
RelatedTo |
AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId |
ElementOperand = 1 |
AttributeOperand = Node: 12:HasChild, BrowsePath “.”,Attribute:NodeId |
LiteralOperand = ‘1’ |
1 |
RelatedTo |
AttributeOperand = 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.20.
Table B.20 – Example 6 QueryDataSets
NodeId |
TypeDefinition NodeId |
RelativePath |
Value |
12:42 (HFamily1) |
PersonType |
“.NodeId” |
12:42 (HFamily1) |
<12:HasChild>12:PersonType<12:HasAnimal> 12:AnimalType.NodeId |
12:91 (Pig1) |
<12:HasChild> |
HasChild |
<12:HasChild>12:PersonType<12:HasAnimal> |
HasFarmAnimal |
12:48 (HFamily2) |
PersonType |
“.NodeId” |
12:48 (HFamily2) |
<12:HasChild>12:PersonType<12:HasAnimal> 12:AnimalType.NodeId |
12:91 (Pig1) |
<12:HasChild> |
HasChild |
<12:HasChild>12:PersonType<12:HasAnimal> |
HasPet |
NOTE The RelativePath and browse name (in parentheses) is not in the QueryDataSet and is only shown here for clarity and the TypeDefinition NodeId would be an integer, not the symbolic name that is included in the table. The value field would in this case be the NodeId where it was requested, but for the example the browse name is provided in parentheses and in the case of Reference types on the browse name is provided. For the References listed in Table B.20, the value would be a ReferenceDescription which are described in 7.30.
Table B.21 provides an example of the same QueryDataSet as shown in Table B.20 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.21 – Example 6 QueryDataSets without additional information
NodeId |
TypeDefinition NodeId |
Value |
12:42 |
PersonType |
12:42 |
12:91 |
[HasChild,TRUE,[48,HFamily2,HFamily2,PersonType]], |
[HasFarmAnimal,TRUE[91,Pig1,Pig1,PigType] |
12:48 |
PersonType |
12: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.