Annex B (informative) Content Filter and Query Examples ToC Previous

B.2 Complex Examples of Query Filters ToC Previous

B.2.4 Example 1 ToC Previous Next

This example requests a simple layered filter, a person has a pet and the pet has a schedule.

Example 1: Get PersonType.LastName, AnimalType.Name, ScheduleType.Period where the Person Has a Pet and that Pet Has a Schedule.

The NodeTypeDescription parameters used in the example are described in Table B.3.

Table B.3 – Example 1 NodeTypeDescription

Type Definition Node Include
Subtypes
QueryDataDescription    
    Relative Path Attribute Index Range
PersonType FALSE “.12:LastName” value N/A
    “<12:HasPet>12:AnimalType. 12:Name” value N/A
    “<12:HasPet>12:AnimalType<12:HasSchedule> 12:Schedule. 12:Period” value N/A

The corresponding ContentFilter is illustrated in Figure B.5.

readme_files/image046.png Figure B.5 – Example 1 Filter

Table B.4 describes the ContentFilter elements, operators and operands used in the example.

Table B.4 – Example 1 ContentFilter

Element[] Operator Operand[0] Operand[1] Operand[2] Operand[3]
1 RelatedTo_15 AttributeOperand = NodeId: PersonType,
BrowsePath “.”, Attribute: NodeId
ElementOperand = 2 AttributeOperand = NodeId: HasPet, BrowsePath “.”, Attribute: NodeId LiteralOperand = ‘1’
2 RelatedTo_15 AttributeOperand = NodeId: AnimalType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: ScheduleType, BrowsePath “.”, Attribute: NodeId AttributeOperand = NodeId: HasSchedule, BrowsePath “.”, Attribute: NodeId LiteralOperand= ‘1’

Table B.5 describes the QueryDataSet that results from this query if it were executed against the instances described in Figure B.4

Table B.5 – Example 1 QueryDataSets

NodeId TypeDefinition
NodeId
RelativePath Value
12:30 (JFamily1) PersonType “.12:LastName” Jones
    “<12:HasPet>12:AnimalType. 12:Name” Rosemary
      Basil
    “<12:HasPet>12:AnimalType<12:HasSchedule> 12:Schedule.12:Period” Hourly
      Daily
12:42(HFamily1) PersonType “.12:LastName” Hervey
    “<12:HasPet>12:AnimalType. 12:Name” Oliver
    “<12:HasPet>12:AnimalType<12:HasSchedule> 12:Schedule.12:Period” Daily

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.

The Value column is returned as an array for each Node description, where the order of the items in the array would correspond to the order of the items that were requested for the given Node Type. In Addition, if a single Attribute has multiple values then it would be returned as an array within the larger array, for example in this table Rosemary and Basil would be returned in a array for the .<HasPet>.AnimalType.Name item. They are show as separate rows for ease of viewing. The actual value array for JFamily1 would be (“Jones”, {“RoseMary”, ”Basil”}, {“Hourly”, “Daily”})

Previous Next