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

The COALESCE operation extracts and coalesces the value of a property that is distributed over a number of individual paths.

Syntax

The general form of a COALESCE is given below.
COALESCE(property, variable)
The COALESCE operation extracts and coalesces the value of the property for the set of paths that connect two nodes in the (collapsed) paths represented by the variable.

The paths are implicitly collapsed prior to evaluating the COALESCE if the user forgets to explicitly collapse the path.

Extracting the TRANSACTION TIME

Let's start with a simple example to extract the transaction time all the 'movie' edges to a star name.
Get movie stars and their transaction times.:
SET DEFAULT PROPERTY(SECURITY: 'over 18, paid, subscriber');
SELECT *
FROM   movie.stars.name Stars,
       PROPERTY(TRANSACTION_TIME, Stars) TT;

The interesting feature about the result is that the Bruce Willis node appears twice. This is because there are two paths to that node, and each has a different transaction time. (Bruce Wilis, note the spelling, also appears once).

Coalescing the TRANSACTION TIME

Coalescing computes the transaction time over all possible paths. Let's do the same query as above, except this time we will coalesce the transaction time rather than just extracting it.
Tell me about movie stars and their transaction times.:
SET DEFAULT PROPERTY(SECURITY: 'over 18, paid, subscriber');
SELECT *
FROM   movie.stars.name Stars,
       PROPERTY(TRANSACTION_TIME, Stars) TT,
       COALESCE(TRANSACTION_TIME, Stars) CoalescedTT;

The result illustrates the difference between the coalesced transaction time and the extracted transaction time.

Coalescing other properties

Any property can be coalesced.
The coalesced names, security, and transaction time of all nodes.:
SET DEFAULT PROPERTY(SECURITY: 'over 18, paid, subscriber');
SELECT *
FROM   ()* All,
       COALESCE(NAME, All) Name,
       COALESCE(SECURITY, All) Security,
       COALESCE(TRANSACTION_TIME, All) TT;


                                                                                                                                                                                                                                     
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!