Hino Criteria Queries

Content

  1. Hino Criteria Queries
    1. Content
    2. Introduction
    3. Hino Criteria Queries Concept
      1. Hino Criteria on a Hino Node
      2. Hino Criteria on Hino Node Property
    4. Hino Criteria Query Usage
      1. Hino Interface
      2. Hino Equinox Console
    5. Grammar
      1. Implemented Hino criteria queries
      2. Not implemented yet

Introduction

Hino (HIerarchical NOdes) data are structured hierarchically in nodes.
A Hino node has a unique node name (case sensitive) and a node identifier of type Long.
Each node may contain a set of properties (name,value).

For searching of specific nodes depending on node names, node identifiers or node property values Hino criteria queries can be used.
In the following chapters the structure Hino Criteria Queries Concept and the usage Hino Criteria Query Usage of criteria queries will be explained.

The last chapter contains the Hino criteria query grammar Grammar (implemented and not implemented part).

Hino Criteria Queries Concept

Hino criteria queries can be used to select subsets of nodes from Hino according to defined restrictions.
Restrictions on node paths and node properties are available.
Restrictions consist of expressions with common understanding of operations and operands.

How to define restrictions on node path is described in section Hino criteria on Hino node.
Definition of restrictions on node properties is described in section Hino criteria on Hino node property.

Hino Criteria on a Hino Node

A Hino node path consists of one or more node names or node identifiers separated by the delimiter '/'.
A node path can be absolute or relative.
An absolute node path starts with the node delimiter '/' while a relative node path starts with a node name or a node identifier.

A node identifier is a Long number enclosed in parenthesis, e.g. (123).

A Hino criteria on a Hino node path contains one or more node restrictions in the node path.
A node restriction is described as a node name containing one or more wildcards %.
To use the wildcard or the node delimiter as part of a node name, they must be masked by \ (e.g. Test\/slash, Test\%wildcard).
Result node paths can be used as operands in join and intersect operations.

Examples for node paths containing node restrictions:

Each of following criteria queries provides a set of node identifiers.

Hino Criteria on Hino Node Property

Node properties can be queried by defining node property restrictions attached to some node identifiers or node names.
The node property restriction syntax is based upon of OSGi filter specification defined in "OSGi Service PlatformCore Specification".
Restrictions may be combined by one or more joined or negated property value restrictions.
Actually implemented operators are = and like.

The wildcard % can be used as part of any property value.
In this point Hino criteria query definition differs from OSGi specification whereby OSGi defines * as wildcard.

Examples for node paths containing node property restrictions:

Each of following criteria queries provides a set of node identifiers.

Hino Criteria Query Usage

There are two ways to evaluate Hino criteria queries, either by Hino interface or by Hino equinox console.
In both cases current Hino node is used as root node for relative paths in queries.

Hino Interface

Hino interface provides the method evaluates(String hinoCriteriaQuery).
The method result is a set of node identifiers of nodes which satisfy given Hino criteria query.

Hino Equinox Console

The Hino equinox console provides the rhci command for interpreting Hino criteria queries:

rhci hinoCriteriaQuery

In addition to the features of the Hino criteria queries the rhci command provides a flag to count the number of elements in the result set.

Examples for rhci usage:

Grammar

Implemented Hino criteria queries

hino-criteria ::= node-restriction
node-restriction ::= '(' node-restriction-comp ')'
node-restriction-comp ::= intersect | join | node-path-restriction
intersect ::= '&' node-restriction-list
join ::= '|' node-restriction-list
node-restriction-list ::= node-restriction | node-restriction node-restriction-list

node-path-restriction ::= node-path | node-path node-restriction
node-path ::= node-seg | '/' node-seg
node-seg ::= node | node '/' node-seg

node-restriction ::= ':' restriction
node ::= node-id | node-name | node-name-restriction

restriction ::= '(' restriction-comp ')'
restriction-comp ::= and | not | operation
and ::= '&' restriction-list
not ::= '!' restriction
restriction-list ::= restriction | restriction restriction-list
operation ::= simple
simple ::= prop-name restriction-type value

restriction-type ::= equal | like
equal ::= '='
like ::= 'like'

Not implemented yet

restriction-comp ::= or
or ::= '|' restriction-list
operation ::= present
present ::= prop-name '=*'
restriction-type ::= greater | less
greater ::= '>='
less ::= '<='

node-path-restriction ::= node-path node-restriction node-path-restriction