r11156: fix trans extension for sbcl, fix index for mrrel
[umlisp.git] / create-sql.lisp
index f2762861637a5422dc055db70f43fecc5bbaf844..4a4413a1aa2e93e7f1f4431c7fb6ed66fedbfcf2 100644 (file)
             (:oracle "NUMBER(2,0)")
             (t "INTEGER")))
    :database conn)
+  ;; KCON deprecated by KPFENG field in MRCONSO
+  #+nil
   (dolist (tuple (query "select distinct cui from MRCONSO order by cui"
                        :database conn))
     (let ((cui (car tuple)))
     (sql-create-indexes conn +custom-index-cols+)
     (sql-create-special-tables conn)))
 
-(defun create-umls-db (&key (extension ".trans") (skip-translation nil))
+(defun create-umls-db (&key (extension "-trans") (skip-translation nil))
   "SQL Databases: initializes entire database via SQL copy commands.
 This is much faster that using create-umls-db-insert."
   (ensure-ucols+ufiles)
@@ -262,7 +264,7 @@ This is much faster that using create-umls-db-insert."
       (sql-create-indexes conn +custom-index-cols+)
       (sql-create-special-tables conn))))
 
-(defun translate-all-files (&optional (extension ".trans"))
+(defun translate-all-files (&optional (extension "-trans"))
   "Copy translated files and return postgresql copy commands to import"
   (make-noneng-index-file extension)
   (dolist (f (remove "MRXW_NONENG.RRF" *umls-files* :test #'string= :key #'fil))
@@ -345,13 +347,13 @@ This is much faster that using create-umls-db-insert."
    nil "COPY ~a FROM '~a' using delimiters '|' with null as ''"
    (table file) (ufile-pathname file extension)))
 
-(defun mysql-copy-cmd (file extension &key local-file)
+(defun mysql-copy-cmd (file extension &key (local-file t))
   "Return mysql copy statement for a file"
   (format
    nil
    "LOAD DATA ~AINFILE \"~a\" INTO TABLE ~a FIELDS TERMINATED BY \"|\""
    (if local-file "LOCAL " "")
-   (ufile-pathname file extension) (table file)))
+   (namestring (ufile-pathname file extension)) (table file)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;