B.3.10 Example 7

The seventh example provides an illustration a request in which a Client wants to display part of the AddressSpace based on a starting point that was obtained via browsing. This request includes listing References as something that is to be returned. In this case the Person Browsed to Area2 and wanted to Query for 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.29 describes the NodeTypeDescription parameters used in the example.

Table B.29 – Example 7 NodeTypeDescription
Type Definition Node

Include

Subtypes

QueryDataDescription
Relative PathAttributeIndex Range
PersonTypeFALSE“.NodeId”ValueN/A
<12:HasChild>ValueN/A
<12:HasAnimal>NodeIdValueN/A
<12:HasAnimal>ValueN/A

The corresponding ContentFilter is illustrated in Figure B.11. Note that the Browse call would typically return a NodeId, thus the first filter is for the BaseObjectType with a NodeId of 95 where 95 is the NodeId associated with the Area2 node, all Nodes descend from BaseObjectType, and NodeId is a base Property so this filter will work for all Queries of this nature.

Figure B.11 – Example 7 filter logic tree

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

Table B.30 – Example 7 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0RelatedToElementOperand = 2 ElementOperand = 1AttributeOperand = Node:HierachicalReference, BrowsePath “.”, Attribute:NodeId LiteralOperand = ‘1’
1RelatedTo

AttributeOperand =

NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId

AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId

AttributeOperand =

NodeId: 12:HasChild, BrowsePath “.”,

Attribute: NodeId

LiteralOperand = ‘1’
2Equals

AttributeOperand =

NodeId: BaseObjectType, BrowsePath “.”,

Attribute: NodeId,

LiteralOperand = ‘95

The results from this Query would contain the QueryDataSets shown in Table B.31.

Table B.31 – Example 7 QueryDataSets
NodeId

TypeDefinition

NodeId

RelativePathValue
12:42 (HFamily1)PersonType“.NodeId” 12:42 (HFamily1)
<12:HasChild>HasChild ReferenceDescription
<12:HasAnimal>12:AnimalType.NodeIdNULL
<12:HasAnimal>HasFarmAnimal ReferenceDescription
12:48 (HFamily2)PersonType“.NodeId” 12:48 (HFamily2)
<12:HasChild>HasChild ReferenceDescription
<12:HasAnimal>12:AnimalType.NodeId12:91 (Pig1)
<12:HasAnimal>HasFarmAnimal ReferenceDescription