B.3.8 Example 5
The fifth example provides an illustration of the use of alias.
Example 5: Get the last names of children that have the same first name as a parent of theirs
Table B.22 describes the NodeTypeDescription parameters used in the example.
| Type Definition Node | Include Subtypes | QueryDataDescription | ||
| Relative Path | Attribute | Index Range | ||
| PersonType | FALSE | “<12:HasChild>12:PersonType. 12:LastName” | Value | N/A |
The corresponding ContentFilter is illustrated in Figure B.9.

In this example, one Reference to PersonType is aliased to “Parent” and another Reference to PersonType is aliased to “Child”. The value of Parent.firstName and Child.firstName are then compared. Table B.23 describes the elements, operators and operands used in the example.
| Element[] | Operator | Operand[0] | Operand[1] | Operand[2] | Operand[3} |
|---|---|---|---|---|---|
| 0 | And | ElementOperand = 1 | ElementOperand = 2 | ||
| 1 | RelatedTo | AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId, Alias: “Parent” | AttributeOperand = NodeId: 12:PersonType, BrowsePath “.”, Attribute: NodeId, Alias: “Child” | AttributeOperand = NodeId: 12:HasChild, Attribute: NodeId | LiteralOperand = “1” |
| 2 | Equals | AttributeOperand = NodeId: 12:PersonType, BrowsePath “/12:FirstName”, Attribute: Value, Alias: “Parent” | AttributeOperand = NodeId: 12:PersonType, BrowsePath “/12:FirstName”, Attribute: Value, Alias: “Child” |
The results from this query would contain the QueryDataSets shown in Table B.24.
| NodeId | TypeDefinition NodeId | RelativePath | Value |
|---|---|---|---|
| 12:42 (HFamily1) | PersonType | “<12:HasChild>12:PersonType.12:LastName” | Hervey |