r4959: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 16 May 2003 03:10:18 +0000 (03:10 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 16 May 2003 03:10:18 +0000 (03:10 +0000)
debian/changelog
sql-classes.lisp

index a72f185b9292e87e4025e55c0b3a8153fb59023d..141f6b07a07e64110f563358960fa5a81a245052 100644 (file)
@@ -1,4 +1,4 @@
-cl-umlisp (3.2.1-1) unstable; urgency=low
+cl-umlisp (3.2.2-1) unstable; urgency=low
 
   * New upstream
 
index cfbf11dc774d88bc6e68ca433cc46ce27dee0b69..02182f67a0c6fe126df92a0f19cdc86d968a56b4 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: sql-classes.lisp,v 1.81 2003/05/15 19:50:08 kevin Exp $
+;;;; $Id: sql-classes.lisp,v 1.82 2003/05/16 03:10:18 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
@@ -93,7 +93,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
      :lrl ,lrl :single ,single :distinct ,distinct :order ,order :like ,like)))
 
 ;; only WHERE-VALUE and SRL are evaluated
-(defmacro with-umlisp-query ((table fields srl where-name where-value
+(defmacro collect-umlisp-query ((table fields srl where-name where-value
                                    &key (lrl "KCUILRL") distinct single
                                    order like)
                             &body body)
@@ -124,7 +124,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
                               :order ,order :like ,like)
               collect (destructuring-bind ,fields tuple ,@body))))))
 
