AUCQL logo
 
Using AUCQL's PROPERTY Operation
A Query Language for Semistructured Data with Metadata Properties
Home        
Publications   
Prototype  
Examples    
  The DB
  Start       
  Defaults
  Match
  Property
  Collapse
  Coalesce
  Security
  Time
 
Curtis Dyreson
  Home
  Publications
  Projects
  Software
  Demos
  Teaching
  Contact me

Syntax

The general form of a PROPERTY operation is given below.
PROPERTY(property, variable)
The PROPERTY operation extracts the value of the property for the single edge in the (collapsed) path represented by the variable. The path is implicitly collapsed prior to evaluating the PROPERTY if the user forgets to explicitly collapse the path.

A simple example

Let's start with a simple example to extract the transaction time of all the 'movie' edges emanating from a root.
Tell me about movie nodes and their transaction times.:
SELECT Movie, TT
FROM   MATCH(ROOTS, (NAME! movie)) Movie,
       PROPERTY(TRANSACTION_TIME, Movie) TT;

Not too exciting! What about finding out the transaction time, and security of all nodes?

The security and transaction time for all nodes.:
SELECT *
FROM   ()* All,
       PROPERTY(SECURITY, All) Security,
       PROPERTY(TRANSACTION_TIME, All) TT;

Note that the security property is '@' for all the nodes since none of the edges to a reached node has a security property. Recall that some of the nodes in the semistructure are inaccessible since they require the security to be matched (which we did not do in the query given above). Also, the transaction time for the '&movies' node is null since it is missing a transaction time.

Let's set the required security and rerun the query given above.

The security and transaction time for all nodes.:
SELECT *
FROM   (SECURITY: 'over 18, paid, subscriber')* All,
       PROPERTY(SECURITY, All) Security,
       PROPERTY(TRANSACTION_TIME, All) TT;

Note that the result repeats several nodes, such as `&wars_clip', since there are more than one path to some nodes. To determine the property value over all the paths to a node, we need to coalesce the property value over all the paths.

The extracted property can be subsequently used in WHERE clause expressions.

Which nodes are current in transaction time?:
SELECT *
FROM   (SECURITY: 'over 18, paid, subscriber')* All,
       PROPERTY(TRANSACTION_TIME, All) TT
WHERE TT OVERLAPS [now-now];


                                                                                                                                                                                                                                     
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 Valid HTML 4.01!