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.

Table B.22 – Example 5 NodeTypeDescription
Type Definition Node

Include

Subtypes

QueryDataDescription
Relative Path Attribute Index Range
PersonTypeFALSE“<12:HasChild>12:PersonType. 12:LastName”ValueN/A

The corresponding ContentFilter is illustrated in Figure B.9.

Figure B.9 – Example 5 filter logic tree

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.

Table B.23 – Example 5 ContentFilter
Element[]OperatorOperand[0]Operand[1]Operand[2]Operand[3}
0AndElementOperand = 1ElementOperand = 2
1RelatedTo

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”
2Equals

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.

Table B.24 – Example 5 QueryDataSets
NodeId

TypeDefinition

NodeId

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