From 9028d442490f4dde96d31dfe8b27f6cd07f7a4da Mon Sep 17 00:00:00 2001 From: Jeffery Painter Date: Mon, 22 Jan 2024 17:59:10 -0500 Subject: [PATCH] Update the parent pom.xml to bump support for MySQL to 8.0.33. Update the concept graphs to reference SNOMEDCT as SNOMEDCT_US which is the current name in UMLS. Update the create_tables.sql to support MySQL 8.0.x SQL commands. Update the ytex.properties examples to reflect that we need an xmldb.url to specify when JDBC URLs contain an ampersand and must be escaped in the generation of the conn.xml scripts in the ant build process. --- ctakes-ytex/scripts/data/build.xml | 5 +- .../data/mysql/kernel/create_tables.sql | 54 +++++++++++-------- .../conceptGraph/sct-msh-csp-aod.template.xml | 4 +- .../ytex/conceptGraph/sct-rxnorm.template.xml | 4 +- .../ytex/conceptGraph/sct-umls.template.xml | 4 +- .../ctakes/ytex/ytex.properties.mssql.example | 4 ++ .../ctakes/ytex/ytex.properties.mysql.example | 7 ++- .../ctakes/ytex/ytex.properties.orcl.example | 4 ++ .../ctakes/ytex/ytex.hsql.properties.template | 1 + .../apache/ctakes/ytex/ytex.hsqldb.properties | 1 + pom.xml | 2 +- 11 files changed, 57 insertions(+), 33 deletions(-) diff --git a/ctakes-ytex/scripts/data/build.xml b/ctakes-ytex/scripts/data/build.xml index 049a47b5..129cad1e 100644 --- a/ctakes-ytex/scripts/data/build.xml +++ b/ctakes-ytex/scripts/data/build.xml @@ -531,7 +531,8 @@ ${sql.delimiter} - + + @@ -599,4 +600,4 @@ ${sql.delimiter} - \ No newline at end of file + diff --git a/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql b/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql index 5936f1b6..10744e95 100644 --- a/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql +++ b/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql @@ -159,17 +159,20 @@ create table feature_eval ( index ix_feature_eval(corpus_name, cv_fold_id, type) ) engine=myisam comment 'evaluation of a set of features in a corpus'; -create table feature_rank ( - feature_rank_id int auto_increment not null primary key, - feature_eval_id int not null comment 'fk feature_eval', - feature_name varchar(50) not null comment 'name of feature', - evaluation double not null default 0 comment 'measurement of feature worth', - rank int not null default 0 comment 'rank among all features', - unique index nk_feature_name(feature_eval_id, feature_name), - index ix_feature_rank(feature_eval_id, rank), - index ix_feature_evaluation(feature_eval_id, evaluation), - index fk_feature_eval(feature_eval_id) -) engine=myisam comment 'evaluation of a feature in a corpus'; +-- update for MySQL 8.0.x +CREATE TABLE `feature_rank` ( + `feature_rank_id` int NOT NULL AUTO_INCREMENT, + `feature_eval_id` int NOT NULL COMMENT 'fk feature_eval', + `feature_name` varchar(50) NOT NULL COMMENT 'name of feature', + `evaluation` double NOT NULL DEFAULT '0' COMMENT 'measurement of feature worth', + `rank` int NOT NULL DEFAULT '0' COMMENT 'rank among all features', + PRIMARY KEY (`feature_rank_id`), + UNIQUE KEY `nk_feature_name` (`feature_eval_id`,`feature_name`), + INDEX `ix_feature_rank` (`feature_eval_id`,`rank`), + INDEX `ix_feature_evaluation` (`feature_eval_id`,`evaluation`), + INDEX `fk_feature_eval` (`feature_eval_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='evaluation of a feature in a corpus'; + CREATE TABLE feature_parchd ( feature_parchd_id int(11) NOT NULL AUTO_INCREMENT, @@ -211,18 +214,23 @@ create table hotspot_instance ( unique index NK_hotspot_instance (corpus_name, experiment, label, instance_id) ) engine=myisam comment 'hotspot features for an instance'; -create table hotspot_sentence ( - hotspot_sentence_id int auto_increment not null primary key, - hotspot_instance_id int not null comment 'fk hotspot_instance', - anno_base_id int not null comment 'fk anno_sentence', - evaluation double not null default 0 comment 'max eval from hotspot', - rank int not null default 0 comment 'min rank from hotspot', - unique index NK_hotspot_sentence (hotspot_instance_id, anno_base_id), - index FK_hotspot_instance_id (hotspot_instance_id), - index FK_anno_base_id (anno_base_id), - INDEX IX_evaluation (hotspot_instance_id, evaluation), - INDEX IX_rank (hotspot_instance_id, rank) -) engine = myisam comment 'sentences that contain hotspots at specified threshold'; + +-- update for MySQL 8.0.x +CREATE TABLE `hotspot_sentence` ( + `hotspot_sentence_id` int NOT NULL AUTO_INCREMENT, + `hotspot_instance_id` int NOT NULL COMMENT 'fk hotspot_instance', + `anno_base_id` int NOT NULL COMMENT 'fk anno_sentence', + `evaluation` double NOT NULL DEFAULT '0' COMMENT 'max eval from hotspot', + `rank` int NOT NULL DEFAULT '0' COMMENT 'min rank from hotspot', + PRIMARY KEY (`hotspot_sentence_id`), + UNIQUE KEY `NK_hotspot_sentence` (`hotspot_instance_id`,`anno_base_id`), + INDEX `FK_hotspot_instance_id` (`hotspot_instance_id`), + INDEX `FK_anno_base_id` (`anno_base_id`), + INDEX `IX_evaluation` (`hotspot_instance_id`,`evaluation`), + INDEX `IX_rank` (`hotspot_instance_id`,`rank`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='sentences that contain hotspots at specified threshold'; + + create table corpus_doc ( corpus_name varchar(50) not null comment 'corpus name', diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-msh-csp-aod.template.xml b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-msh-csp-aod.template.xml index 9e617961..2c097ef8 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-msh-csp-aod.template.xml +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-msh-csp-aod.template.xml @@ -24,8 +24,8 @@ - \ No newline at end of file + diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-rxnorm.template.xml b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-rxnorm.template.xml index 42496611..6da85d1d 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-rxnorm.template.xml +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-rxnorm.template.xml @@ -24,8 +24,8 @@ - \ No newline at end of file + diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-umls.template.xml b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-umls.template.xml index b1fb650d..d41a60ff 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-umls.template.xml +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/conceptGraph/sct-umls.template.xml @@ -24,8 +24,8 @@ - \ No newline at end of file + diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mssql.example b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mssql.example index 2d837f17..e461ec62 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mssql.example +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mssql.example @@ -8,6 +8,10 @@ db.schema=dbo # with the values of db.host and db.name respectively db.url=jdbc:sqlserver://localhost;databaseName=YTEX;integratedSecurity=true +# The xmldb.url should be a duplicate of db.url with the exception of replacing an & with & +# This is a stopgap to allow conn.xml.template to not break in the SAX parser +xmldb.url=jdbc:sqlserver://localhost;databaseName=YTEX;integratedSecurity=true + # assume windows integrated authentication, change if necessary db.username= db.password= diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mysql.example b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mysql.example index 3769579d..76ec1fc2 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mysql.example +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.mysql.example @@ -6,7 +6,12 @@ db.username=ytex db.password=ytex # jdbc url for database. schema name must match db.schema -db.url=jdbc:mysql://localhost:3306/ytex?autoReconnect=true +db.url=jdbc:mysql://localhost:3306/ytex?autoReconnect=TRUE&serverTimezone=US/Eastern&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true + +# The xmldb.url should be a duplicate of db.url with the exception of replacing an & with & +# This is a stopgap to allow conn.xml.template to not break in the SAX parser +xmldb.url=jdbc:mysql://localhost:3306/ytex?autoReconnect=TRUE&serverTimezone=US/Eastern&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true + # the schema where umls is installed # if not specified, will default to schema from ytex diff --git a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.orcl.example b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.orcl.example index 7a09b516..72174ca4 100644 --- a/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.orcl.example +++ b/ctakes-ytex/src/main/resources/org/apache/ctakes/ytex/ytex.properties.orcl.example @@ -3,6 +3,10 @@ # another format that works is e.g.: jdbc:oracle:thin:ytex/ytex@localhost:1521:orcl db.url=jdbc:oracle:thin:@localhost:1521:orcl +# The xmldb.url should be a duplicate of db.url with the exception of replacing an & with & +# This is a stopgap to allow conn.xml.template to not break in the SAX parser +xmldb.url=jdbc:oracle:thin:@localhost:1521:orcl + # oracle username and password # user needs connect, resource, and create view privileges db.username=ytex_test diff --git a/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsql.properties.template b/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsql.properties.template index 1fd129e0..66c59be9 100644 --- a/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsql.properties.template +++ b/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsql.properties.template @@ -8,6 +8,7 @@ db.password= db.directory=@ytex.hsql.db@ # jdbc url for database. schema name must match db.schema db.url=jdbc:hsqldb:file://@ytex.hsql.db@;shutdown=true +xmldb.url=jdbc:hsqldb:file://@ytex.hsql.db@;shutdown=true # the schema where umls is installed # if not specified, will default to schema from ytex diff --git a/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsqldb.properties b/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsqldb.properties index 9a46c672..5ea5a7dc 100644 --- a/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsqldb.properties +++ b/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsqldb.properties @@ -26,6 +26,7 @@ db.schema=ytex # jdbc url for database. Replace localhost and YTEX_TEST # with the values of db.host and db.name respectively db.url=jdbc:hsqldb:hsql://localhost;databaseName=YTEX_TEST;integratedSecurity=false +xmldb.url=jdbc:hsqldb:hsql://localhost;databaseName=YTEX_TEST;integratedSecurity=false # assume windows integrated authentication, change if necessary db.username=ytex_test diff --git a/pom.xml b/pom.xml index d68535a6..3e6aeb7f 100644 --- a/pom.xml +++ b/pom.xml @@ -147,7 +147,7 @@ 3.2.3 3.2.3 3.6.0 - 5.1.26 + 8.0.33 2.11.7 0.4.0 2.2