This section provides an overview of the Aalborg University College Query Language (AUCQL).
The Importance of VariablesThe key to understanding AUCQL is to understand the use of variables. Variables are established in the FROM clause. The FROM clause is essentially just a list of variable assignments. The value assigned to each variable is the result of one of AUCQL's operations: MATCH, NODES, COLLAPSE, SLICE, PROPERTY, or COALESCE.
MATCHThe MATCH operation matches a regular expression to the labels along a path. It is a common semistructured operation, but is typically an implicit operation. Let's start with a simple example that you can edit and/or submit directly to AUCQL's query engine.
There are actually two movie nodes in the database that match the name property. However, there is a required security property on one of those edges (to Color of Night). This prevents the edge from being matched (because the appropriate security was not given in the query, please see the security examples).
Let's extend the query with an appropriate level of security (note that in general, the security property is an encrypted string!).
Regular expressionsA regular expression is permitted in a MATCH operation. This regular expression is built using the usual rules for regular expressions. The following query uses a Kleene closure (the '*' operator).
Default MATCH operationBecause a MATCH(ROOTS, ...) operation is so common, it is the default operation if an operation is not specified. Here is the same query as that listed above.
Extending the paths from a variable in a MATCHThe MATCH operation can extend a path from a previous reached node. The first argument is the node to from which to start matching. Frequently, this node is specified by the variable ROOTS; ROOTS represents the roots of the semistructure. In general, any previously assigned variable can be used.
Since extending previously matched paths will be common, AUCQL has some useful syntactic sugar. A regular expression of the form
Variable.regExp Xvariableis interpreted as follows.
MATCH(Variable, regExp) XvariableSo the query given above can be rewritten more concisely as follows.
Where clauseIn the previous example there were many null values. We can eliminate the nulls in the WHERE clause as follows.
NextContinue with the next example to find out more about AUCQL.
Curtis E. Dyreson, Michael H. Böhlen, and Christian S. Jensen © 1998-2000. All rights reserved.
|E-mail questions or comments to Curtis.Dyreson at usu.edu|