ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vjapa...@apache.org
Subject svn commit: r1551254 [7/26] - in /ctakes/branches/ytex: ctakes-ytex-res/ ctakes-ytex-res/.settings/ ctakes-ytex-res/src/ ctakes-ytex-res/src/main/ ctakes-ytex-res/src/main/resources/ ctakes-ytex-res/src/main/resources/org/ ctakes-ytex-res/src/main/reso...
Date Mon, 16 Dec 2013 16:30:40 GMT
Added: ctakes/branches/ytex/ctakes-ytex/pom.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/pom.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/pom.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/pom.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,380 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>ctakes-ytex</artifactId>
+	<name>Apache cTAKES ytex</name>
+	<parent>
+		<groupId>org.apache.ctakes</groupId>
+		<artifactId>ctakes</artifactId>
+		<version>3.2.0-SNAPSHOT</version>
+	</parent>
+	<dependencies>
+		<!-- begin non ASF compliant dependencies -->
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-core</artifactId>
+			<version>4.2.6.Final</version>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-ehcache</artifactId>
+			<version>4.2.6.Final</version>
+			<exclusions>
+				<exclusion>
+					<groupId>net.sf.ehcache</groupId>
+					<artifactId>ehcache-core</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>nz.ac.waikato.cms.weka</groupId>
+			<artifactId>weka-stable</artifactId>
+			<version>3.6.10</version>
+		</dependency>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.26</version>
+		</dependency>
+		<!-- download from ms: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774, 
+			install to local maven repo: mvn install:install-file -Dfile=sqljdbc4.jar 
+			-DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc -Dversion=4.0 -Dpackaging=jar -->
+		<dependency>
+			<groupId>com.microsoft.sqlserver</groupId>
+			<artifactId>sqljdbc</artifactId>
+			<version>4.0</version>
+		</dependency>
+		<!-- download from oracle http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html, 
+			install to local maven repo: mvn install:install-file -Dfile=ojdbc7_g.jar 
+			-DgroupId=oracle.jdbc -DartifactId=ojdbc7_g -Dversion=12.1.0.1.0 -Dpackaging=jar -->
+		<dependency>
+			<groupId>oracle.jdbc</groupId>
+			<artifactId>ojdbc7_g</artifactId>
+			<version>12.1.0.1.0</version>
+		</dependency>
+		<!-- end non ASF compliant dependencies -->
+
+		<dependency>
+			<groupId>ant-contrib</groupId>
+			<artifactId>ant-contrib</artifactId>
+			<version>1.0b3</version>
+			<exclusions>
+				<exclusion>
+					<artifactId>ant</artifactId>
+					<groupId>ant</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.ctakes</groupId>
+			<artifactId>ctakes-ytex-res</artifactId>
+			<version>${ctakes.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>hsqldb</groupId>
+			<artifactId>hsqldb</artifactId>
+			<version>1.8.0.10</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>commons-cli</groupId>
+			<artifactId>commons-cli</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>commons-jxpath</groupId>
+			<artifactId>commons-jxpath</artifactId>
+			<version>1.3</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>1.8.3</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.solr</groupId>
+			<artifactId>solr-commons-csv</artifactId>
+			<version>1.4.0</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.6.1</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-core</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>3.1.2.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-orm</artifactId>
+			<version>3.1.2.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-aop</artifactId>
+			<version>3.1.2.RELEASE</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>aspectjweaver</artifactId>
+			<version>1.7.3</version>
+		</dependency>
+
+		<!-- ehcache > 2.5.0 breaks unit tests - get errors due to multiple cache 
+			managers in same vm -->
+		<dependency>
+			<groupId>net.sf.ehcache</groupId>
+			<artifactId>ehcache-core</artifactId>
+			<version>2.4.6</version>
+		</dependency>
+
+		<dependency>
+			<groupId>net.sf.trove4j</groupId>
+			<artifactId>trove4j</artifactId>
+			<version>3.0.3</version>
+		</dependency>
+		<dependency>
+			<groupId>com.rubiconproject.oss</groupId>
+			<artifactId>jchronic</artifactId>
+			<version>0.2.6</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.bind</groupId>
+			<artifactId>jaxb-api</artifactId>
+			<version>2.2.5</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml.bind</groupId>
+			<artifactId>jaxb-impl</artifactId>
+			<version>2.2.5</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.guava</groupId>
+			<artifactId>guava</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.ant</groupId>
+			<artifactId>ant-launcher</artifactId>
+			<version>1.9.2</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<extensions>
+			<extension>
+				<!-- allow follow redirects -->
+				<groupId>org.apache.maven.wagon</groupId>
+				<artifactId>wagon-http-lightweight</artifactId>
+				<version>2.2</version>
+			</extension>
+		</extensions>
+
+
+		<plugins>
+			<!-- JAXB xjc plugin that invokes the xjc compiler to compile XML schema 
+				into Java classes. -->
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>jaxb2-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>xjc</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<!-- The schema directory or xsd files. -->
+					<schemaDirectory>${project.basedir}/../ctakes-ytex-res/src/main/resources/org/apache/ctakes/jdl</schemaDirectory>
+					<!-- The package in which the source files will be generated. -->
+					<packageName>org.apache.ctakes.jdl.schema.xdl</packageName>
+				</configuration>
+			</plugin>
+			<!-- ant scripts need project dependencies in the target/lib directory -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<phase>compile</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>${basedir}/target/lib</outputDirectory>
+							<overWriteReleases>false</overWriteReleases>
+							<overWriteSnapshots>false</overWriteSnapshots>
+							<overWriteIfNewer>true</overWriteIfNewer>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<version>1.6</version>
+				<executions>
+					<execution>
+						<id>generate-config</id>
+						<phase>process-classes</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<target>
+								<ant antfile="build-setup.xml" dir="scripts" target="templateToConfig">
+									<property name="config.generated.dir" value="${project.build.outputDirectory}" />
+								</ant>
+							</target>
+						</configuration>
+					</execution>
+					<execution>
+						<id>generate-test-config</id>
+						<phase>process-test-classes</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<target>
+								<!-- generate a test ytex config if we don't have one -->
+								<ant antfile="build-setup.xml" dir="scripts"
+									target="generateTestYtexProperties">
+									<property name="config.local" value="${project.build.testOutputDirectory}" />
+								</ant>
+								<ant antfile="build-setup.xml" dir="scripts" target="templateToConfig">
+									<property name="config.local" value="${project.build.testOutputDirectory}" />
+								</ant>
+							</target>
+						</configuration>
+					</execution>
+					<execution>
+						<id>setup-test-database</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<target unless="skipTests">
+								<!-- default to hsql, override via -D -->
+								<property name="db.type" value="hsql" />
+								<ant antfile="build-setup.xml" dir="scripts" target="deleteTestDb">
+									<property name="config.local" value="${project.build.testOutputDirectory}" />
+									<property name="db.type" value="${db.type}" />
+								</ant>
+								<ant antfile="build.xml" dir="scripts/data" target="all">
+									<property name="config.local" value="${project.build.testOutputDirectory}" />
+									<property name="db.type" value="${db.type}" />
+								</ant>
+							</target>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+
+			<!-- skip unit test run, tests to be executed during integration-test -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+				<executions>
+					<execution>
+						<id>surefire-it</id>
+						<phase>integration-test</phase>
+						<goals>
+							<goal>test</goal>
+						</goals>
+						<configuration>
+							<skip>false</skip>
+							<forkMode>always</forkMode>
+							<systemPropertyVariables>
+								<log4j.configuration>file:${project.basedir}/src/test/resources/log4j.properties</log4j.configuration>
+							</systemPropertyVariables>
+							<additionalClasspathElements>
+								<additionalClasspathElement>${project.basedir}/../ctakes-ytex-res/src/main/resources</additionalClasspathElement>
+							</additionalClasspathElements>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.eclipse.m2e</groupId>
+					<artifactId>lifecycle-mapping</artifactId>
+					<version>1.0.0</version>
+					<configuration>
+						<lifecycleMappingMetadata>
+							<pluginExecutions>
+								<!-- copy-dependency plugin -->
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>org.apache.maven.plugins</groupId>
+										<artifactId>maven-dependency-plugin</artifactId>
+										<versionRange>[1.0.0,)</versionRange>
+										<goals>
+											<goal>copy-dependencies</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<execute>
+											<runOnIncremental>false</runOnIncremental>
+										</execute>
+									</action>
+								</pluginExecution>
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>org.apache.maven.plugins</groupId>
+										<artifactId>maven-antrun-plugin</artifactId>
+										<versionRange>[1.0,)</versionRange>
+										<goals>
+											<goal>run</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<execute>
+											<runOnIncremental>false</runOnIncremental>
+										</execute>
+									</action>
+								</pluginExecution>
+							</pluginExecutions>
+						</lifecycleMappingMetadata>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/build-classpath.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/build-classpath.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/build-classpath.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/build-classpath.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,109 @@
+<project name="ytex.classpath" default="echoproperties" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+	<description>
+	<![CDATA[
+
+	]]>
+	</description>
+	<property environment="env" />
+	<!-- 
+	if this file is imported, figure out the directory in which the file is located 
+	-->
+	<property name="ant.file.ytex.classpath" value="${ant.file}" />
+	<dirname file="${ant.file.ytex.classpath}" property="scripts.dir" />
+	<!--
+	when running in production mode, assume CTAKES_HOME is set
+	when running in development mode, assume CTAKES_HOME=workspace loc which is 2 directories up
+	-->
+	<condition property="ctakes.home.rel" value="${env.CTAKES_HOME}" else="${scripts.dir}/../..">
+		<isset property="env.CTAKES_HOME" />
+	</condition>
+	<!-- convert to absolute path -->
+	<property name="ctakes.home" location="${ctakes.home.rel}" />
+	<!-- set a property to switch between development and production mode -->
+	<condition property="ctakes.dev.mode">
+		<available file="${ctakes.home}/ctakes-ytex" type="dir" />
+	</condition>
+	<!-- 
+	resources directory
+	in development mode use ctakes-ytex-res
+	in production mode, use ctakes.home/resources
+	-->
+	<condition property="ytex.resources.home" value="${ctakes.home}/ctakes-ytex-res/src/main/resources" else="${ctakes.home}/resources">
+		<isset property="ctakes.dev.mode" />
+	</condition>
+	<!-- 
+	generated/local config directory
+	in development mode use build output directory for generated resources
+	in production mode, use ctakes.home/resources
+	-->
+	<condition property="config.local" value="${ctakes.home}/ctakes-ytex/target/classes" else="${ytex.resources.home}">
+		<isset property="ctakes.dev.mode" />
+	</condition>
+	<!-- load ytex properties -->
+	<property file="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+	<!-- 
+	log4j
+	development mode: by default use ytex test log4j props
+	production mode: use ctakes log4j props
+	-->
+	<condition property="log4j.conf" value="${ctakes.home}/ctakes-ytex/src/test/resources/log4j.properties" else="${ctakes.home}/resources/org/apache/ctakes/core/log4j.properties">
+		<isset property="ctakes.dev.mode" />
+	</condition>
+	<!-- set concept graph directory -->
+	<property name="ytex.conceptGraphDir" value="${config.local}/org/apache/ctakes/ytex/conceptGraph" />
+	<!-- metamap -->
+	<condition property="mm.home" value="${env.MM_HOME}">
+		<isset property="env.MM_HOME" />
+	</condition>
+	<!-- directory where ant extension libraries are located -->
+	<condition property="ant.lib.ext" value="${ctakes.home}/ctakes-ytex/target/lib" else="${ctakes.home}/lib">
+		<isset property="ctakes.dev.mode" />
+	</condition>
+	<path id="ant.cp">
+		<pathelement location="${ant.lib.ext}/ant-contrib-1.0b3.jar" />
+	</path>
+	<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" onerror="ignore" classpathref="ant.cp" />
+	<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" onerror="ignore" classpathref="ant.cp" />
+	<taskdef name="propertycopy" classname="net.sf.antcontrib.property.PropertyCopy" onerror="ignore" classpathref="ant.cp" />
+	<taskdef name="math" classname="net.sf.antcontrib.math.MathTask" onerror="ignore" classpathref="ant.cp" />
+	<path id="kernel.cp.dev">
+		<pathelement location="${config.local}" />
+		<dirset dir="${ctakes.home}" includes="**/src/main/resources" />
+		<dirset dir="${ctakes.home}" includes="**/target/classes" />
+		<!--
+		<pathelement location="${ctakes.home}/ctakes-ytex-uima/target/classes" />
+		-->
+		<fileset dir="${ctakes.home}/ctakes-ytex/target/lib" includes="**/*.jar" excludes="**/ant-*.jar" />
+		<fileset dir="${ctakes.home}/ctakes-ytex-uima/target/lib" includes="**/*.jar" excludes="**/ant-*.jar" />
+	</path>
+	<path id="kernel.cp.prod">
+		<pathelement location="${config.local}" />
+		<pathelement location="${ctakes.home}/desc" />
+		<pathelement location="${ctakes.home}/resources" />
+		<fileset dir="${ctakes.home}/lib" includes="**/*.jar" excludes="**/ant*.jar" />
+	</path>
+	<condition property="kernel.cp" value="kernel.cp.dev" else="kernel.cp.prod">
+		<isset property="ctakes.dev.mode" />
+	</condition>
+	<makeurl property="log4j.url" file="${log4j.conf}" />
+	<property name="log4j.configuration" value="${log4j.url}" />
+	<property name="log4j.arg" value="-Dlog4j.configuration=${log4j.configuration}" />
+	<property name="java.util.logging.config.file" value="${java.log.arg}" />
+	<propertyset id="ytex.jvm.props">
+		<propertyref name="log4j.configuration" />
+	</propertyset>
+	<property name="db.name" value="" />
+	<property name="umls.catalog" value="${db.name}" />
+	<property name="umls.schema" value="${db.schema}" />
+	<condition property="umls.prefix" value="">
+		<equals arg1="hsql" arg2="${db.type}" />
+	</condition>
+	<condition property="umls.prefix" value="${umls.catalog}.${umls.schema}." else="${umls.schema}.">
+		<equals arg1="mssql" arg2="${db.type}" />
+	</condition>
+	<target name="echoproperties">
+		<pathconvert property="ant.cp.path" refid="ant.cp" />
+		<pathconvert property="kernel.cp.path" refid="${kernel.cp}" />
+		<echoproperties />
+	</target>
+</project>
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/build-setup.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/build-setup.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/build-setup.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/build-setup.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,121 @@
+<project name="build-setup" default="help">
+	<description>
+		<![CDATA[
+Setup ytex
+
+Main target is 'all', which does the following:
+  * templateToConfig generates configuration files from templates. 
+  * setupDatabase call data/build.xml to setup the database.
+
+You *must* define the ytex.home variable for this script using the -D option:
+ant -Dctakes.home=c:\java\ctakes -file build-setup.xml
+
+To use this in a 'real' environment, you will need an installation of UMLS,
+or you can download a UMLS database dump we've provided.
+
+To set up a development environment using a preexisting database, 
+execute setup.lvg and templateToConfig
+	]]>
+	</description>
+	<!-- override these variables using eclipse settings/command line -->
+	<property name="context.root" value="ytex.web" />
+	<property name="catalina.base" value="${ytex.home}/web" />
+	<target name="help">
+		<echo>
+Ant build script to setup ytex.
+Call with option -projecthelp for more info.
+			${ctakes.url}
+</echo>
+	</target>
+	<import file="build-classpath.xml" />
+	<!-- -->
+	<property name="config.source.dir" value="${ytex.resources.home}" />
+	<property name="config.generated.dir" value="${config.local}" />
+	<property name="test.hsqldb.dir" value="${java.io.tmpdir}/ctakes-test-hsqldb/ctakes" />
+
+	<target name="all" depends="dbping,templateToConfig,setupDatabase" description="calls dbping,setup.ctakes,setup.lvg.all,templateToConfig,setupDatabase" />
+	<target name="dbping" description="verify db connection params">
+		<ant dir="./data" target="dbping" />
+	</target>
+	<target name="setupDatabase" description="setup ytex database tables">
+		<ant dir="./data" target="all" />
+	</target>
+	<target name="templateToConfig.init" description="setup variables for updating template">
+		<condition property="filter.umls.catalog" value="" else="catalog=&quot;${umls.catalog}&quot;">
+			<or>
+				<!-- for mysql/oracle, no catalog - assume umls in same catalog -->
+				<equals arg1="mysql" arg2="${db.type}" />
+				<equals arg1="oracle" arg2="${db.type}" />
+				<!-- if umls.catalog not set, assume in same catalog -->
+				<not>
+					<isset property="umls.catalog" />
+				</not>
+				<!-- if umls catalog same as db, don't bother -->
+				<equals arg1="${umls.catalog}" arg2="${db.name}" />
+			</or>
+		</condition>
+		<!-- default umls schema to ytex schema - this will only be set if umls.schema hasn't been defined -->
+		<property name="umls.schema" value="${db.schema}" />
+		<mkdir dir="${config.generated.dir}" />
+	</target>
+	<target name="templateToConfig.updateConfig" depends="templateToConfig.init" description="update config files">
+		<echo>config.source.dir = ${config.source.dir}</echo>
+		<echo>config.generated.dir = ${config.generated.dir}</echo>
+		<if>
+			<available file="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+			<then>
+				<copy todir="${config.generated.dir}" overwrite="yes">
+					<fileset dir="${config.source.dir}" includes="org/apache/ctakes/ytex/**/*.template.xml" />
+					<globmapper from="*.template.xml" to="*.xml" />
+					<filterset>
+						<!-- with a filter set, the last token overrides previous tokens -->
+						<filtersfile file="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+						<filter token="umls.schema" value="${umls.schema}" />
+						<filter token="filter.umls.catalog" value="${filter.umls.catalog}" />
+						<filter token="ytex.home" value="${ytex.home}" />
+						<filter token="ctakes.home" value="${ctakes.home}" />
+					</filterset>
+				</copy>
+			</then>
+			<else>
+				<echo>Warning! ${config.local}/org/apache/ctakes/ytex/ytex.properties not available, no files generated</echo>
+			</else>
+		</if>
+	</target>
+	<target name="generateTestYtexProperties" description="generate ytex.properties pointing to an hsql database for test purposes.  Defaults to generating hsql properties; override by setting db.type=[xxx].  If that is set, then use src/test/resources/.../ytex.${db.type}.properties">
+		<if>
+			<available file="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+			<then>
+				<echo>${config.local}/org/apache/ctakes/ytex/ytex.properties exists, skipping test ytex.properties generation</echo>
+			</then>
+			<else>
+				<pathconvert targetos="unix" property="ytex.hsql.db">
+					<path>
+						<pathelement location="${test.hsqldb.dir}/ctakes" />
+					</path>
+				</pathconvert>
+				<property name="db.type" value="hsql" />
+				<if>
+					<equals arg1="${db.type}" arg2="hsql" />
+					<then>
+						<echo>${config.local}/org/apache/ctakes/ytex/ytex.properties does not exist, generating ytex.properties for hsqldb in ${ytex.hsql.db}</echo>
+						<copy file="${ctakes.home}/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.hsql.properties.template" tofile="${config.local}/org/apache/ctakes/ytex/ytex.properties">
+							<filterset>
+								<filter token="ytex.hsql.db" value="${ytex.hsql.db}" />
+							</filterset>
+						</copy>
+					</then>
+					<else>
+						<echo>${config.local}/org/apache/ctakes/ytex/ytex.properties does not exist, using ytex.${db.type}.properties</echo>
+						<copy file="${ctakes.home}/ctakes-ytex/src/test/resources/org/apache/ctakes/ytex/ytex.${db.type}.properties" tofile="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+					</else>
+				</if>
+			</else>
+		</if>
+	</target>
+	<target name="deleteTestDb">
+		<delete dir="${test.hsqldb.dir}" quiet="true" />
+	</target>
+	<target name="templateToConfig" depends="templateToConfig.init,templateToConfig.updateConfig" description="generate config files from templates using values specified in ytex.properties">
+	</target>
+</project>

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/build.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/build.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/build.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/build.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,569 @@
+<!--
+-->
+<project name="ytex.data">
+
+	<description>
+		<![CDATA[
+
+This buildfile sets up the ytex database.
+== all ==
+sets up all ytex tables, calls following targets:
+  * umls.all
+  * uima.all
+
+== umls.all ==
+setup umls_aui_fword and v_snomed_fword_lookup table and view.  
+check if mrconso table exists and import umls tables if required.
+If the umls database tables exist, then setup the umls_aui_fword table
+from the database.  If yes, execute umls.setup.db to setup umls_aui_fword 
+from db. If no, execute umls.setup.dump to create and import umls tables
+from dump files.  We look for a umls.zip file in the directory
+that contains ytex.  If it exists, we load the umls tables from that file.
+If not, we load the sample umls tables included in the ytex distro
+
+== uima.all ==
+setup all ytex database tables.  All existing ytex tables
+will be dropped first.
+		
+== configuration ==
+Database connection parameters are taken from ytex.properties.
+	]]>
+	</description>
+	<import file="../build-classpath.xml" />
+
+	<!-- by default umls in same database/catalog as ytex -->
+	<property name="sql.dir" value="./${db.type}" />
+	<property name="meta.tables" value="MRDOC,MRSAB,MRSTY,MRCONSO,MRREL" />
+	<!-- SU is in a different format -->
+	<property name="net.tables" value="SRDEF,SRFIL,SRFLD,SRSTR,SRSTRE1,SRSTRE2" />
+	<property name="sct.home" value="E:/temp/SnomedCT_RF2Release_INT_20110731/Snapshot/Terminology" />
+	<property name="sctf.home" value="E:/temp/SnomedCT_RF2Release_INT_20110731/Full/Terminology" />
+	<property name="sct.version" value="20110731" />
+
+
+	<target name="all" depends="umls.all,uima.all,kernel.all" description="call umls.all, uima.all, kernel.all" />
+	<target name="init" description="initialize flags indicating which db is in use">
+		<condition property="mysql">
+			<equals arg1="${db.type}" arg2="mysql" />
+		</condition>
+		<condition property="mssql">
+			<equals arg1="${db.type}" arg2="mssql" />
+		</condition>
+		<condition property="orcl">
+			<equals arg1="${db.type}" arg2="orcl" />
+		</condition>
+		<condition property="hsql">
+			<equals arg1="${db.type}" arg2="hsql" />
+		</condition>
+		<condition property="umls.data" value="${java.io.tmpdir}" else="${basedir}/umls">
+			<isset property="umls.zip.available" />
+		</condition>
+		<!-- what to do when errors occur while dropping tables.  ignore these for oracle -->
+		<condition property="drop.sql.onerror" value="continue" else="abort">
+			<equals arg1="${db.type}" arg2="orcl" />
+		</condition>
+	</target>
+	<target name="test" depends="init">
+		<echo>umls.zip.available ${umls.zip.available}</echo>
+		<echo>db.schema ${db.schema}</echo>
+		<echo>db.type ${db.type}</echo>
+	</target>
+	<target name="dbping" description="verify db connection params" unless="hsql">
+		<java classname="ytex.tools.DBPing" fork="yes" classpathref="${kernel.cp}" failonerror="yes">
+			<jvmarg value="${log4j.arg}" />
+			<jvmarg value="-Xmx64m" />
+			<arg value="${config.local}/org/apache/ctakes/ytex/ytex.properties" />
+		</java>
+	</target>
+
+	<target name="umls.check.mrconso" description="set mrconso.exists property if mrconso table can be found">
+		<delete file="${java.io.tmpdir}/mrconso-check.txt" quiet="yes" />
+		<if>
+			<equals arg1="${db.type}" arg2="mysql" />
+			<then>
+				<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="${kernel.cp}" output="${java.io.tmpdir}/mrconso-check.txt" print="true" showheaders="false" showtrailers="false">show tables from ${umls.schema} like 'MRCONSO';</sql>
+			</then>
+		</if>
+		<if>
+			<equals arg1="${db.type}" arg2="mssql" />
+			<then>
+				<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="${kernel.cp}" output="${java.io.tmpdir}/mrconso-check.txt" print="true" showheaders="false" showtrailers="false">use ${umls.catalog}; SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'${umls.schema}.[MRCONSO]');</sql>
+			</then>
+		</if>
+		<if>
+			<equals arg1="${db.type}" arg2="orcl" />
+			<then>
+				<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="${kernel.cp}" output="${java.io.tmpdir}/mrconso-check.txt" print="true" showheaders="false" showtrailers="false">select count(*) from all_tables where lower(table_name) = 'mrconso' and lower(owner) = lower('${umls.schema}');</sql>
+			</then>
+		</if>
+		<if>
+			<equals arg1="${db.type}" arg2="hsql" />
+			<then>
+				<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" classpathref="${kernel.cp}" output="${java.io.tmpdir}/mrconso-check.txt" print="true" showheaders="false" showtrailers="false">select count(*) from INFORMATION_SCHEMA.SYSTEM_TABLES where lower(table_name) = 'mrconso' and lower(table_schem) = lower('${umls.schema}');</sql>
+			</then>
+		</if>
+		<loadfile srcFile="${java.io.tmpdir}/mrconso-check.txt" property="mrconso.out" />
+		<echo>mrconso.out = ${mrconso.out}</echo>
+		<delete file="${java.io.tmpdir}/mrconso-check.txt" />
+		<condition property="mrconso.equals" value="mrconso" else="1">
+			<equals arg1="mysql" arg2="${db.type}" />
+		</condition>
+		<condition property="mrconso.exists">
+			<equals arg1="${mrconso.equals}" arg2="${mrconso.out}" casesensitive="false" trim="true" />
+		</condition>
+		<echo>mrconso.exists = ${mrconso.exists}</echo>
+	</target>
+
+	<target name="umls.drop.all" depends="umls.drop.view,umls.dropAuiFword" description="drop umls_aui_fword and v_snomed_fword_lookup" />
+	<target name="umls.all" depends="init,umls.check.mrconso" description="setup umls tables from dump or db, depending on existence of mrconso">
+		<echo>mrconso.exists = ${mrconso.exists}</echo>
+		<if>
+			<isset property="mrconso.exists" />
+			<then>
+				<antcall target="umls.setup.db" />
+			</then>
+			<else>
+				<antcall target="umls.setup.dump" />
+			</else>
+		</if>
+	</target>
+	<target name="umls.mssql.setup" depends="init,umls.check.mrconso" description="setup umls from RRF files for mssql">
+		<!--
+		perform import if mrconso table does not exist
+		and this is ms sql server setup
+		and rrf.home is set 
+		-->
+		<condition property="umls.mssql.import">
+			<and>
+				<isset property="mssql" />
+				<isset property="rrf.home" />
+				<not>
+					<isset property="mrconso.exists" />
+				</not>
+			</and>
+		</condition>
+		<!-- abort if we can't find the RRF files -->
+		<fail message="could not find ${rrf.home}/META/MRCONSO.RRF">
+			<condition>
+				<and>
+					<isset property="umls.mssql.import" />
+					<not>
+						<available file="${rrf.home}/META/MRCONSO.RRF" />
+					</not>
+				</and>
+			</condition>
+		</fail>
+		<!-- do the import if necessary -->
+		<if>
+			<isset property="umls.mssql.import" />
+			<then>
+				<antcall target="umls.mssql.import" />
+			</then>
+		</if>
+	</target>
+	<target name="umls.mssql.import" description="create mssql umls tables, import from RRF files" depends="init.conn">
+		<echo>create umls tables</echo>
+		<for list="mssql_drop.sql,mssql_tables.sql,mssql_net_tables.sql" param="sqlcmd.script">
+			<sequential>
+				<antcall target="jdbc.sqlcmd">
+					<param name="sqlcmd.dir" value="umls" />
+					<param name="db.name" value="${umls.catalog}" />
+					<param name="db.schema" value="${umls.prefix}" />
+					<param name="sqlcmd.script" value="@{sqlcmd.script}" />
+				</antcall>
+			</sequential>
+		</for>
+		<echo>import umls tables</echo>
+		<for list="${meta.tables}" param="rrf.base">
+			<sequential>
+				<antcall target="jdl">
+					<param name="jdl.data" value="${rrf.home}/META/@{rrf.base}.RRF" />
+					<param name="jdl.format" value="${basedir}/umls/@{rrf.base}.xml" />
+				</antcall>
+			</sequential>
+		</for>
+		<for list="${net.tables}" param="rrf.base">
+			<sequential>
+				<antcall target="jdl">
+					<param name="jdl.data" value="${rrf.home}/NET/@{rrf.base}" />
+					<param name="jdl.format" value="${basedir}/umls/@{rrf.base}.xml" />
+				</antcall>
+			</sequential>
+		</for>
+		<echo>index umls tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="umls" />
+			<param name="db.name" value="${umls.catalog}" />
+			<param name="db.schema" value="${umls.schema}" />
+			<param name="sqlcmd.script" value="mssql_indexes.sql" />
+		</antcall>
+	</target>
+	<target name="umls.import.meta" description="create and import MRCONSO and MRSTY tables" depends="init,init.conn">
+		<echo>create umls tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="umls" />
+			<param name="sqlcmd.script" value="import_umls.sql" />
+		</antcall>
+		<echo>import MRCONSO</echo>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${umls.data}/MRCONSO.RRF" />
+			<param name="jdl.format" value="${basedir}/umls/MRCONSO.xml" />
+		</antcall>
+		<echo>import MRSTY</echo>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${umls.data}/MRSTY.RRF" />
+			<param name="jdl.format" value="${basedir}/umls/MRSTY.xml" />
+		</antcall>
+		<echo>index umls tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="index_umls.sql" />
+		</antcall>
+	</target>
+	<target name="umls.setup.dump" depends="umls.drop.view,umls.create.view,umls.import.view,umls.index.view" unless="mrconso.exists" description="load lookup table from export" />
+	<target name="umls.setup.db" depends="umls.setupAuiFword,umls.drop.view,umls.create.view,umls.insert.view,umls.index.view" if="mrconso.exists" description="setup umls_aui_fword from mrconso in db, and generate lookup table by joining mrconso,mrsty, and umls_aui_fword tables" />
+	<target name="umls.setup.import" depends="umls.import.meta,umls.setup.db" if="mrconso.exists" description="import mrconso and mrsty tables, call umls.setup.db" />
+	<target name="umls.dropAuiFword" depends="init" description="drop umls_aui_fword table">
+		<echo>drop ytex umls_aui_fword table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="drop_tables.sql" />
+			<param name="sql.onerror" value="${drop.sql.onerror}" />
+		</antcall>
+	</target>
+	<target name="umls.setupAuiFword" depends="init,umls.dropAuiFword" description="setup umls_aui_fword from mrconso">
+		<echo>create ytex umls_aui_fword tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="create_tables.sql" />
+		</antcall>
+		<echo>setting up umls_aui_fword table. please be patient - this can take a while</echo>
+		<java classname="org.apache.ctakes.ytex.tools.SetupAuiFirstWord" fork="yes" classpathref="${kernel.cp}" failonerror="yes">
+			<jvmarg value="${log4j.arg}" />
+		</java>
+		<echo>index umls_aui_fword tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="create_indices.sql" />
+		</antcall>
+	</target>
+	<target name="umls.unpack" if="umls.zip.available" description="unpack umls from archive">
+		<unzip src="${umls.zip}" dest="${java.io.tmpdir}">
+			<patternset>
+				<include name="**/*.*" />
+				<exclude name="conceptGraph/**/*.*" />
+			</patternset>
+		</unzip>
+	</target>
+	<target name="umls.cleanup" if="umls.zip.available" description="delete unpacked umls files">
+		<delete quiet="yes">
+			<fileset dir="${java.io.tmpdir}" includes="MRREL.RRF,MRCONSO.RRF,MRSTY.RRF,umls_aui_fword.txt" />
+		</delete>
+	</target>
+	<target name="umls.import.view" depends="init.conn">
+		<echo>import v_snomed_fword_lookup.  Be patient, this can take a while.</echo>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${umls.data}/v_snomed_fword_lookup.txt" />
+			<param name="jdl.format" value="${basedir}/umls/v_snomed_fword_lookup.xml" />
+		</antcall>
+	</target>
+	<target name="umls.insert.view" depends="init.conn" description="create view by joining the mrconso, mrsty and umls_aui_fword tables">
+		<if>
+			<available file="${sql.dir}/umls/insert_view.template.sql" />
+			<then>
+				<echo>copying script and replacing UMLS_SCHEMA token with ${umls.schema}</echo>
+				<copy file="${sql.dir}/umls/insert_view.template.sql" tofile="${java.io.tmpdir}/insert_view.template.sql" overwrite="yes">
+					<filterset>
+						<filter token="UMLS_SCHEMA" value="${umls.schema}" />
+					</filterset>
+				</copy>
+			</then>
+			<else>
+				<copy file="${sql.dir}/umls/insert_view.sql" tofile="${java.io.tmpdir}/insert_view.template.sql" overwrite="yes"/>
+			</else>
+		</if>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sql.file" value="${java.io.tmpdir}/insert_view.template.sql" />
+		</antcall>
+	</target>
+	<target name="umls.create.view" depends="init.conn">
+		<echo>create the v_snomed_fword_lookup table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="create_view.sql" />
+		</antcall>
+	</target>
+	<target name="umls.index.view" depends="init.conn">
+		<echo>index the v_snomed_fword_lookup table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="index_view.sql" />
+		</antcall>
+	</target>
+
+	<target name="umls.import.auiFword" depends="init.conn">
+		<echo>drop ytex umls_aui_fword table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="drop_tables.sql" />
+			<param name="sql.onerror" value="${drop.sql.onerror}" />
+		</antcall>
+		<echo>create ytex umls_aui_fword table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="create_tables.sql" />
+		</antcall>
+		<echo>import umls tables into ${umls.schema} schema.  Be patient, this can take a while.</echo>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${umls.data}/umls_aui_fword.txt" />
+			<param name="jdl.format" value="${basedir}/umls/umls_aui_fword.xml" />
+		</antcall>
+	</target>
+	<target name="umls.drop.view" depends="init" description="drop and create umls tables">
+		<echo>drop v_snomed_fword_lookup table</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="drop_view.sql" />
+			<param name="sql.onerror" value="${drop.sql.onerror}" />
+		</antcall>
+	</target>
+	<target name="umls.create.meta" description="create mrconso table">
+		<echo>create nlm's umls tables</echo>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="./umls" />
+			<param name="sqlcmd.script" value="umls.sql" />
+		</antcall>
+	</target>
+	<!-- uima script targets -->
+	<target name="jdbc.sqlcmd">
+		<property name="sql.onerror" value="abort" />
+		<property name="sql.delimiter" value=";" />
+		<property name="sql.catalog" value="${db.name}" />
+		<property name="sql.schema" value="${db.schema}" />
+		<property name="sql.file" value="${sql.dir}/${sqlcmd.dir}/${sqlcmd.script}" />
+		<tempfile property="sql.src" suffix=".sql"  destdir="${java.io.tmpdir}" />
+		<tempfile property="use.sql.file" suffix="use.sql"  destdir="${java.io.tmpdir}" />
+		<echo>execute ${sql.file}</echo>
+		<!-- <property name="sql.src" value="${java.io.tmpdir}/${sqlcmd.script}" /> -->
+		<if>
+			<equals arg1="${db.type}" arg2="mssql" />
+			<then>
+				<echo file="${use.sql.file}">
+use ${sql.catalog}
+${sql.delimiter}					
+</echo>
+				<copy file="${sql.file}" tofile="${sql.src}" overwrite="true">
+					<!-- for mssql replace db_schema and go -->
+					<filterset begintoken="$(" endtoken=")">
+						<filter token="db_schema" value="${db.schema}" />
+						<filter token="umls_catalog" value="${umls.catalog}" />
+						<filter token="umls_schema" value="${umls.schema}" />
+					</filterset>
+					<filterchain>
+						<concatfilter prepend="${use.sql.file}" />
+						<tokenfilter>
+							<replaceregex pattern="\Ago\z" flags="gi" replace="" />
+							<replaceregex pattern="\Wgo\W" flags="gi" replace="" />
+						</tokenfilter>
+					</filterchain>
+				</copy>
+			</then>
+			<else>
+				<if>
+					<equals arg1="${db.type}" arg2="hsql" />
+					<then>
+						<echo file="${use.sql.file}">
+set schema ${sql.schema}
+${sql.delimiter}					
+</echo>
+					</then>
+				</if>
+				<if>
+					<equals arg1="${db.type}" arg2="mysql" />
+					<then>
+						<echo file="${use.sql.file}">
+use ${sql.schema}
+${sql.delimiter}					
+</echo>
+					</then>
+				</if>
+				<if>
+					<equals arg1="${db.type}" arg2="orcl" />
+					<then>
+						<echo file="${java.io.tmpdir}/use.sql">
+ALTER SESSION SET CURRENT_SCHEMA=${sql.schema}
+${sql.delimiter}					
+</echo>
+					</then>
+				</if>
+				<copy file="${sql.file}" tofile="${sql.src}" overwrite="true">
+					<!-- for oracle and mysql use the correct schema -->
+					<filterchain>
+						<concatfilter prepend="${use.sql.file}" />
+					</filterchain>
+				</copy>
+			</else>
+		</if>
+		<echo>executing ${sql.src}</echo>
+		<sql driver="${db.driver}" url="${db.url}" userid="${db.username}" password="${db.password}" src="${sql.src}" onerror="${sql.onerror}" classpathref="${kernel.cp}" delimiter="${sql.delimiter}" />
+		<delete file="${sql.src}" />
+		<delete file="${use.sql.file}" />
+	</target>
+	<target name="jdl" description="load data with java data loader.  used instead of native database utilities.">
+		<echo>jdl.format ${jdl.format}</echo>
+		<echo>jdl.data ${jdl.data}</echo>
+		<echo>umls.prefix ${umls.prefix}</echo>
+		<tempfile property="jdl.format.file" suffix=".xml" deleteonexit="true" destdir="${java.io.tmpdir}"/>
+		<copy file="${jdl.format}" tofile="${jdl.format.file}" overwrite="true">
+			<filterset>
+				<filter token="umls.prefix" value="${umls.prefix}" />
+				<filter token="db.schema" value="${db.schema}" />
+			</filterset>
+		</copy>
+		<java classpathref="${kernel.cp}" classname="org.apache.ctakes.jdl.AppMain" fork="yes" failonerror="yes">
+			<jvmarg value="-Dfile.encoding=UTF-8" />
+			<jvmarg value="-Xmx256m" />
+			<jvmarg value="${log4j.arg}" />
+			<arg value="-c" />
+			<arg value="${java.io.tmpdir}/conn.xml" />
+			<arg value="-d" />
+			<arg value="${jdl.data}" />
+			<arg value="-l" />
+			<arg value="${jdl.format.file}" />
+		</java>
+	</target>
+	<target name="uima.all" description="drop and create ytex uima tables" depends="uima.drop,uima.create" />
+	<target name="uima.drop" description="drop ytex uima tables">
+		<!-- for oracle we don't check existence before dropping objects, so just continue in case of errors -->
+		<condition property="sql.onerror" value="continue" else="abort">
+			<equals arg1="${db.type}" arg2="orcl" />
+		</condition>
+		<for list="drop_view.sql,drop_document.sql,drop_reference.sql" param="sqlcmd.script">
+			<sequential>
+				<antcall target="jdbc.sqlcmd">
+					<param name="sqlcmd.dir" value="uima" />
+					<param name="sqlcmd.script" value="@{sqlcmd.script}" />
+				</antcall>
+			</sequential>
+		</for>
+	</target>
+	<target name="uima.create" depends="init" description="create ytex uima tables">
+		<for list="create_reference.sql,create_document.sql,create_view.sql" param="sqlcmd.script">
+			<sequential>
+				<antcall target="jdbc.sqlcmd">
+					<param name="sqlcmd.dir" value="uima" />
+					<param name="sqlcmd.script" value="@{sqlcmd.script}" />
+				</antcall>
+			</sequential>
+		</for>
+		<antcall target="uima.create.trigger" />
+		<antcall target="uima.ref.load" />
+		<antcall target="uima.examples.load" />
+		<antcall target="uima.stopword.load" />
+	</target>
+	<target name="uima.create.trigger" if="orcl" description="create insert triggers for oracle">
+		<for list="create_reference_trg.sql,create_document_trg.sql" param="sqlcmd.script">
+			<sequential>
+				<antcall target="jdbc.sqlcmd">
+					<param name="sqlcmd.dir" value="uima" />
+					<param name="sqlcmd.script" value="@{sqlcmd.script}" />
+					<param name="sql.delimiter" value="/" />
+				</antcall>
+			</sequential>
+		</for>
+	</target>
+	<target name="uima.ref.load" depends="init,init.conn">
+		<antcall target="jdl">
+			<param name="jdl.data" value="ref_uima_type.txt" />
+			<param name="jdl.format" value="ref_uima_type.xml" />
+		</antcall>
+	</target>
+	<target name="uima.stopword.load" depends="init,init.conn">
+		<antcall target="jdl">
+			<param name="jdl.data" value="stopword.txt" />
+			<param name="jdl.format" value="stopword.xml" />
+		</antcall>
+	</target>
+	<target name="uima.examples.load" depends="init,init.conn">
+		<antcall target="jdl">
+			<param name="jdl.data" value="examples/fracture_demo.txt" />
+			<param name="jdl.format" value="examples/fracture_demo.xml" />
+		</antcall>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="uima" />
+			<param name="sqlcmd.script" value="fracture_demo.sql" />
+		</antcall>
+	</target>
+	<target name="init.conn">
+		<copy file="${basedir}/conn.xml.template" tofile="${java.io.tmpdir}/conn.xml" overwrite="yes">
+			<filterset>
+				<filter token="db.driver" value="${db.driver}" />
+				<filter token="db.url" value="${db.url}" />
+				<filter token="db.username" value="${db.username}" />
+				<filter token="db.password" value="${db.password}" />
+			</filterset>
+		</copy>
+	</target>
+	<target name="kernel.all" description="drop and create tables for data mining" depends="kernel.drop,kernel.create" />
+	<target name="kernel.drop" description="create tables for data mining">
+		<condition property="drop.sql.onerror" value="continue" else="abort">
+			<equals arg1="${db.type}" arg2="orcl" />
+		</condition>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="kernel" />
+			<param name="sqlcmd.script" value="drop_tables.sql" />
+			<param name="sql.onerror" value="${drop.sql.onerror}" />
+		</antcall>
+	</target>
+	<target name="kernel.create" description="create tables for data mining">
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="kernel" />
+			<param name="sqlcmd.script" value="create_tables.sql" />
+		</antcall>
+		<if>
+			<equals arg1="${db.type}" arg2="orcl" />
+			<then>
+				<antcall target="jdbc.sqlcmd">
+					<param name="sqlcmd.dir" value="kernel" />
+					<param name="sqlcmd.script" value="create_tables_trg.sql" />
+					<param name="sql.delimiter" value="/" />
+				</antcall>
+			</then>
+		</if>
+	</target>
+	<target name="sct.all" depends="sct.create,sct.load" description="import snomed-ct snapshot tables" />
+	<target name="sctf.all" description="import snomed-ct full tables">
+		<antcall target="sct.all">
+			<param name="prefix" value="sct2f" />
+			<param name="suffix" value="full" />
+			<param name="sct.home" value="${sctf.home}" />
+		</antcall>
+	</target>
+	<target name="sct.create" description="create snomed-ct tables">
+		<property name="suffix" value="" />
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="snomedct" />
+			<param name="sqlcmd.script" value="create_tables${suffix}.sql" />
+		</antcall>
+	</target>
+	<target name="sct.load" depends="init.conn" description="load snomed-ct tables">
+		<property name="suffix" value="" />
+		<property name="prefix" value="sct2" />
+		<antcall target="jdl">
+			<param name="jdl.data" value="${sct.home}/${prefix}_Concept_Snapshot_INT_${sct.version}.txt" />
+			<param name="jdl.format" value="${basedir}/snomedct/${prefix}_concept.xml" />
+		</antcall>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${sct.home}/${prefix}_Relationship_Snapshot_INT_${sct.version}.txt" />
+			<param name="jdl.format" value="${basedir}/snomedct/${prefix}_relationship.xml" />
+		</antcall>
+		<antcall target="jdl">
+			<param name="jdl.data" value="${sct.home}/${prefix}_Description_Snapshot-en_INT_${sct.version}.txt" />
+			<param name="jdl.format" value="${basedir}/snomedct/${prefix}_description.xml" />
+		</antcall>
+		<antcall target="jdbc.sqlcmd">
+			<param name="sqlcmd.dir" value="snomedct" />
+			<param name="sqlcmd.script" value="index_tables${suffix}.sql" />
+		</antcall>
+	</target>
+</project>
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/conn.xml.template
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/conn.xml.template?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/conn.xml.template (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/conn.xml.template Mon Dec 16 16:30:30 2013
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<conn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://jdl-prj.googlecode.com/files/xdl.xsd">
+	<jdbc>
+		<driver>@db.driver@</driver>
+		<url>@db.url@</url>
+		<username>@db.username@</username>
+		<password>@db.password@</password>
+	</jdbc>
+</conn>
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.txt
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.txt?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.txt (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.txt Mon Dec 16 16:30:30 2013
@@ -0,0 +1,31 @@
+1	la	An AP, lateral, and sunrise view of the left knee is obtained.  A  standing view of both knees is<br/>obtained. A Rosenberg view is also obtained.  <br/>       <br/>On the left, bony mineralization is normal. There is evidence of a lateral tibial plateau fracture.<br/>Soft tissues demonstrate arterial calcification.  <br/>       <br/>Chondrocalcinosis identified involving the lateral compartment of the knee. There is moderate <br/>narrowing of the medial and lateral compartment of the left knee. The appearance and left knee<br/>similar to May 1, 2011. 	fracture	train
+2	chicago	Findings: At the fourth distal metatarsal there is a oblique fracture with slight lateral <br/>displacement.  There are no other acute fractures or dislocations. There is moderate <br/>degenerative changes of the first tarsal- metatarsal joint with subchondral cysts and osteophyte <br/>formation. The soft tissues are within normal limits. There is ossification of the interosseous <br/>membrane due to prior trauma.  	fracture	train
+3	la	An AP upright image that extends from the pelvis to the ankles is provided for interpretation.<br/>There is a right knee arthroplasty. There is no apparent leg length discrepancy.  	no fracture	train
+4	chicago	Impression:<br/>       <br/>Left knee 3 views, 12/1/2011: <br/>       <br/>Comparison is made to previous examination of 2/26/2011.  <br/>       <br/>There is a knee prosthesis in place. There is no radiographic evidence of loosening of the <br/>prosthesis. There are no fractures or dislocations. Allowing for technical differences, there has<br/>been no change from 2/26/2011.  <br/>	no fracture	train
+5	la	Impression:<br/>       <br/>since 10/2/2007, views of the pelvis and right hip are unchanged except for minimal overgrowth of <br/>the lateral aspect of the acetabular roof apophysis. No other evidence of degenerative changes <br/>seen. No other interval change.  	no fracture	train
+6	chicago	Lungs are clear focal consolidation. Tracheobronchial tree is patent.  No lung masses or nodules<br/>appreciated. There are no pleural pericardial effusions. Right lower base pleural thickening is <br/>stable.  There is no axillary, hilar, or mediastinal lymphadenopathy by CT size criteria. The <br/>visualized thyroid is normal.  	no fracture	train
+7	la	Study:  Bilateral standing knees one view.  <br/>       <br/>Findings: AP, standing view of both knees is compared to previous exam of 04/2011. There has been <br/>no significant interval change in the appearance of the knees. Again there is an intramedullary<br/>fracture in the tibia. Joint space narrowing is noted at the lateral compartment of the left knee.  	fracture	train
+8	chicago	Opacification of the frontal sinus on the right side.  Linear streaking of the occipital bone,<br/>likely a non displaced fracture.	fracture	train
+9	la	Right humerus 2 views, 7/14/2012 <br/>       <br/>There is a shoulder prosthesis in place.  There is no radiographic evidence of loosening of the <br/>prosthesis.  Overall position and alignment is anatomic. A fracture of the distil humerus is noted.<br/>The remainder of the humerus is unremarkable.	fracture	train
+10	chicago	Chest reveals linear opacity in right base which could be due to atelectasis since January 16, 2011.<br/>There is no   congestive heart failure, infiltrate. There are degenerative changes in thoracic <br/>spine. There are vascular calcifications in the thoracic aorta.  Accounting for differences in <br/>technique there is no significant interval change.  <br/>       <br/>Conclusion: No acute cardiopulmonary disease.  	no fracture	train
+11	la	Findings:  The heart is not enlarged.  There is no congestive failure.  The lungs are clear.  There<br/>is no adenopathy or pleural effusion.  There are old healed fractures of the left second through <br/>sixth ribs and an old fracture of the left clavicle. There are degenerative changes in the spine.  <br/>       <br/>Conclusion:  No active cardiopulmonary disease.  No interval change.	fracture	train
+12	chicago	Impression:<br/>Views of the hand and thumb accomplished on May 6, 2011.  <br/>       <br/>The interphalangeal joint shows mild narrowing. Osseous structures are normally developed and <br/>well-preserved. The MP joint of the thumb shows some eburnation and narrowing particularly of the<br/>lateral aspect of the joint. The metacarpal articulation with the greater multangular has some mild <br/>eburnation and some pseudocystic change is that joint is well.  <br/>       <br/>Summary: osteoarthritic changes. The most prominent changes are of the proximal and distal <br/>articulations of the first metacarpal<br/>	no fracture	train
+13	la	Views of the coccyx and sacrum dated January 21, 2009.  <br/>       <br/>normal osseous development and no fracture is seen. The SI joints are normal. Soft tissues are <br/>normal <br/>       <br/>Summary: no fracture is seen. Note that injuries of the coccyx are not always visible on <br/>radiographs and this study needs to be augmented by physical exam.  	no fracture	train
+14	chicago	Impression:<br/>PA and lateral chest accomplished on January 20, 2012.  <br/>       <br/>The heart and mediastinal contours are normal. Hilar structures and pulmonary vessels are normal as<br/>well. There no acute infiltrates or effusions.  An old fracture of the left third rib is evident.	fracture	train
+15	la	Menisci: There is intrasubstance degeneration in the lateral meniscus without discrete tear. There<br/>is complex degeneration of the posterior horn and body of the medial meniscus with extrusion.  <br/>       <br/>Tendons: The quadriceps and patellar tendons are intact.  <br/>       <br/>Ligaments: There is increased signal within it the ACL consistent with degeneration. The PCL, LCL <br/>and MCL appear intact.  <br/>       <br/>Bone/cartilage: There are tricompartmental degenerative changes. There are extensive degenerative <br/>changes in the medial compartment with diffuse cartilage loss in the weight bearing region. There <br/>is moderate thinning of the anterior aspect of the lateral femoral condyle cartilage with mild <br/>heterogeneity. There is heterogeneity of the patellofemoral cartilage.  Note is made of a distil <br/>femur hairline fracture not previously noted.	fracture	train
+16	chicago	The study was compared to the prior dated 04/09/2011.  The liver is heterogeneous with no focal <br/>lesion. There is status post cholecystectomy. The common bile duct measures 3.4 mm.The portal<br/>vein is patent and demonstrate hepatopetal flow. The kidneys are normal in size measuring 10.1 cm<br/>on the right and 10.2 cm on the left side. No hydronephrosis is noted. A hypoechogenic lesion in<br/>the superior pole of the right kidney is noted measuring 1.6 x 1.2 cm that may suggest a cyst.. The<br/>infrarenal abdominal aorta measures 2.2 x 2.1 cm. Again bilateral aneurysm of common iliac arteries<br/>is noted measuring 1.8 x 1.9 cm on the right and 1.6 x 1.9 cm in the left side.  There is no fluid <br/>in the Morrison's pouch. The spleen is normal in size and echotexture.  <br/>       <br/>Conclusion: <br/>       <br/>Heterogeneous liver with no focal lesion. Stable aneurysm of common iliac arteries.  	no fracture	train
+17	la	AP and lateral view of the left lower leg is obtained.  <br/>       <br/>Bony mineralization is normal. There is no evidence of a fracture.  Soft tissues are unremarkable.  <br/>       <br/>Clips noted posteriorly in the soft tissues.  <br/>       <br/>CONCLUSION: <br/>       <br/>1. No acute process	no fracture	train
+18	chicago	An AP of the left hand and 3 additional views of the fourth digit were done. There is a non <br/>dislocated fracture. No other significant bone or joint abnormality.  	fracture	train
+19	la	Diffuse osteopenia with evidence of L1-2 compression fracture.	fracture	train
+20	chicago	Impression:<br/>Routine views of the left foot demonstrate normal development and no fracture or dislocation. No <br/>foreign bodies seen.  There is probable soft tissue swelling about the head of the metatarsals and<br/>there is some minimal vascular calcification noted. 	no fracture	train
+21	la	There is no evidence of axillary, hilar or mediastinal adenopathy. The great vessels are normal<br/>throughout their course. There is extensive calcification of the coronary arteries as well as <br/>some calcification of the aorta. The thyroid gland is normal. <br/>       <br/>The visualized unenhanced liver, spleen, pancreas, adrenal glands and kidneys are grossly normal.  <br/>       <br/>There are no lytic or sclerotic lesions visualized.  	fracture	test
+22	chicago	Findings: There is now evidence of a nondisplaced fracture involving the right superior pubic ramus <br/>close to the symphysis.  There is diffuse osteopenia with a stable old healed right <br/>intertrochanteric fracture with internal stabilization as well as a left subcapital fracture <br/>internally stabilized as well. There is an old left ischiopubic junction fracture deformity. Sacrum<br/>and coccyx are mostly obscured by bowel content. There is heavy aorto iliac and branch <br/>calcification.  <br/>       <br/>Conclusion: Nondisplaced right superior pubic ramus fracture.	fracture	test
+23	la	There is no rib fracture, rib abnormality, pneumothorax, or pleural effusion. Other than for <br/>clearing of the lungs, the chest examination has not changed from 2/29/2011. Cardiomediastinal<br/>silhouette is stable. There are sternotomy wires. There is no evidence of congestive failure and <br/>the lungs are now clear.  <br/>       <br/>Conclusion: <br/>       <br/>No acute rib fracture, pneumothorax, or pleural effusion. No active cardiopulmonary disease. Other <br/>than for the clearing of the lungs, no significant interval change from 2/9/2011.  	no fracture	test
+24	chicago	Study:  Left knee 3 views.  <br/>       <br/>Findings: AP, lateral and sunrise views of the left knee are compared to previous exam of <br/>05/07/2011. Accounting for difference in technique, has been no significant interval change in the<br/>appearance of the left knee. Again there is tricompartmental degenerative arthropathy with joint<br/>space narrowing which is worst at the lateral facet of the patellofemoral joint, and <br/>tricompartmental osteophytes.  There is no significant knee joint effusion.  <br/>	no fracture	test
+25	la	Findings: Multiple images of the right shoulder reveal a full thickness, near full width tear of <br/>supraspinatus tendon with a few anterior fibers remaining. There is approximately 3 cm retraction <br/>of the myotendinous junction. In addition, there is a small, articular surface tear of the <br/>infraspinatus tendon at its insertion with laminar extension into the myotendinous junction.<br/>There is mild fatty atrophy of the supraspinatus and moderate fatty atrophy of the infraspinatus <br/>muscle. Overall there is diffuse muscular fatty atrophy throughout the shoulder musculature. There <br/>is superior subluxation of the humeral head. There is increased longitudinal signal and thickening <br/>of the interarticular portion of the biceps tendon consistent with a split tear. Thickening and <br/>increased signal of the subscapularis tendon is consistent with tendinopathy.  	no fracture	test
+26	chicago	Left fifth finger multiple views, 5/5/2015: <br/>   <br/>  Comparison: 4/10/2015.  <br/>   <br/>  Findings: And AP of the left hand and for additional views of the fifth<br/>  finger are provided for interpretation.  <br/>   <br/>  There is a healing comminuted spiral fracture of the proximal phalanx of the<br/>  fifth digit. Other than for signs of healing, there has been no significant<br/>  interval change from the previous examination.<br/>	fracture	test
+27	la	Comparison is made to the previous examination of 5/23/2011.  <br/>       <br/>The heart is not enlarged. There is no evidence of congestive failure.  The lungs are clear. There<br/>is no adenopathy or pleural effusion.  <br/>       <br/>Conclusion: <br/>       <br/>No active cardiopulmonary disease. No significant interval change.  <br/>	no fracture	test
+28	chicago	Left fifth digit multiple views, 6/16/2066: <br/>   <br/>  An AP of the left hand and 3 additional views of the left fifth digit are<br/>  provided were done. There is a comminuted spiral fracture of the proximal<br/>  phalanx of the fifth digit with medial and dorsal angulation of the major<br/>  distal fracture fragment.  <br/>	fracture	test
+29	la	Clinical History<br/>  Man had cxr today f/u after fall 2-05 and per radiologist request left rib <br/>  views today to better view 9th rib left and adjacent ribs; still some pain <br/>  there.  thanks <br/><br/>Impression<br/>  LEFT RIBS:  10/10/2012 <br/>   <br/>  Four views of the left ribs reveal fractures of the left ribs at the mid<br/>  axillary line of the left 5, 6, 7, 8 and 9th ribs.  This was not shown on the<br/>  previous study.  There is no definite hemothorax on the left side. <br/>	fracture	test
+30	chicago	There is a non dislocated fracture in the second digit of the right hand. <br/>No other significant bone or joint abnormality.  	fracture	test
+31	la	Retroperitoneal ultrasound from 3/30/2011 is compared to the prior from 9/3/2011.  <br/>       <br/>Findings: Right kidney measures 11.3 cm and left kidney measures 11.7 cm in length. No evidence <br/>for hydronephrosis. Spleen measures 10.4 cm in the craniocaudal dimension.  heterogenous liver <br/>with no focal lesions. Liver measures 16 cm in the craniocaudal dimension.  Hepatopetal flow in <br/>the portal vein. CBD measures 4 mm and is within normal limits. Gallbladder and pancreas is <br/>unremarkable. No evidence for aortic aneurysm. No free fluid.  <br/>       <br/>Conclusion: 1.  heterogenous liver with no focal lesions.	no fracture	test

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.xml
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.xml?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.xml (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/examples/fracture_demo.xml Mon Dec 16 16:30:30 2013
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<load xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://jdl-prj.googlecode.com/files/xdl.xsd">
+	<csv table="@db.schema@.fracture_demo" commit="2" delimiter="&#009;">
+		<column name="note_id" skip="true" />
+		<column name="site_id" />
+		<column name="note_text" />
+		<column name="fracture" />
+		<column name="note_set" />
+	</csv>
+</load>
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/create_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/create_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/create_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/create_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,250 @@
+
+CREATE CACHED TABLE  kernel_eval (
+	kernel_eval_id IDENTITY,
+	corpus_name varchar(50) DEFAULT '' NOT NULL  ,
+	experiment varchar(50) not null ,
+	label varchar(50) default '' not NULL ,
+	cv_fold_id int default 0 not null ,
+	param1 double default 0 not null ,
+	param2 varchar(50) default '' not null 
+) 
+;
+CREATE unique index NK_kernel_eval on kernel_eval (corpus_name, experiment, label, cv_fold_id, param1, param2)
+;
+
+CREATE CACHED TABLE kernel_eval_instance (
+	kernel_eval_instance IDENTITY,
+	kernel_eval_id int not null ,
+	instance_id1 bigint NOT NULL,
+	instance_id2 bigint NOT NULL,
+	similarity double NOT NULL
+) ;
+CREATE index IX_kernel_eval1 on kernel_eval_instance(kernel_eval_id, instance_id1);
+CREATE index IX_kernel_eval2  on kernel_eval_instance(kernel_eval_id, instance_id2);
+create UNIQUE index NK_kernel_eval_instance on kernel_eval_instance(kernel_eval_id, instance_id1, instance_id2);
+
+CREATE CACHED TABLE classifier_eval (
+	classifier_eval_id IDENTITY,
+	name varchar(50) not null,
+	experiment varchar(50) default '' null ,
+	fold int null,
+	run int null,
+	algorithm varchar(50) default '' null ,
+	label varchar(50) default '' null ,
+	options varchar(1000) default '' null ,
+	model LONGVARBINARY null,
+	param1 double NULL,
+	param2 varchar(50) NULL
+) ;
+
+CREATE CACHED TABLE classifier_eval_svm (
+	classifier_eval_id int not null ,
+	cost double DEFAULT '0',
+  	weight varchar(50),
+	degree int DEFAULT '0',
+	gamma double DEFAULT '0',
+	kernel int NULL,
+	supportVectors int null,
+	vcdim double null
+) ;
+
+CREATE CACHED TABLE classifier_eval_semil (
+	classifier_eval_id int not null ,
+	distance varchar(50),
+	degree int default 0 not null ,
+	gamma double default 0 not null,
+	soft_label bit default 0 not null,
+	norm_laplace bit default 0 not null,
+	mu double default 0 not null,
+	lambda double default 0 not null,
+	pct_labeled double default 0 not null
+) ;
+
+CREATE CACHED TABLE classifier_eval_ir (
+	classifier_eval_ir_id int IDENTITY,
+	classifier_eval_id int not null ,
+	ir_type varchar(5) not null ,
+	ir_class varchar(5) not null ,
+	ir_class_id int null ,
+	tp int not null,
+	tn int not null,
+	fp int not null,
+	fn int not null,
+	ppv double default 0 not null,
+	npv double default 0 not null ,
+	sens double default 0 not null,
+	spec double default 0 not null,
+	f1 double default 0 not null
+) ;
+create unique index NK_classifier_eval_ircls on classifier_eval_ir(classifier_eval_id, ir_type, ir_class);
+create index IX_classifier_eval_id on classifier_eval_ir (classifier_eval_id);
+
+CREATE CACHED TABLE classifier_instance_eval (
+	classifier_instance_eval_id int identity,
+	classifier_eval_id int not null ,
+	instance_id bigint not null,
+	pred_class_id int not null,
+	target_class_id int null
+) 
+;
+create unique index nk_result on classifier_instance_eval(classifier_eval_id, instance_id)
+;
+
+CREATE CACHED TABLE classifier_instance_eval_prob (
+	classifier_eval_result_prob_id int identity,
+	classifier_instance_eval_id int ,
+	class_id int not null,
+	probability double not null
+) ;
+create unique index nk_result_prob on classifier_instance_eval_prob (classifier_instance_eval_id, class_id);
+
+
+CREATE CACHED TABLE cv_fold (
+  cv_fold_id int identity,
+  corpus_name varchar(50) not null ,
+  split_name varchar(50) default '' not null ,
+  label varchar(50) default ''  not null ,
+  run int default 0 not null ,
+  fold int default 0 not null 
+)
+;
+create unique index  nk_cv_fold on cv_fold(corpus_name, split_name, label, run, fold)
+;
+
+CREATE CACHED TABLE cv_fold_instance (
+  cv_fold_instance_id int identity,
+  cv_fold_id int not null,
+  instance_id bigint not null,
+  train bit default 0 not null 
+) 
+;
+create  unique index nk_cv_fold_instance on cv_fold_instance (cv_fold_id, instance_id, train)
+;
+
+CREATE CACHED TABLE cv_best_svm (
+  corpus_name varchar(50) NOT NULL,
+  label varchar(50) NOT NULL,
+  experiment varchar(50) DEFAULT '' NOT NULL,
+  f1 double NULL,
+  kernel int NULL,
+  cost double NULL,
+  weight varchar(50) NULL,
+  param1 double NULL,
+  param2 varchar(50) NULL,
+  PRIMARY KEY (corpus_name,label,experiment)
+) ;
+
+CREATE CACHED TABLE feature_eval (
+  feature_eval_id int identity,
+  corpus_name varchar(50) not null ,
+  featureset_name varchar(50) DEFAULT '' NOT NULL ,
+  label varchar(50) DEFAULT '' NOT NULL  ,
+  cv_fold_id int default 0 not null  ,
+  param1 double default 0 not null  ,
+  param2 varchar(50) DEFAULT '' NOT NULL ,
+  type varchar(50) not null
+)
+;
+create unique index nk_feature_eval on feature_eval (corpus_name, featureset_name, label, cv_fold_id, param1, param2, type)
+;
+create index ix_feature_eval on feature_eval(corpus_name, cv_fold_id, type)
+;
+
+CREATE CACHED TABLE feature_rank (
+  feature_rank_id int identity,
+  feature_eval_id int not null ,
+  feature_name varchar(50) not null ,
+  evaluation double default 0 not null  ,
+  rank int default 0 not null
+) ;
+create unique index nk_feature_name on feature_rank(feature_eval_id, feature_name);
+create index ix_feature_rank on feature_rank(feature_eval_id, rank);
+create index ix_feature_evaluation on feature_rank(feature_eval_id, evaluation);
+create index fk_feature_eval on feature_rank(feature_eval_id);
+
+CREATE CACHED TABLE feature_parchd (
+  feature_parchd_id int IDENTITY,
+  par_feature_rank_id int NOT NULL ,
+  chd_feature_rank_id int NOT NULL
+) 
+;
+create UNIQUE index NK_feature_parent on feature_parchd(par_feature_rank_id,chd_feature_rank_id)
+;
+
+CREATE CACHED TABLE tfidf_doclength (
+  tfidf_doclength_id int identity,
+  feature_eval_id int NOT NULL ,
+  instance_id bigint NOT NULL,
+  length int DEFAULT 0 NOT NULL
+)
+;
+create  UNIQUE index nk_instance_id on tfidf_doclength(feature_eval_id,instance_id)
+;
+
+CREATE CACHED TABLE hotspot (
+  hotspot_id int identity,
+  instance_id int not null ,
+  anno_base_id int not null ,
+  feature_rank_id int not null
+) ;
+create unique index NK_hotspot on hotspot(instance_id, anno_base_id, feature_rank_id);
+create INDEX ix_hotspot_instance_id on hotspot(instance_id);
+create INDEX ix_hotspot_anno_base_id on hotspot(anno_base_id);
+create INDEX ix_hotspot_feature_rank_id on hotspot(feature_rank_id);
+
+CREATE CACHED TABLE hotspot_instance (
+    hotspot_instance_id int identity,
+    corpus_name varchar(50) not null,
+    experiment varchar(50) DEFAULT '' NOT NULL,
+    label varchar(50) DEFAULT '' NOT NULL,
+    instance_id int not null,
+    max_evaluation double default 0 not null ,
+    min_rank int default 0 not null
+) 
+;
+create unique index NK_hotspot_instance on hotspot_instance (corpus_name, experiment, label, instance_id);
+
+CREATE CACHED TABLE hotspot_sentence (
+    hotspot_sentence_id int identity,
+    hotspot_instance_id int not null ,
+    anno_base_id int not null ,
+    evaluation double default 0 not null  ,
+    rank int default 0 not null 
+)
+;
+create unique index NK_hotspot_sentence on hotspot_sentence(hotspot_instance_id, anno_base_id);
+create index FK_hotspot_instance_id on hotspot_sentence(hotspot_instance_id);
+create index FK_anno_base_id on hotspot_sentence(anno_base_id);
+create index IX_evaluation on hotspot_sentence(hotspot_instance_id, evaluation);
+create index IX_rank on hotspot_sentence(hotspot_instance_id, rank);
+
+CREATE CACHED TABLE corpus_doc (
+	corpus_name varchar(50) not null ,
+	instance_id bigint not null ,
+	doc_text LONGVARCHAR,
+	doc_group varchar(50) NULL,
+	primary key (corpus_name, instance_id)
+)
+;
+create index IX_doc_group on corpus_doc(corpus_name, doc_group)
+;
+
+CREATE CACHED TABLE corpus_label (
+	corpus_name varchar(50) not null ,
+	instance_id bigint not null ,
+	label varchar(20) DEFAULT '' NOT NULL,
+	class varchar(5) DEFAULT '' NOT NULL,
+	primary key (corpus_name, instance_id, label)
+)
+;
+create index FK_corpus_doc on corpus_label(corpus_name, instance_id)
+;
+
+create view v_corpus_group_class
+as
+select distinct d.corpus_name, l.label, doc_group, class
+from corpus_doc d
+inner join corpus_label l 
+    on d.corpus_name = l.corpus_name 
+    and d.instance_id = l.instance_id
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/drop_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/drop_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/drop_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/drop_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,21 @@
+drop view if exists v_corpus_group_class;
+drop table if exists hotspot_sentence;
+drop table if exists hotspot_instance;
+drop table if exists hotspot;
+drop table if exists feature_parchd;
+drop table if exists feature_rank;
+drop table if exists feature_eval;
+drop table if exists tfidf_doclength; 
+drop table if exists cv_fold;
+drop table if exists cv_fold_instance;
+drop table if exists cv_best_svm;
+drop table if exists classifier_instance_eval_prob;
+drop table if exists classifier_instance_eval;
+drop table if exists classifier_eval_svm;
+drop table if exists classifier_eval_semil;
+drop table if exists classifier_eval_ir;
+drop table if exists classifier_eval;
+DROP TABLE IF EXISTS kernel_eval;
+DROP TABLE IF EXISTS kernel_eval_instance;
+drop table if exists corpus_label;
+drop table if exists corpus_doc;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_copy.template.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_copy.template.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_copy.template.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_copy.template.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,21 @@
+-- create a feature_eval record for the concept graph
+delete r
+from feature_eval e inner join feature_rank r on e.feature_eval_id = r.feature_eval_id
+where param2 = '@ytex.conceptGraphName@' 
+and type = 'intrinsic-infocontent';
+
+delete e
+from feature_eval e
+where param2 = '@ytex.conceptGraphName@' 
+and type = 'intrinsic-infocontent';
+
+insert into feature_eval (corpus_name, param2, type) values ('', '@ytex.conceptGraphName@', 'intrinsic-infocontent');
+
+-- copy the feature_rank records from tmp_ic
+insert into feature_rank (feature_eval_id, feature_name, evaluation, rank)
+select feature_eval_id, feature_name, evaluation, rank
+from feature_eval, tmp_ic
+where param2 = '@ytex.conceptGraphName@' and type = 'intrinsic-infocontent';
+
+-- cleanup
+drop table tmp_ic;
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_create.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_create.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_create.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/kernel/ic_create.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,8 @@
+-- create temporary table to hold feature_rank records
+drop TABLE if exists tmp_ic
+;
+create table tmp_ic(
+  feature_name varchar(50) not null,
+  evaluation double not null,
+  rank int not null
+);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_document.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_document.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_document.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_document.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,208 @@
+CREATE CACHED TABLE document(
+	document_id int NOT NULL primary key,
+	instance_id bigint default 0 not null,
+	instance_key varchar(256) null,
+	analysis_batch varchar(50) NOT NULL,
+	cas LONGVARBINARY NULL,
+	doc_text longvarchar NULL
+)
+;
+
+CREATE INDEX IX_document_analysis_batch ON document 
+(
+	analysis_batch,
+	document_id
+)
+;
+
+CREATE INDEX IX_instance_id ON document 
+(
+	instance_id
+)
+;
+
+CREATE INDEX IX_instance_key ON document 
+(
+	instance_key
+)
+;
+CREATE CACHED TABLE anno_base (
+	anno_base_id int not null primary key,
+	document_id int not null,
+	span_begin int,
+	span_end int,
+	uima_type_id int not null
+)
+;
+
+
+create INDEX IX_type_span on anno_base(document_id, span_begin, span_end, uima_type_id);
+create INDEX IX_type on anno_base(document_id, uima_type_id);
+CREATE INDEX IX_docanno_doc ON anno_base (document_id);
+
+CREATE CACHED TABLE anno_sentence (
+	anno_base_id int not null primary key,
+	sentenceNumber int,
+	segmentId varchar(20)
+);
+
+CREATE CACHED TABLE anno_named_entity (
+	anno_base_id int not null primary key,
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20)
+);
+
+CREATE CACHED TABLE anno_med_event (
+	anno_base_id int not null primary key,
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20),
+	freqNumber varchar(10) ,
+	freqUnit varchar(10) ,
+	strengthNumber varchar(10) ,
+	strengthUnit varchar(10) ,
+	change varchar(10),
+	dosage varchar(10)
+);
+
+
+CREATE CACHED TABLE anno_ontology_concept (
+	anno_ontology_concept_id int IDENTITY not null primary key,
+	anno_base_id int not null ,
+	code varchar(20) ,
+	cui char(8) ,
+	disambiguated bit default 0 not null
+);
+create index IX_anno_base_id on anno_ontology_concept(anno_base_id);
+create index IX_code on anno_ontology_concept(code);
+create index IX_anno_code on anno_ontology_concept(anno_base_id,code);
+create index IX_anno_cui on anno_ontology_concept(anno_base_id,cui);
+
+CREATE CACHED TABLE anno_segment(
+	anno_base_id int NOT NULL  ,
+	id varchar(20) NULL,
+PRIMARY KEY
+(
+	anno_base_id 
+)
+)
+;
+
+CREATE INDEX IX_segment_anno_seg ON anno_segment
+(
+	anno_base_id,
+	id
+)
+;
+
+-- mapped to BaseToken, WordToken
+CREATE CACHED TABLE anno_token (
+	anno_base_id int NOT NULL PRIMARY KEY ,
+	tokenNumber int default 0 NOT NULL ,
+	normalizedForm varchar(20) ,
+	partofSpeech varchar(5) ,
+	coveredText varchar(20) null,
+	capitalization int default 0 not null ,
+	numPosition int default 0 not null ,
+	suggestion varchar(20) ,
+	canonicalForm varchar(20)
+) ;
+create index IX_coveredText on anno_token(coveredText);
+create index IX_canonicalForm on anno_token(canonicalForm);
+
+CREATE CACHED TABLE anno_date (
+	anno_base_id int not null primary key,
+	tstamp datetime
+) ;
+
+CREATE CACHED TABLE anno_markable (
+	anno_base_id int not null primary key ,
+	id int default 0,
+	anaphoric_prob double default 0,
+	content int default 0
+) ;
+
+CREATE CACHED TABLE anno_treebank_node (
+	anno_base_id int not null primary key ,
+	parent int default 0,
+	nodeType varchar(10),
+	nodeValue varchar(10),
+	leaf bit default 0,
+	headIndex int default 0,
+	index int default 0,
+	tokenIndex int default 0
+) ;
+
+CREATE CACHED TABLE anno_link (
+	anno_link_id int IDENTITY not null primary key,
+	parent_anno_base_id int not null ,
+	child_anno_base_id int not null ,
+	feature varchar(20)
+) ;
+create index IX_link on anno_link(parent_anno_base_id, child_anno_base_id, feature);
+
+CREATE CACHED TABLE anno_contain (
+  parent_anno_base_id int not null ,
+  parent_uima_type_id int not null ,
+  child_anno_base_id int not null ,
+  child_uima_type_id int not null ,
+  primary key (parent_anno_base_id, child_anno_base_id)
+);
+create index IX_parent_id_child_type on anno_contain(parent_anno_base_id, child_uima_type_id);
+create index IX_child_id_parent_type on anno_contain(child_anno_base_id, parent_uima_type_id);
+
+CREATE CACHED TABLE fracture_demo(
+	note_id int IDENTITY NOT NULL primary key,
+	site_id varchar(10) NULL,
+	note_text longvarchar NULL,
+	fracture varchar(20) NULL,
+	note_set varchar(10) NULL
+);
+
+
+-- metamap tables
+CREATE CACHED TABLE anno_mm_candidate (
+	anno_base_id int not null primary key,
+	cui char(8),
+	score int default 0,
+	head bit default 0,
+	overmatch bit default 0
+);
+
+CREATE CACHED TABLE anno_mm_acronym (
+	anno_base_id int not null primary key,
+	acronym varchar(10),
+    expansion varchar(30)    
+);
+
+CREATE CACHED TABLE anno_mm_utterance (
+	anno_base_id int not null primary key,
+	pmid varchar(10),
+    location varchar(30)    
+);
+
+
+CREATE CACHED TABLE anno_mm_cuiconcept (
+    anno_mm_cuiconcept_id int IDENTITY not null primary key,
+    anno_base_id int,
+    negExCui char(8)
+);
+
+CREATE CACHED TABLE anno_mm_negation (
+    anno_base_id int not null primary key,
+    negType varchar(10),
+    negTrigger varchar(10)
+);
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_reference.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_reference.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_reference.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_reference.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,45 @@
+CREATE CACHED TABLE hibernate_sequences (
+	sequence_name varchar(100) not null primary key,
+	next_val int default 1 not null
+);
+insert into hibernate_sequences(sequence_name, next_val) values ('document_id_sequence', 1);
+
+CREATE CACHED TABLE anno_base_sequence (
+	sequence_name varchar(100) not null primary key,
+	next_val int default 1 not null 
+);
+insert into anno_base_sequence(sequence_name, next_val) values ('anno_base_id_sequence', 1);
+
+
+CREATE CACHED TABLE ref_named_entity_regex (
+	named_entity_regex_id int IDENTITY NOT NULL primary key,
+	regex varchar(512) not null,
+	coding_scheme varchar(20) not null,
+	code varchar(20) not null,
+	oid varchar(10),
+	context varchar(256)
+) ;
+
+CREATE CACHED TABLE ref_segment_regex (
+	segment_regex_id int IDENTITY NOT NULL primary key,
+	regex varchar(256) not null,
+	segment_id varchar(20),
+	limit_to_regex bit  default 0 null
+) ;
+
+CREATE CACHED TABLE ref_uima_type (
+	uima_type_id int not null primary key,
+	uima_type_name varchar(256) not null,
+	table_name varchar(100) null
+) ;
+
+CREATE UNIQUE  INDEX NK_ref_uima_type ON ref_uima_type
+(
+	uima_type_name
+)
+;
+
+CREATE CACHED TABLE ref_stopword (
+	stopword varchar(50) not null primary key
+) 
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/hsql/uima/create_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,52 @@
+-- We assume the metadata about documents (patient id, date) come from
+-- some table in your database.  modify this view to join with that table
+-- and get this info
+create view v_document as
+select analysis_batch, document_id, doc_text, instance_id, null patient_id, null doc_date, null doc_title, null document_type_name
+from document;
+
+
+create view v_annotation
+AS
+SELECT anno.*, ur.uima_type_name, substr(doc.doc_text, anno.span_begin+1, anno.span_end-anno.span_begin)  anno_text, doc.analysis_batch
+FROM anno_base AS anno 
+INNER JOIN document AS doc ON doc.document_id = anno.document_id
+INNER JOIN ref_uima_type AS ur on ur.uima_type_id = anno.uima_type_id
+;
+
+
+-- this view gives the document info, cui info, and sentence info in which a cui is found.
+create view v_document_cui_sent
+as
+SELECT
+  da.anno_base_id,
+  d.analysis_batch,
+  da.document_id,
+  ne.polarity,
+  o.code,
+  o.cui,
+  substr(d.doc_text, da.span_begin+1, da.span_end-da.span_begin) cui_text,
+  substr(d.doc_text, s.span_begin+1, s.span_end-s.span_begin) sentence_text,
+  o.disambiguated,
+  null patient_id,
+  null doc_date,
+  null doc_title,
+  null document_type_name
+FROM anno_base da
+INNER JOIN anno_named_entity  ne ON da.anno_base_id = ne.anno_base_id
+INNER JOIN anno_ontology_concept  o ON o.anno_base_id = ne.anno_base_id
+inner join anno_contain ac on da.anno_base_id = ac.child_anno_base_id
+INNER join anno_base s
+  on ac.parent_anno_base_id = s.anno_base_id
+  and s.uima_type_id in (select uima_type_id from ref_uima_type where uima_type_name = 'edu.mayo.bmi.uima.core.type.textspan.Sentence')
+INNER JOIN document d on da.document_id = d.document_id
+;
+
+CREATE VIEW v_document_ontoanno
+AS
+SELECT d.document_id, da.span_begin, da.span_end, ne.polarity, o.code, o.cui, d.analysis_batch, o.disambiguated
+FROM document AS d INNER JOIN
+anno_base AS da ON d.document_id = da.document_id INNER JOIN
+anno_named_entity AS ne ON da.anno_base_id = ne.anno_base_id INNER JOIN
+anno_ontology_concept AS o ON o.anno_base_id = ne.anno_base_id
+;



Mime
View raw message