AUCQL logo
 
AUCQL Transaction Time Examples
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

Transaction time records when a datum is actually stored in a database, that is, it is the time between when the datum was inserted and when it was deleted. In our data model, edges can have transaction-time properties that record the lifetime of the edge in the database.

In the movie database, the transaction-time lifetime is missing from many of the edges. Please examine the sequence of transactions that created the movie database.

Legal paths

To understand the important role of transaction time, let's start with a simple query that does not explicitly mention transaction time at all! (Note that we are setting the security to reach all the nodes in the database.)
What are the names of the movie stars?:
SET DEFAULT PROPERTY (security: 'paid, subscriber, over 18');
SELECT Name
FROM   movie.stars.name Name;

The query result is duplicated below.
Name
Bruce Willis
Bruce Wilis
Bruce Willis

There are two similar names in the three result tuples. This is because Bruce's name was originally misspelled and was then corrected in the database. The corrected name appears twice because there are two separate valid paths to his name. The curious thing about the result is that Bruce Willis is reachable twice and Bruce Wilis only once.

Let's try to figure out how each is reached by looking at the nodes on the paths to these names.

What are the names of the movie stars?:
SET DEFAULT PROPERTY (security: 'paid, subscriber, over 18');
SELECT *
FROM   movie Movie,
       Movie.stars Stars, 
       Stars.name Name,
       PROPERTY(NAME, Name) Paths;

The query result is duplicated below.

Movie Stars Name Paths
&Star_Wars_IV &Willis Bruce Willis movie.stars.name
&Color_of_Night &Willis Bruce Wilis movie.stars.name
&Color_of_Night &Willis Bruce Willis movie.stars.name
Interesting, but why isn't there a path from &Star_Wars_IV to Bruce Wilis?

If we look at the transaction times along the paths all will become clear.

What are the names of the movie stars?:
SET DEFAULT PROPERTY (security: 'paid, subscriber, over 18');
SELECT *
FROM   movie Movie,
       PROPERTY(TRANSACTION_TIME, movie) MovieTT,
       Movie.stars Stars,
       PROPERTY(TRANSACTION_TIME, Stars) StarsTT,
       Stars.name Name,
       PROPERTY(TRANSACTION_TIME, Name) NameTT,
       PROPERTY(NAME, Name) Paths;

Let's look at the transaction time, and the coalesced transaction time, for each name.

What are the names and transaction times of the movie stars?:
SET DEFAULT PROPERTY (security: 'paid, subscriber, over 18');
SELECT *
FROM   movie.stars.name Name,
       PROPERTY(TRANSACTION_TIME, Name) TT,
       COALESCE(TRANSACTION_TIME, Name) CoalescedTT;

To get the current names, we can slice at now.

What are the names of current movie stars?:
SET DEFAULT PROPERTY (security: 'paid, subscriber, over 18');
SELECT CurrentName, CoalescedTT
FROM   movie.stars.name Name,
       SLICE((TRANSACTION_TIME! [now - now]), Name) CurrentName,
       COALESCE(TRANSACTION_TIME, CurrentName) CoalescedTT
WHERE  NONNULL(CurrentName);


                                                                                                                                                                                                                                     
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!