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.15 describes the NodeTypeDescription parameters used in the example.

Table B.15 – Example 5 NodeTypeDescription

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.

image051.png

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.16 describes the elements, operators and operands used in the example.

Table B.16 – Example 5 ContentFilter

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.17.

Table B.17 – Example 5 QueryDataSets

NodeId

TypeDefinition

NodeId

RelativePath

Value

12:42 (HFamily1)

PersonType

“<12:HasChild>12:PersonType.12:LastName”

Hervey

NOTE The RelativePath column and browse name (in parentheses in the NodeId column) are not in the QueryDataSet and are only shown here for clarity. The TypeDefinition NodeId would be an integer not the symbolic name that is included in the table.