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.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 ContentFilter is illustrated in Figure B.12.
Figure B.12 – Example 8 filter logic tree
Table B.26 describes 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 QueryDataSets shown 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 Nodes are not in the View and 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 NodeId column) are not in the QueryDataSet and are only shown here for clarity. The TypeDefinition NodeId would be an integer not the symbolic name that is included in the table.