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.15describes 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 ContentFilteris illustrated in Figure B.9.

image051.png

Figure B.9– Example 5 filter logic tree

In this example, one Referenceto PersonType is aliased to “Parent” and another Referenceto PersonType is aliased to “Child”. The value of Parent.firstName and Child.firstName are then compared. Table B.16describes 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 QueryDataSetsshownin 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 NodeIdcolumn) are not in the QueryDataSetand are only shown here for clarity. The TypeDefinition NodeIdwould be an integer not the symbolic name that is included in the table.