B.3.11 Example 8

The eighth example provides an illustration of a request in which the AddressSpace is restricted by a Server defined View. This request is the same as in the second example which illustrates receiving a list of disjoint Nodes and also illustrates that an array of results can be received. It is important to note that all of the parameters and the ContentFilter are 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 AddressSpace in View1.

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

Table B.32 – Example 8 NodeTypeDescription
Type Definition Node

Include

Subtypes

QueryDataDescription
Relative PathAttributeIndex Range
PersonType FALSE“.12:LastName”valueN/A
AnimalTypeTRUE“12.Name”valueN/A

The corresponding ContentFilter is illustrated in Figure B.12.

Figure B.12 – Example 8 filter logic tree

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

Table B.33 – Example 8 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0OrElementOperand=1ElementOperand = 2
1RelatedToAttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId

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

Attribute: NodeId

AttributeOperand = NodeId: 12:HasChild, BrowsePath “.”, Attribute: NodeIdLiteralOperand = ‘1’
2RelatedToAttributeOperand = NodeId: 12:CatType, BrowsePath “.”, Attribute: NodeId

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

Attribute: NodeId

AttributeOperand = NodeId: 12:HasSchedule, BrowsePath “.”, Attribute: NodeIdLiteralOperand = ‘1’

The results from this query would contain the QueryDataSets shown in Table B.34. If this is compared to the result set from example 2, the only difference is the omission of the Cat Nodes. These Nodes are not in the View and thus are not included in the result set.

Table B.34 – Example 8 QueryDataSets
NodeIdTypeDefinition NodeIdRelativePathValue
12:30 (Jfamily1)Persontype.12:LastNameJones