B.3.7 Example 4

The fourth example provides an illustration of the Hop parameter that is part of the RelatedTo Operator.

Example 4: Get PersonType.LastName where a person has a child who has a child who has a pet.

Table B.19 describes the NodeTypeDescription parameters used in the example.

Table B.19 – Example 4 NodeTypeDescription
Type Definition Node

Include

Subtypes

QueryDataDescription
Relative PathAttributeIndex Range
PersonTypeFALSE“.12:LastName”valueN/A

The corresponding ContentFilter is illustrated in Figure B.8.

Figure B.8 – Example 4 filter logic tree

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

Table B.20 – Example 4 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3]
0RelatedTo

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

Attribute: NodeId

Element Operand = 1AttributeOperand = NodeId: 12:HasChild, BrowsePath “.”, Attribute: NodeId LiteralOperand = ‘2’
1RelatedTo

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

Attribute: NodeId

AttributeOperand = NodeId: 12:AnimalType, BrowsePath “.”, Attribute: NodeIdAttributeOperand = NodeId: 12:HasPet, BrowsePath “.”, Attribute: NodeId LiteralOperand = ‘1’

The results from this query would contain the QueryDataSets shown in Table B.21. It is worth noting that the pig “Pig1” is referenced as a pet by Sara, but is referenced as a farm animal by Sara’s parent Paul.

Table B.21 – Example 4 QueryDataSets
NodeId

TypeDefinition

NodeId

RelativePathValue
12:42 (HFamily1)PersonType“.12:LastName” Hervey