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.
| Type Definition Node | Include Subtypes | QueryDataDescription | ||
|---|---|---|---|---|
| Relative Path | Attribute | Index Range | ||
| PersonType | FALSE | “.12:LastName” | value | N/A |
The corresponding ContentFilter is illustrated in Figure B.8.

Table B.20 describes the elements, operators and operands used in the example.
| Element[] | Operator | Operand[0] | Operand[1] | Operand[2] | Operand[3] |
|---|---|---|---|---|---|
| 0 | RelatedTo | AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId | Element Operand = 1 | AttributeOperand = NodeId: 12:HasChild, BrowsePath “.”, Attribute: NodeId | LiteralOperand = ‘2’ |
| 1 | RelatedTo | AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId | AttributeOperand = NodeId: 12:AnimalType, BrowsePath “.”, Attribute: NodeId | AttributeOperand = 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.
| NodeId | TypeDefinition NodeId | RelativePath | Value |
|---|---|---|---|
| 12:42 (HFamily1) | PersonType | “.12:LastName” | Hervey |