&key (lrl "KCUILRL") single distinct order like limit
filter)
(let* ((%%fields (format nil "SELECT ~A~{~:@(~A~)~^,~} FROM ~:@(~A~)"
- (if distinct "DISTINCT " "") fields table))
+ (if distinct "DISTINCT " "") (sqlname fields) table))
(%%order (if order (format nil " ORDER BY ~{~:@(~A~) ~(~A~)~^,~}"
order)
""))
(%%lrl (format nil " AND ~:@(~A~)<=" lrl))
(%%where (when where-name
- (format nil " WHERE ~:@(~A~)~A" where-name
+ (format nil " WHERE ~:@(~A~)~A" (sqlname where-name)
(if like " like " ""))))
(%filter (gensym "FILTER-"))
(%single (gensym "SINGLE-"))
(concatenate
'string
(format nil "SELECT ~A~{~:@(~A~)~^,~} FROM ~:@(~A~)"
- (if distinct "DISTINCT " "") fields table)
- (if where-name (format nil " WHERE ~:@(~A~)" where-name) "")
+ (if distinct "DISTINCT " "") (sqlname fields) table)
+ (if where-name (format nil " WHERE ~:@(~A~)" (sqlname where-name)) "")
(if where-name
(format nil
(typecase where-value
(mapcar #'cui1 (find-urel-cui2 cui2 :srl srl)))
collect (find-ucon-cui cui :srl srl)))
-(defun find-ucoc-cui (cui &key (srl *current-srl*))
+#+mrcoc (defun find-ucoc-cui (cui &key (srl *current-srl*))
"Return a list of ucoc for cui"
(ensure-cui-integer cui)
(collect-umlisp-query (mrcoc (aui1 cui2 aui2 sab cot cof coa) srl cui1
:cot cot :cof (ensure-integer cof) :coa coa :sab sab
:pfstr2 (find-pfstr-cui cui2))))
-(defun find-ucoc-cui2 (cui2 &key (srl *current-srl*))
+#+mrcoc (defun find-ucoc-cui2 (cui2 &key (srl *current-srl*))
"Return a list of ucoc for cui2"
(ensure-cui-integer cui2)
(collect-umlisp-query (mrcoc (cui1 aui1 aui2 sab cot cof coa) srl cui2
:sab sab :cot cot :cof (ensure-integer cof) :coa coa
:pfstr2 (find-pfstr-cui cui2))))
-(defun find-ucon-coc-cui2 (cui2 &key (srl *current-srl*))
+#+mrcoc (defun find-ucon-coc-cui2 (cui2 &key (srl *current-srl*))
"List of ucon with co-occurance cui2"
(ensure-cui-integer cui2)
(mapcar
(defun find-ustats-srl (srl)
(collect-umlisp-query (ustats (name count) nil srl srl :order (name asc))
(make-instance 'ustats :name name :hits (ensure-integer count))))
+
+(defun find-urank-sab (sab &key (srl *current-srl*))
+ (collect-umlisp-query (mrrank (rank sab suppress tty) nil sab sab)
+ (make-instance 'urank :rank rank :sab sab :tty tty :suppress suppress)))
+
+(defun find-urank-all (&key (srl *current-srl*))
+ (if srl
+ (collect-umlisp-query (mrrank (rank sab suppress tty) nil ksrl srl)
+ (make-instance 'urank :rank rank :sab sab :tty tty :suppress suppress))
+ (collect-umlisp-query (mrrank (rank sab suppress tty ksrl) nil nil nil)
+ (make-instance 'urank :rank rank :sab sab :tty tty :suppress suppress))))