ADL_query_translator modules/paradigms/Hierarchical_Constant.py

modules / paradigms / Hierarchical_Constant.py 


 SYNOPSIS

     Hierarchical_Constant (table, idColumn, vocabulary, terms, cardinality)
     Hierarchical_Constant (table, idColumn, termDictionary, cardinality)

         table
             A table to query, e.g., "holding".

         idColumn
             The table's object identifier column (i.e., the column
             to be selected), e.g., "holding_id".

         vocabulary
             The (single) vocabulary from which terms are drawn,
             e.g., "ADL Object Type Thesaurus".

         terms
             A list of zero or more terms, e.g., ["images",
             "photographs", "aerial photographs"].

         termDictionary
             A dictionary that maps one or more vocabulary names
             (e.g., "ADL Object Type Thesaurus") to lists of
             vocabulary terms.

         cardinality
             A Cardinality object representing the cardinality of
             'table'.  Should be Cardinality("1") or
             Cardinality("1?").

 DESCRIPTION

     Translates a hierarchical constraint to a constant TRUE or FALSE
     depending on whether the constraint term matches one of a
     constant set of terms.

     A constraint that matches a term in 'terms' or 'termDictionary'
     results in the query

         SELECT idColumn FROM table
             WHERE 1 = 1

     being returned.  Otherwise, the query

         SELECT idColumn FROM table
             WHERE 1 = 0

     is returned.

     This paradigm does *not* use the translator's vocabulary
     interface (i.e., the 'vocabularies' argument) to locate the
     constraint vocabulary.

     Exceptions thrown:

         unsupported vocabulary for bucket

 AUTHOR

     Greg Janee
     gjanee@alexandria.ucsb.edu

 HISTORY

     $Log: Hierarchical_Constant.py,v $
     Revision 1.2  2003/10/30 00:56:57  gjanee
     Added support for multiple vocabularies.  Added the
     'termDictionary' argument.

     Revision 1.1  2003/02/05 17:04:23  gjanee
     Initial revision
Imported Modules   

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

Classes   

Hierarchical_Constant


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