(defun sql-create-indexes (conn &key (indexes +index-cols+) verbose)
"SQL Databases: create all indexes"
(dolist (idx indexes)
(defun sql-create-indexes (conn &key (indexes +index-cols+) verbose)
"SQL Databases: create all indexes"
(dolist (idx indexes)
(ignore-errors (sql-execute (drop-index-cmd (car idx) (cadr idx)) conn))
(sql-execute (create-index-cmd (car idx) (cadr idx) (caddr idx)) conn)))
(ignore-errors (sql-execute (drop-index-cmd (car idx) (cadr idx)) conn))
(sql-execute (create-index-cmd (car idx) (cadr idx) (caddr idx)) conn)))
(sql-create-indexes conn :indexes +custom-index-cols+ :verbose verbose)
(sql-create-special-tables conn)))
(sql-create-indexes conn :indexes +custom-index-cols+ :verbose verbose)
(sql-create-special-tables conn)))
"SQL Databases: initializes entire database via SQL copy commands.
This is much faster that using create-umls-db-insert."
(when verbose (format t "UMLS Import: Starting.~%"))
(ensure-ucols+ufiles)
(when verbose (format t "UMLS Import: Preparsing files.~%"))
(ensure-preparse)
"SQL Databases: initializes entire database via SQL copy commands.
This is much faster that using create-umls-db-insert."
(when verbose (format t "UMLS Import: Starting.~%"))
(ensure-ucols+ufiles)
(when verbose (format t "UMLS Import: Preparsing files.~%"))
(ensure-preparse)
- (unless skip-translation
- (when verbose (format t "UMLS Import: Converting text UMLS files to optimized format.~%"))
- (translate-all-files :extension extension :verbose verbose))
+ (when verbose (format t "UMLS Import: Converting text UMLS files to optimized format.~%"))
+ (translate-all-files :extension extension :verbose verbose :force force-translation)
(sql-execute (funcall copy-cmd file extension) conn))
(When verbose (format t "UMLS Import: Creating SQL indices.~%"))
(sql-create-indexes conn :verbose verbose)
(sql-execute (funcall copy-cmd file extension) conn))
(When verbose (format t "UMLS Import: Creating SQL indices.~%"))
(sql-create-indexes conn :verbose verbose)
"Translate all *umls-files* to optimized import format."
(make-noneng-index-file extension)
(dolist (f (remove "MRXW_NONENG.RRF" *umls-files* :test #'string= :key #'fil))
"Translate all *umls-files* to optimized import format."
(make-noneng-index-file extension)
(dolist (f (remove "MRXW_NONENG.RRF" *umls-files* :test #'string= :key #'fil))
- (when verbose (format t "UMLS Import: translating file ~S.~%" f))
- (translate-umls-file f extension)))
+ (when verbose (format t "UMLS Import: Translating file ~A.~%" (fil f)))
+ (translate-umls-file f extension :force force)))
(defun verify-translation-file (output-path input-ufiles)
"Returns t if translation file exists and is correct size. Warns and deletes incomplete translation file."
(defun verify-translation-file (output-path input-ufiles)
"Returns t if translation file exists and is correct size. Warns and deletes incomplete translation file."
"Translate a umls file into a format suitable for sql copy cmd"
(let ((output-path (ufile-pathname out-ufile extension)))
"Translate a umls file into a format suitable for sql copy cmd"
(let ((output-path (ufile-pathname out-ufile extension)))
#+(and clisp unicode) :external-format
#+(and clisp unicode) charset:utf-8)
(dolist (input-ufile input-ufiles)
#+(and clisp unicode) :external-format
#+(and clisp unicode) charset:utf-8)
(dolist (input-ufile input-ufiles)