B.3.5 Example 2

The second example illustrates receiving a list of disjoint Nodes and also illustrates that an array of results can be received.

Example 2: Get PersonType.LastName, AnimalType.Name where a person has a child or (a pet is of type cat and has a feeding schedule).

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

Table B.13 – Example 2 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.6.

Figure B.6 – Example 2 filter logic tree

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

Table B.14 – Example 2 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0OrElementOperand=1ElementOperand = 2
1RelatedToAttributeOperand = NodeId: PersonType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: PersonType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: HasChild, BrowsePath “.”, Attribute: NodeIdLiteralOperand = ‘1’
2RelatedToAttributeOperand = NodeId: CatType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: FeedingScheduleType, BrowsePath “.”, Attribute: NodeIdAttributeOperand = NodeId: HasSchedule, BrowsePath “.”, Attribute: NodeIdLiteralOperand = ‘1’

The results from this query would contain the QueryDataSets shown in Table B.15.

Table B.15 – Example 2 QueryDataSets
NodeIdTypeDefinition NodeIdRelativePathValue
12:30 (Jfamily1)PersonType. 12:LastNameJones
12:42 (HFamily1)PersonType. 12:LastNameHervey
12:48 (HFamily2)PersonType. 12:LastNameHervey
12:70 (Cat1)CatType. 12:NameRosemary
12:74 (Cat2)CatType. 12:NameBasil