AUCQL logo
 
Using AUCQL's MATCH 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 MATCH is given below.
MATCH(variable, descriptor_regular_expression)
The match extends a path (represented by variable) to the edges that match the descriptor regular expression. The only difference between AUCQL and other semistructured query languages is that the descriptors are more complicated in AUCQL since they can involve several properties.

The NAME property

The NAME property represents the name of an edge. It is the most commonly used property in matching. Let's start with a simple example to find all the 'movie' edges from a root.
What nodes are reachable from a root via an edge named 'movie'?:
SELECT Movie
FROM   MATCH(ROOTS, (NAME! movie)) Movie;

Note that the NAME property is required to be present, so that the query does not match edges that lack a NAME property.

Now let's extend the paths to look for 'review' edges.

What reviews are reachable from movies?:
SELECT Movie, Review
FROM   MATCH(ROOTS, (NAME! movie)) Movie,
       MATCH(Movie, (NAME! review)) Review;

Alternatively, we could use the composition in a regular expression to do the MATCH.

What reviews are reachable from movies?:
SELECT Review
FROM   MATCH(ROOTS, (NAME! movie).(NAME! review)) Review;

The appropriate use of defaults makes this look more like a standard semistructured query.

What reviews are reachable from movies?:
SELECT Movie, Review
FROM   movie Movie,
       Movie.review Review;

Other properties

NAME is just one property in a more general property space. Any property could be used to match.
Find all the current Nodes:
SELECT *
FROM   (TRANSACTION_TIME: [now - now])* CurrentNodes;

Multiple Properties

Properties can also be combined in a descriptor.
Find the current movie reviews.:
SELECT Movie, Review
FROM   (NAME: movie, TRANSACTION_TIME: [now - now]) Movie,
       Movie.(NAME: review, TRANSACTION_TIME: [now - now]) Review;

Setting default properties is often the most useful way to combine properties.

Find the current movie reviews.:
SET DEFAULT PROPERTY (TRANSACTION_TIME: [now - now]);
SELECT Movie, Movie.review
FROM   movie Movie;


                                                                                                                                                                                                                                     
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!