ADL_query_translator modules/paradigms/Adaptor_DirectQualification.py

modules / paradigms / Adaptor_DirectQualification.py 


 SYNOPSIS

     Adaptor_DirectQualification (fieldColumn, paradigm)

         fieldColumn
             The column that contains field URIs (i.e., the column to
             constrain), e.g., "field_uri".

         paradigm
             The underlying paradigm.

 DESCRIPTION

     An adaptor that adds support for field-level searching to a
     paradigm (the "underlying" paradigm) by adding a condition to
     each SELECT statement returned by the paradigm.

     The underlying paradigm must return, given an appropriate atomic
     bucket-level constraint, a Select object that queries exactly
     one main table, i.e., a SELECT statement of the form:

         SELECT idColumn FROM mainTable, ...
             WHERE condition

     This adaptor passes constraints through to the underlying
     paradigm; the paradigm should treat all constraints as being
     bucket-level.  The translations of bucket-level constraints are
     returned unmodified.  But given a field-level constraint, this
     adaptor adds a condition to the returned SELECT statement's
     WHERE clause:

         SELECT idColumn FROM mainTable, ...
             WHERE fieldColumn = 'F.uri' AND condition

     where F.uri is the URI of the field mentioned in the constraint.

     Thus this adaptor is useful in situations in which a table
     stores multiple values (in multiple rows) per collection item
     and the values are directly qualified by field URI.  The
     underlying paradigm should generally indicate that the
     cardinality of the main table is isMany().

     Exceptions thrown:

         none

 AUTHOR

     Greg Janee
     gjanee@alexandria.ucsb.edu

 HISTORY

     $Log: Adaptor_DirectQualification.py,v $
     Revision 1.2  2003/10/28 21:53:08  gjanee
     Per revision 1.8 of UniversalTranslator.py, this paradigm now
     invokes field-level methods of the underlying paradigm if the
     latter supports field-level searching.

     Revision 1.1  2002/10/16 22:37:15  gjanee
     Initial revision
Imported Modules   

import UniversalTranslator
import edu.ucsb.adl.middleware
import types

Classes   

Adaptor_DirectQualification


This document was automatically generated Thu Mar 4 12:45:23 2004 by HappyDoc version WORKING