-(defmacro with-umlisp-query-eval ((table fields srl where-name where-value
+(defmacro collect-umlisp-query-eval ((table fields srl where-name where-value
                                         &key (lrl "KCUILRL") distinct single
                                         order like)
                                  &body body)
@@ -185,27 +185,27 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ucon-cui (cui &key (srl *current-srl*))
   "Find ucon for a cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrcon (kpfstr kcuilrl) srl cui cui :single t)
+  (collect-umlisp-query (mrcon (kpfstr kcuilrl) srl cui cui :single t)
     (make-instance 'ucon :cui cui :pfstr kpfstr
                   :lrl (ensure-integer kcuilrl))))
 
 (defun find-ucon-cui-sans-pfstr (cui &key (srl *current-srl*))
   "Find ucon for a cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrcon (kcuilrl) srl cui cui :single t)
+  (collect-umlisp-query (mrcon (kcuilrl) srl cui cui :single t)
     (make-instance 'ucon :cui cui :lrl (ensure-integer kcuilrl)
                   :pfstr nil)))
 
 (defun find-pfstr-cui (cui &key (srl *current-srl*))
   "Find preferred string for a cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrcon (kpfstr) srl cui cui :single t)
+  (collect-umlisp-query (mrcon (kpfstr) srl cui cui :single t)
     kpfstr))
 
 (defun find-ucon-lui (lui &key (srl *current-srl*))
   "Find list of ucon for lui"
   (ensure-lui-integer lui)
-  (with-umlisp-query (mrcon (cui kpfstr kcuilrl) srl lui lui
+  (collect-umlisp-query (mrcon (cui kpfstr kcuilrl) srl lui lui
                            :distinct t)
     (make-instance 'ucon :cui (ensure-integer cui) :pfstr kpfstr
                   :lrl (ensure-integer kcuilrl))))
@@ -213,7 +213,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ucon-sui (sui &key (srl *current-srl*))
   "Find list of ucon for sui"
   (ensure-sui-integer sui)
-  (with-umlisp-query (mrcon (cui kpfstr kcuilrl) srl sui sui :distinct t)
+  (collect-umlisp-query (mrcon (cui kpfstr kcuilrl) srl sui sui :distinct t)
     (make-instance 'ucon :cui (ensure-integer cui) :pfstr kpfstr
                   :lrl (ensure-integer kcuilrl))))
 
@@ -222,7 +222,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   (ensure-cui-integer cui)
   (ensure-sui-integer sui)
   (when (and cui sui)
-    (with-umlisp-query (mrcon (kpfstr kcuilrl) srl kcuisui
+    (collect-umlisp-query (mrcon (kpfstr kcuilrl) srl kcuisui
                              (make-cuisui cui sui))
       (make-instance 'ucon :cui cui
                     :pfstr kpfstr
@@ -230,7 +230,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 
 (defun find-ucon-str (str &key (srl *current-srl*))
   "Find ucon that are exact match for str"
-  (with-umlisp-query (mrcon (cui kpfstr kcuilrl) srl str str :distinct t)
+  (collect-umlisp-query (mrcon (cui kpfstr kcuilrl) srl str str :distinct t)
     (make-instance 'ucon :cui (ensure-integer cui) :pfstr kpfstr
                   :lrl (ensure-integer kcuilrl))))
 
@@ -249,7 +249,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 
 (defun find-ucon-all2 (&key (srl *current-srl*))
   "Return list of all ucon's"
-  (with-umlisp-query (mrcon (cui kpfstr kcuilrl) srl nil nil :order (cui asc)
+  (collect-umlisp-query (mrcon (cui kpfstr kcuilrl) srl nil nil :order (cui asc)
                            :distinct t)
     (make-instance 'ucon :cui (ensure-integer cui)
                   :pfstr kpfstr
@@ -273,25 +273,25 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-udef-cui (cui &key (srl *current-srl*))
   "Return a list of udefs for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrdef (sab def) srl cui cui :lrl "KSRL")
+  (collect-umlisp-query (mrdef (sab def) srl cui cui :lrl "KSRL")
     (make-instance 'udef :sab sab :def def)))
 
 (defun find-usty-cui (cui &key (srl *current-srl*))
   "Return a list of usty for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrsty (tui sty) srl cui cui :lrl "KLRL")
+  (collect-umlisp-query (mrsty (tui sty) srl cui cui :lrl "KLRL")
     (make-instance 'usty :tui (ensure-integer tui) :sty sty)))
 
 (defun find-usty-word (word &key (srl *current-srl*))
   "Return a list of usty that match word"
-  (with-umlisp-query (mrsty (tui sty) srl sty word :lrl klrl :like t
+  (collect-umlisp-query (mrsty (tui sty) srl sty word :lrl klrl :like t
                            :distinct t)
     (make-instance 'usty :tui (ensure-integer tui) :sty sty)))
 
 (defun find-urel-cui (cui &key (srl *current-srl*))
   "Return a list of urel for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrrel (rel cui2 rela sab sl mg kpfstr2) srl cui1
+  (collect-umlisp-query (mrrel (rel cui2 rela sab sl mg kpfstr2) srl cui1
                            cui :lrl "KSRL")
     (make-instance 'urel :cui1 cui :rel rel
                   :cui2 (ensure-integer cui2) :rela rela :sab sab :sl sl
@@ -300,7 +300,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-urel-cui2 (cui2 &key (srl *current-srl*))
   "Return a list of urel for cui2"
   (ensure-cui-integer cui2)
-  (with-umlisp-query (mrrel (rel cui1 rela sab sl mg kpfstr2) srl cui2
+  (collect-umlisp-query (mrrel (rel cui1 rela sab sl mg kpfstr2) srl cui2
                            cui2 :lrl "KSRL")
     (make-instance 'urel :cui2 cui2 :rel rel
                   :cui1 (ensure-integer cui1) :rela rela :sab sab :sl sl
@@ -315,7 +315,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ucoc-cui (cui &key (srl *current-srl*))
   "Return a list of ucoc for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrcoc (cui2 soc cot cof coa kpfstr2) srl cui1
+  (collect-umlisp-query (mrcoc (cui2 soc cot cof coa kpfstr2) srl cui1
                            cui :lrl klrl :order (cof asc))
     (setq cui2 (ensure-integer cui2))
     (when (zerop cui2) (setq cui2 nil))
@@ -326,7 +326,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ucoc-cui2 (cui2 &key (srl *current-srl*))
   "Return a list of ucoc for cui2"
   (ensure-cui-integer cui2)
-  (with-umlisp-query (mrcoc (cui1 soc cot cof coa kpfstr2) srl cui2
+  (collect-umlisp-query (mrcoc (cui1 soc cot cof coa kpfstr2) srl cui2
                            cui2 :lrl klrl :order (cof asc))
     (when (zerop cui2) (setq cui2 nil))
     (make-instance 'ucoc :cui1 (ensure-integer cui1) :cui2 cui2
@@ -343,7 +343,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ulo-cui (cui &key (srl *current-srl*))
   "Return a list of ulo for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrlo (isn fr un sui sna soui) srl cui cui
+  (collect-umlisp-query (mrlo (isn fr un sui sna soui) srl cui cui
                           :lrl "KLRL")
     (make-instance 'ulo :isn isn :fr (ensure-integer fr) :un un
                   :sui (ensure-integer sui) :sna sna :soui soui)))
@@ -351,14 +351,14 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-uatx-cui (cui &key (srl *current-srl*))
   "Return a list of uatx for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mratx (sab rel atx) srl cui cui :lrl ksrl)
+  (collect-umlisp-query (mratx (sab rel atx) srl cui cui :lrl ksrl)
     (make-instance 'uatx :sab sab :rel rel :atx atx)))
 
 
 (defun find-uterm-cui (cui &key (srl *current-srl*))
   "Return a list of uterm for cui"
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrcon (lui lat ts kluilrl) srl cui cui
+  (collect-umlisp-query (mrcon (lui lat ts kluilrl) srl cui cui
                            :lrl kluilrl :distinct t)
     (make-instance 'uterm :lui (ensure-integer lui) :cui cui
                   :lat lat :ts ts :lrl (ensure-integer kluilrl))))
@@ -366,7 +366,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-uterm-lui (lui &key (srl *current-srl*))
   "Return a list of uterm for lui"
   (ensure-lui-integer lui)
-  (with-umlisp-query (mrcon (cui lat ts kluilrl) srl lui lui 
+  (collect-umlisp-query (mrcon (cui lat ts kluilrl) srl lui lui 
                             :lrl kluilrl :distinct t)
     (make-instance 'uterm :cui (ensure-integer cui) :lui lui
                   :lat lat :ts ts :lrl (ensure-integer kluilrl))))
@@ -375,7 +375,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   "Return single uterm for cui/lui"
   (ensure-cui-integer cui)
   (ensure-lui-integer lui)
-  (with-umlisp-query (mrcon (lat ts kluilrl) srl kcuilui
+  (collect-umlisp-query (mrcon (lat ts kluilrl) srl kcuilui
                             (make-cuilui cui lui)
                             :lrl kluilrl :single t)
     (make-instance 'uterm :cui cui :lui lui :lat lat :ts ts
@@ -385,7 +385,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   "Return a list of ustr for cui/lui"
   (ensure-cui-integer cui)
   (ensure-lui-integer lui)
-  (with-umlisp-query (mrcon (sui stt str lrl) srl kcuilui
+  (collect-umlisp-query (mrcon (sui stt str lrl) srl kcuilui
                            (make-cuilui cui lui) :lrl lrl)
     (make-instance 'ustr :sui (ensure-integer sui) :cui cui :lui lui
                   :cuisui (make-cuisui cui sui) :stt stt :str str
@@ -395,7 +395,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
   "Return the single ustr for cuisui"
   (ensure-cui-integer cui)
   (ensure-sui-integer sui)
-  (with-umlisp-query (mrcon (lui stt str lrl) srl kcuisui
+  (collect-umlisp-query (mrcon (lui stt str lrl) srl kcuisui
                            (make-cuisui cui sui) :lrl lrl :single t)
     (make-instance 'ustr :sui sui :cui cui :cuisui (make-cuisui cui sui)
                   :lui (ensure-integer lui) :stt stt :str str
@@ -404,7 +404,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ustr-sui (sui &key (srl *current-srl*))
   "Return the list of ustr for sui"
   (ensure-sui-integer sui)
-  (with-umlisp-query (mrcon (cui lui stt str lrl) srl sui sui
+  (collect-umlisp-query (mrcon (cui lui stt str lrl) srl sui sui
                            :lrl lrl)
     (make-instance 'ustr :sui sui :cui cui :stt stt :str str
                   :cuisui (make-cuisui (ensure-integer cui) sui)
@@ -412,7 +412,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
       
 (defun find-ustr-sab (sab &key (srl *current-srl*))
   "Return the list of ustr for sab"
-  (with-umlisp-query (mrso (kcuisui) srl sab sab :lrl srl)
+  (collect-umlisp-query (mrso (kcuisui) srl sab sab :lrl srl)
     (let ((cuisui (ensure-integer kcuisui)))
       (apply #'find-ustr-cuisui 
             (append
@@ -439,20 +439,20 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-string-sui (sui &key (srl *current-srl*))
   "Return the string associated with sui"
   (ensure-sui-integer sui)
-  (with-umlisp-query (mrcon (str) srl sui sui :lrl lrl :single t)
+  (collect-umlisp-query (mrcon (str) srl sui sui :lrl lrl :single t)
     str))
 
 (defun find-uso-cuisui (cui sui &key (srl *current-srl*))
   (ensure-sui-integer sui)
   (ensure-cui-integer cui)
-  (with-umlisp-query (mrso (sab code srl tty) srl kcuisui
+  (collect-umlisp-query (mrso (sab code srl tty) srl kcuisui
                           (make-cuisui cui sui) :lrl srl)
       (make-instance 'uso :sab sab :code code :srl srl :tty tty)))
 
 (defun find-ucxt-cuisui (cui sui &key (srl *current-srl*))
   (ensure-cui-integer cui)
   (ensure-sui-integer sui)
-  (with-umlisp-query (mrcxt (sab code cxn cxl rnk cxs cui2 hcd rela xc)
+  (collect-umlisp-query (mrcxt (sab code cxn cxl rnk cxs cui2 hcd rela xc)
                            srl kcuisui (make-cuisui cui sui) :lrl ksrl)
     (make-instance 'ucxt :sab sab :code code
                   :cxn (ensure-integer cxn) :cxl cxl :cxs cxs :hcd hcd
@@ -478,22 +478,22 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-usty-tui (tui)
   "Find usty for tui"
   (ensure-tui-integer tui)
-  (with-umlisp-query (mrsty (sty) nil tui tui :single t)
+  (collect-umlisp-query (mrsty (sty) nil tui tui :single t)
     (make-instance 'usty :tui tui :sty sty)))
 
 (defun find-usty-sty (sty)
   "Find usty for a sty"
-  (with-umlisp-query (mrsty (tui) nil sty sty :single t)
+  (collect-umlisp-query (mrsty (tui) nil sty sty :single t)
     (make-instance 'usty :tui (ensure-integer tui) :sty sty)))
 
 (defun find-usty-all ()
   "Return list of usty's for all semantic types"
-  (with-umlisp-query (mrsty (tui) nil nil nil :distinct t)
+  (collect-umlisp-query (mrsty (tui) nil nil nil :distinct t)
     (find-usty-tui tui)))
 
 (defun find-usab-all ()
   "Find usab for a key"
-  (with-umlisp-query (mrsab (vcui rcui vsab rsab son sf sver mstart mend imeta
+  (collect-umlisp-query (mrsab (vcui rcui vsab rsab son sf sver mstart mend imeta
                                  rmeta slc scc srl tfr cfr cxty ttyl atnl lat
                                  cenc curver sabin) nil nil nil)
     (make-instance 'usab :vcui (ensure-integer vcui) 
@@ -506,7 +506,7 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 
 (defun find-usab-by-key (key-name key)
   "Find usab for a key"
-  (with-umlisp-query-eval ('mrsab '(vcui rcui vsab rsab son sf sver mstart
+  (collect-umlisp-query-eval ('mrsab '(vcui rcui vsab rsab son sf sver mstart
                                    mend imeta rmeta slc scc srl tfr cfr cxty
                                    ttyl atnl lat cenc curver sabin)
                                  nil key-name key :single t)
@@ -534,49 +534,49 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 (defun find-ucon-tui (tui &key (srl *current-srl*))
   "Find list of ucon for tui"
   (ensure-tui-integer tui)
-  (with-umlisp-query (mrsty (cui) srl tui tui :lrl klrl :order (cui asc))
+  (collect-umlisp-query (mrsty (cui) srl tui tui :lrl klrl :order (cui asc))
     (find-ucon-cui (ensure-integer cui) :srl srl)))
   
 (defun find-ucon-word (word &key (srl *current-srl*) (like nil))
   "Return list of ucons that match word. Optionally, use SQL's LIKE syntax"
-  (with-umlisp-query-eval ('mrxw_eng '(cui) srl 'wd word :like like :distinct t
+  (collect-umlisp-query-eval ('mrxw_eng '(cui) srl 'wd word :like like :distinct t
                                     :lrl 'klrl :order '(cui asc))
     (find-ucon-cui cui :srl srl)))
 
 (defun find-ucon-normalized-word (word &key (srl *current-srl*) (like nil))
   "Return list of ucons that match word, optionally use SQL's LIKE syntax"
-  (with-umlisp-query-eval ('mrxnw_eng '(cui) srl 'nwd word :like like :distinct t
+  (collect-umlisp-query-eval ('mrxnw_eng '(cui) srl 'nwd word :like like :distinct t
                                      :lrl 'klrl :order '(cui asc))
     (find-ucon-cui cui :srl srl)))
 
 (defun find-ustr-word (word &key (srl *current-srl*))
   "Return list of ustrs that match word"
-  (with-umlisp-query (mrxw_eng (cui sui) srl wd word :lrl klrl
+  (collect-umlisp-query (mrxw_eng (cui sui) srl wd word :lrl klrl
                               :order (cui asc sui asc))
     (find-ustr-cuisui (ensure-integer cui) (ensure-integer sui) :srl srl)))
 
 (defun find-ustr-normalized-word (word &key (srl *current-srl*))
   "Return list of ustrs that match word"
-  (with-umlisp-query (mrxnw_eng (cui sui) srl nwd word :lrl klrl
+  (collect-umlisp-query (mrxnw_eng (cui sui) srl nwd word :lrl klrl
                                 :order (cui asc sui asc))
     (find-ustr-cuisui (ensure-integer cui) (ensure-integer sui) :srl srl)))
 
 (defun find-ucon-noneng-word (word &key (srl *current-srl*) (like nil))
   "Return list of ucons that match non-english word"
-  (with-umlisp-query-eval ('mrxw_noneng '(cui) srl 'wd word :like like
+  (collect-umlisp-query-eval ('mrxw_noneng '(cui) srl 'wd word :like like
                                        :distinct t :lrl 'klrl :order '(cui asc))
     (find-ucon-cui cui :srl srl)))
 
 (defun find-ustr-noneng-word (word &key (srl *current-srl*))
   "Return list of ustrs that match non-english word"
-  (with-umlisp-query (mrxw_noneng (cui sui) srl wd word :lrl klrl
+  (collect-umlisp-query (mrxw_noneng (cui sui) srl wd word :lrl klrl
                                  :order (cui asc sui asc))
     (find-ustr-cuisui (ensure-integer cui) (ensure-integer sui) :srl srl)))
 
 ;; Special tables
 
 (defun find-usrl-all ()
-  (with-umlisp-query (usrl (sab srl) nil nil nil :order (sab asc))
+  (collect-umlisp-query (usrl (sab srl) nil nil nil :order (sab asc))
     (make-instance 'usrl :sab sab :srl (ensure-integer srl))))
 
 ;;; Multiword lookup and score functions
@@ -651,11 +651,11 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 
 (defun find-lexterm-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrwd (wrd) nil eui eui :single t)
+  (collect-umlisp-query (lrwd (wrd) nil eui eui :single t)
     (make-instance 'lexterm :eui eui :wrd wrd)))
 
 (defun find-lexterm-word (wrd)
-  (with-umlisp-query (lrwd (eui) nil wrd wrd)
+  (collect-umlisp-query (lrwd (eui) nil wrd wrd)
     (make-instance 'lexterm :eui (ensure-integer eui)
                   :wrd (copy-seq wrd))))
 
@@ -663,94 +663,94 @@ is OBJNAME from TABLE where WHERE-NAME field = WHERE-VALUE with FIELDS"
 
 (defun find-labr-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrabr (bas abr eui2 bas2) nil eui eui) 
+  (collect-umlisp-query (lrabr (bas abr eui2 bas2) nil eui eui) 
     (make-instance 'labr :eui eui :bas bas :abr abr :bas2 bas2
                   :eui2 (ensure-integer eui2))))
 
 (defun find-labr-bas (bas)
-  (with-umlisp-query (labr (eui abr eui2 bas2) nil bas bas)
+  (collect-umlisp-query (labr (eui abr eui2 bas2) nil bas bas)
     (make-instance 'labr :eui (ensure-integer eui) :abr abr :bas2 bas2
                   :bas (copy-seq bas) :eui2 (ensure-integer eui2))))
 
 (defun find-lagr-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lragr (str sca agr cit bas) nil eui eui)
+  (collect-umlisp-query (lragr (str sca agr cit bas) nil eui eui)
     (make-instance 'lagr :eui eui :str str :sca sca :agr agr
                   :cit cit :bas bas)))
 
 (defun find-lcmp-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrcmp (bas sca com) nil eui eui)
+  (collect-umlisp-query (lrcmp (bas sca com) nil eui eui)
     (make-instance 'lcmp :eui eui :bas bas :sca sca :com com)))
 
 (defun find-lmod-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrmod (bas sca psn_mod fea) nil eui eui)
+  (collect-umlisp-query (lrmod (bas sca psn_mod fea) nil eui eui)
     (make-instance 'lmod :eui eui :bas bas :sca sca :psnmod psn_mod :fea fea)))
 
 (defun find-lnom-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrnom (bas sca eui2 bas2 sca2) nil eui eui)
+  (collect-umlisp-query (lrnom (bas sca eui2 bas2 sca2) nil eui eui)
     (make-instance 'lnom :eui eui :bas bas :sca sca :bas2 bas2 :sca2 sca2
                   :eui2 (ensure-integer eui2))))
 
 (defun find-lprn-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrprn (bas num gnd cas pos qnt fea) nil eui eui)
+  (collect-umlisp-query (lrprn (bas num gnd cas pos qnt fea) nil eui eui)
     (make-instance 'lprn :eui eui :bas bas :num num :gnd gnd
                   :cas cas :pos pos :qnt qnt :fea fea)))
 
 (defun find-lprp-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrprp (bas str sca fea) nil eui eui)
+  (collect-umlisp-query (lrprp (bas str sca fea) nil eui eui)
     (make-instance 'lprp :eui eui :bas bas :str str :sca sca :fea fea)))
 
 (defun find-lspl-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrspl (spv bas) nil eui eui)
+  (collect-umlisp-query (lrspl (spv bas) nil eui eui)
     (make-instance 'lspl :eui eui :spv spv :bas bas)))
 
 (defun find-ltrm-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrtrm (bas gen) nil eui eui) 
+  (collect-umlisp-query (lrtrm (bas gen) nil eui eui) 
     (make-instance 'ltrm :eui eui :bas bas :gen gen)))
 
 (defun find-ltyp-eui (eui)
   (ensure-eui-integer eui)
-  (with-umlisp-query (lrtyp (bas sca typ) nil eui eui)
+  (collect-umlisp-query (lrtyp (bas sca typ) nil eui eui)
     (make-instance 'ltyp :eui eui :bas bas :sca sca :typ typ)))
 
 (defun find-lwd-wrd (wrd)
   (make-instance 'lwd :wrd
-                :euilist (with-umlisp-query (lrwd (eui) nil wrd wrd)
+                :euilist (collect-umlisp-query (lrwd (eui) nil wrd wrd)
                            (ensure-integer eui))))
 
 ;;; Semantic Network SQL access functions
 
 (defun find-sdef-ui (ui)
-  (with-umlisp-query (srdef (rt sty_rl stn_rtn def ex un rh abr rin)
+  (collect-umlisp-query (srdef (rt sty_rl stn_rtn def ex un rh abr rin)
                            nil ui ui :single t)
     (make-instance 'sdef :rt rt :ui ui :styrl sty_rl :stnrtn stn_rtn
                   :def def :ex ex :un un :rh rh :abr abr :rin rin)))
 
 (defun find-sstre1-ui (ui)
-  (with-umlisp-query (srstre1 (ui2 ui3) nil ui ui)
+  (collect-umlisp-query (srstre1 (ui2 ui3) nil ui ui)
     (make-instance 'sstre1 :ui ui :ui2 (ensure-integer ui2)
                   :ui3 (ensure-integer ui3))))
 
 (defun find-sstre1-ui2 (ui2)
-  (with-umlisp-query (srstre1 (ui ui3) nil ui2 ui2)
+  (collect-umlisp-query (srstre1 (ui ui3) nil ui2 ui2)
     (make-instance 'sstre1 :ui (ensure-integer ui) :ui2 ui2
                   :ui3 (ensure-integer ui3))))
 
 (defun find-sstr-rl (rl)
-  (with-umlisp-query (srstre (sty_rl sty_rl2 ls) nil rl rl)
+  (collect-umlisp-query (srstre (sty_rl sty_rl2 ls) nil rl rl)
     (make-instance 'sstr :rl rl :styrl sty_rl :styrl2 sty_rl2 :ls ls)))
 
 (defun find-sstre2-sty (sty)
-  (with-umlisp-query (srstre2 (rl sty2) nil sty sty)
+  (collect-umlisp-query (srstre2 (rl sty2) nil sty sty)
     (make-instance 'sstre2 :sty (copy-seq sty) :rl rl :sty2 sty2)))
 
 (defun find-sstr-styrl (styrl)
-  (with-umlisp-query (srstr (rl sty_rl2 ls) nil styrl styrl)
+  (collect-umlisp-query (srstr (rl sty_rl2 ls) nil styrl styrl)
     (make-instance 'sstr :styrl styrl :rl rl :styrl2 sty_rl2 :ls ls)))