The eighth example provides an illustration of a request in which the AddressSpaceis restricted by a Serverdefined View. This request is the same as in the second example which illustrates receiving a list of disjoint Nodesand also illustrates that an array of results can be received. It is importantto note that all of the parameters and the ContentFilterare the same, only the View description would be specified as “View1”.

Example 8: Get PersonType.LastName, AnimalType.Name where a person has a child or (a pet is of type cat and has a feeding schedule) limited by the AddressSpacein View1.

The NodeTypeDescription parameters used in the example are described in Table B.25

Table B.25– Example 8 NodeTypeDescription

Type Definition Node

Include

Subtypes

QueryDataDescription

Relative Path

Attribute

Index Range

PersonType

FALSE

“.12:LastName”

value

N/A

AnimalType

TRUE

“12.Name”

value

N/A

The corresponding ContentFilteris illustrated in Figure B.12.

image054.png

Figure B.12– Example 8 Filter Logic Tree

Table B.26describes the elements, operators and operands used in the example. It is worth noting that a CatType is a subtype of AnimalType.

Table B.26– Example 8 ContentFilter

Element[]

Operator

Operand[0]

Operand[1]

Operand[2]

Operand[3]

0

Or

ElementOperand=1

ElementOperand = 2

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

RelatedTo

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

AttributeOperand = NodeId: 12:FeedingScheduleType, BrowsePath “.”,

Attribute: NodeId

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

LiteralOperand = ‘1’

The results from this query would contain the QueryDataSetsshown in Table B.27. If this is compared to the result set from example 2, the only difference is the omission of the Cat Nodes. These Nodesare not in the Viewand thus are not included in the result set.

Table B.27– Example 8 QueryDataSets

NodeId

TypeDefinition NodeId

RelativePath

Value

12:30 (Jfamily1)

Persontype

.12:LastName

Jones

NOTE The RelativePath column and browse name (in parentheses in the NodeIdcolumn) are not in the QueryDataSetand are only shown here for clarity. The TypeDefinition NodeId would be an integer not the symbolic name that is included in the table.