-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/usr/bin zsh | ||
|
||
# change the user and database according to your parctice. | ||
|
||
echo "Loading UMLS 2020 tables and data" | ||
psql -U postgres -d umls -f pgsql_all_tables.sql | ||
echo "Tables loaded" | ||
psql -U jmbanda -d umls2018aa -f pgsql_index.sql | ||
psql -U postgres -d umls -f pgsql_index.sql | ||
echo "Indexing Ready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,11 @@ This script has been tested in PostgreSQL 8.2.3 on Mac OS 10.4.10 | |
# The script can also work with PostgreSQL 11.2 and UMLS-2020AB by Zhao Zhengyang ([email protected]) | ||
Thank you for Mr Banda and Mr Bedrick! | ||
Please point each 'COPY' statement to your local '/tmp/META' installation directory, or wherever you have stored the .RRF files output by MetamorphoSys. | ||
This script has been tested in PostgreSQL 11.2 on Linux (Deepin 20.1, Debain 10 cored). | ||
*/ | ||
|
||
create schema if not exists _2020ab; | ||
create schema if not exists _2020ab; /* You can change the schema name as your wish. */ | ||
set schema '_2020ab'; | ||
|
||
DROP TABLE if exists MRCOLS; | ||
|
@@ -28,6 +27,7 @@ CREATE TABLE MRCOLS ( | |
dummy char(1) | ||
); | ||
|
||
---change the path of RRF file according the practice--- | ||
COPY MRCOLS FROM '/media/yuebing/new_dev/umls/2020AB/META/MRCOLS.RRF' | ||
WITH DELIMITER AS '|' NULL AS ''; | ||
ALTER TABLE MRCOLS DROP COLUMN dummy; | ||
|
@@ -351,6 +351,22 @@ CREATE TABLE MRXW_ENG ( | |
COPY MRXW_ENG FROM '/media/yuebing/new_dev/umls/2020AB/META/MRXW_ENG.RRF' WITH DELIMITER AS '|' NULL AS ''; | ||
ALTER TABLE MRXW_ENG DROP COLUMN dummy; | ||
|
||
/* Because I only use English items, I deleted the load of MRXW_XXX loaders except English one. | ||
If you want to load another language, you can rewrite the SQL expression as follows: | ||
DROP TABLE if exists MRXW_LAN; ---'LAN' means the language.--- | ||
CREATE TABLE MRXW_ENG ( | ||
LAT char(3) NOT NULL, | ||
WD varchar(100) NOT NULL, | ||
CUI char(12) NOT NULL, | ||
LUI char(12) NOT NULL, | ||
SUI char(12) NOT NULL, | ||
dummy char(1) | ||
); | ||
COPY MRXW_LAN FROM '/your/path/META/MRXW_ENG.RRF' WITH DELIMITER AS '|' NULL AS ''; | ||
ALTER TABLE MRXW_LAN DROP COLUMN dummy; | ||
*/ | ||
|
||
DROP TABLE if exists MRAUI; | ||
CREATE TABLE MRAUI ( | ||
AUI1 varchar(9) NOT NULL, | ||
|
@@ -364,7 +380,7 @@ CREATE TABLE MRAUI ( | |
MAPIN char(1) NOT NULL, | ||
dummy char(1) | ||
); | ||
COPY MRAUI FROM '/media/yuebing/new_dev/umls/2020AB/META//MRAUI.RRF' WITH DELIMITER AS '|' NULL AS ''; | ||
COPY MRAUI FROM '/media/yuebing/new_dev/umls/2020AB/META/MRAUI.RRF' WITH DELIMITER AS '|' NULL AS ''; | ||
ALTER TABLE MRAUI DROP COLUMN dummy; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,17 @@ | |
Created by: | ||
Yeb Havinga, MSc | ||
[email protected] | ||
Modified by: | ||
Juan M. Banda | ||
[email protected] | ||
Tested by: | ||
Zhao Zhengyang | ||
[email protected] | ||
*/ | ||
|
||
--- I deleted the expression where tables does not exist in this version. --- | ||
|
||
CREATE INDEX X_MRCONSO_CUI ON MRCONSO(CUI); | ||
ALTER TABLE MRCONSO ADD CONSTRAINT X_MRCONSO_PK PRIMARY KEY (AUI); | ||
|