Skip to content

Commit a2521c1

Browse files
authored
Merge pull request #30 from terry-norbraten/master
Update README and build tasks
2 parents d90be00 + 8ac53d5 commit a2521c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+728
-586
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
First follow the instructions to install sigmakee at https://github.com/ontologyportal/sigmakee
2-
Check the version number of the CoreNLP zip that you download and unzip and modify paths
1+
Installation
2+
============
3+
4+
First follow the instructions to install sigmakee at https://github.com/ontologyportal/sigmakee.\
5+
Check the version number of the CoreNLP zip that you download and unzip and modify paths\
36
accordingly. For macOS, replace .bashrc with .zshrc
47

5-
```
8+
In your .bashrc/.zshrc you'll need to have a greater heap space allocation than for sigmakee alone
9+
```sh
610
cd ~
7-
echo "export ONTOLOGYPORTAL_GIT="~/workspace" >> .bashrc
8-
echo "export SIGMA_SRC=$ONTOLOGYPORTAL_GIT/sigmakee" >> .bashrc
911
echo "export CORPORA=$ONTOLOGYPORTAL_GIT/sigmanlp/corpora" >> .bashrc
12+
export CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m" >> .bashrc
13+
source ~/.bashrc
1014
cd ~/workspace/
1115
git clone https://github.com/ontologyportal/sigmanlp
1216
cd ~/Programs
@@ -27,12 +31,11 @@ ant update.sigmanlp
2731

2832
Then follow the steps in "Account Management" below before proceeding
2933

30-
In your .bashrc/.zshrc you'll need to have a greater heap space allocation than for sigmakee alone
34+
Account Management
35+
==================
3136

32-
```
33-
export CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m"
34-
source ~/.*shrc
35-
```
37+
Add the following to your $CATALINA_HOME/conf/context.xml
38+
<Context crossContext="true">
3639

3740
Add the following line to your $SIGMA_HOME/KBs/config.xml file, but replace '~' with the full path
3841
and "latest" with you're version of stanford-corenlp:
@@ -45,11 +48,12 @@ and "latest" with you're version of stanford-corenlp:
4548
element
4649

4750
If you want to run sigmanlp's web interface then:
48-
```
51+
```sh
4952
ant dist
5053
```
54+
5155
Start Tomcat with:
52-
```
56+
```sh
5357
$CATALINA_HOME/bin/startup.sh
5458
```
5559
http://localhost:8080/sigmanlp/NLP.jsp
@@ -60,28 +64,24 @@ the following in your config.xml
6064
<preference name="nlpTools" value="yes" />
6165

6266
To run on the command line, try
63-
```
67+
```sh
6468
java -Xmx10g -Xss1m -cp $ONTOLOGYPORTAL_GIT/sigmanlp/build/classes:$ONTOLOGYPORTAL_GIT/sigmanlp/lib/* com.articulate.nlp.semRewrite.Interpreter -i
6569
```
6670

67-
Account Management
68-
==================
69-
70-
Add the following to your $CATALINA_HOME/conf/context.xml
71-
72-
<Context crossContext="true">
73-
74-
7571
jUnit
7672
=====
77-
73+
```sh
7874
java -Xmx10g -Xss1m -cp /home/user/workspace/sigmanlp/build/classes:
7975
/home/user/workspace/sigmanlp/build/lib/*:/home/user/workspace/sigmanlp/lib/*
8076
org.junit.runner.JUnitCore com.articulate.nlp.semRewrite.RunAllUnitSemRewrite
8177

8278
java -Xmx10g -Xss1m -cp /home/user/workspace/sigmanlp/build/classes:
8379
/home/user/workspace/sigmanlp/build/lib/*:/home/user/workspace/sigmanlp/lib/*
8480
org.junit.runner.JUnitCore com.articulate.nlp.semRewrite.RunAllSemRewriteIntegTest
81+
```
82+
83+
IDE
84+
===
8585

8686
To build/run/debug/test using the NetBeans IDE, define a
8787
nbproject/private/private.properties file with these keys:

build.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
<property name="main.class" value="com.articulate.nlp.semRewrite.Interpreter"/>
2525
<property name="impl.vendor.id" value="edu.nps.cs"/>
2626

27-
<property name="app.name" value="sigmanlp"/>
27+
<property name="app.name" value="sigma"/>
28+
<property name="web.app.name" value="${app.name}nlp"/>
2829
<property name="build.home" value="build"/>
2930
<property name="build.classes.dir" value="${build.home}/classes"/>
3031
<property name="build.lib" value="${build.home}/lib"/>
3132
<property name="build.test.classes.dir" value="${build.home}/test/classes"/>
3233
<property name="dist.dir" value="dist"/>
33-
<property name="dist.jar" value="${dist.dir}/${app.name}.jar"/>
34+
<property name="dist.jar" value="${dist.dir}/${web.app.name}.jar"/>
3435
<property name="dist.javadoc.dir" value="doc"/>
3536
<property name="web.dir" value="web"/>
3637
<property name="reports.dir" value="${build.home}/test/results"/>
@@ -41,8 +42,9 @@
4142
<property environment="env"/>
4243
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>
4344
<property name="dist.home" value="${tomcat.home}/webapps"/>
44-
<property name="dist.war" value="${dist.home}/${app.name}.war"/>
45-
<property name="deploy.home" value="${dist.home}/${app.name}"/>
45+
<property name="dist.war" value="${dist.home}/${web.app.name}.war"/>
46+
<property name="deploy.home" value="${dist.home}/${web.app.name}"/>
47+
<property name="git.home" value="${env.ONTOLOGYPORTAL_GIT}"/>
4648
<property name="sigmakee.home" value="${env.SIGMA_SRC}" />
4749
<property name="deploy.classes" value="${build.home}/WEB-INF/classes"/>
4850
<property name="deploy.lib" value="${build.home}/WEB-INF/lib"/>
@@ -58,7 +60,6 @@
5860
<not>
5961
<os family="mac"/>
6062
</not>
61-
6263
</and>
6364
</condition>
6465

@@ -90,7 +91,6 @@
9091
<path refid="compile.test.classpath"/>
9192
<pathelement location="${build.test.classes.dir}"/>
9293
</path>
93-
9494
<path id="sourcepath">
9595
<dirset dir="${basedir}">
9696
<include name="src/main/java"/>
@@ -117,19 +117,19 @@
117117
<echo message="SIGMA_HOME is set to: ${env.SIGMA_HOME}"/>
118118
<echo message="sigmakee is set to: ${env.SIGMA_SRC}"/>
119119

120+
<tstamp>
121+
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
122+
</tstamp>
123+
120124
<ant antfile="../sigmakee/build.xml" inheritAll="false" target="all" />
121125
<copy todir="${basedir}/lib" file="${sigmakee.home}/build/sigmakee.jar" />
122126
<copy todir="${basedir}/lib" file="../SigmaUtils/sigmaUtils.jar" />
123127

124128
<mkdir dir="${build.classes.dir}"/>
125129
<mkdir dir="${build.lib}"/>
126-
127-
<tstamp>
128-
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
129-
</tstamp>
130130
</target>
131131

132-
<target name="deploy.prepare" depends="init" description="deploy code to sigma.war">
132+
<target name="deploy.prepare" depends="init" description="deploy code to sigmanlp.war">
133133

134134
<!-- Copy all the *.jsp, *.xsl, *.html, pixmaps, etc. -->
135135
<copy todir="${build.home}/jsp">
@@ -209,7 +209,7 @@
209209
<mkdir dir="${reports.dir}"/>
210210
</target>
211211

212-
<target name="dist" depends="compile" description="Create the *.war file and place in ${build.home}.">
212+
<target name="dist" depends="compile,compile.test" description="Create the *.war file and place in $CATALINA_HOME/webapps.">
213213
<manifest file="${manifest.mf}">
214214
<attribute name="Built-By" value="${user.name}"/>
215215
<attribute name="Specification-Title"
@@ -246,7 +246,7 @@
246246
</lib>
247247
<classes dir="${build.classes.dir}"/>
248248
</war>
249-
<jar destfile="${build.home}/${app.name}.jar"
249+
<jar destfile="${build.home}/${web.app.name}.jar"
250250
manifest="${manifest.mf}">
251251
<metainf file="LICENSE"/>
252252
<fileset dir="${build.classes.dir}"/>
@@ -271,7 +271,7 @@
271271
<!-- git macro utils setup from: https://tonyyan.wordpress.com/2017/03/10/integrate-git-into-ant-targets/-->
272272
<macrodef name="git">
273273
<attribute name="command"/>
274-
<attribute name="dir" default="${workspace.dir}"/>
274+
<attribute name="dir" default="${git.home}"/>
275275
<element name="args" optional="true"/>
276276
<sequential>
277277
<echo message="git @{command}"/>
@@ -289,7 +289,7 @@
289289
<fileset dir="${dist.dir}"/>
290290
<!-- Delete the old web code -->
291291
<fileset dir="${deploy.home}"/>
292-
<fileset dir="${tomcat.home}/work/Catalina/localhost/${app.name}"/>
292+
<fileset dir="${tomcat.home}/work/Catalina/localhost/${web.app.name}"/>
293293
</delete>
294294
<delete file="${dist.war}"/>
295295
</target>

nbproject/build.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ debug.test.modulepath=\
2121
dist.archive.excludes=
2222
# This directory is removed when the project is cleaned:
2323
#dist.dir=dist
24-
#dist.jar=${dist.dir}/${app.name}.jar
24+
#dist.jar=${dist.dir}/${web.app.name}.jar
2525
#dist.javadoc.dir=${dist.dir}/doc/api
2626
excludes=
2727
file.reference.src-java=src/java
@@ -130,9 +130,9 @@ source.encoding=UTF-8
130130
#test.integration.dir=${file.reference.integration-java}
131131
#test.unit.dir=${file.reference.unit-java}
132132

133-
# Specific SigmaKEE props
134-
#web.app.name=sigma
135-
#app.name=${web.app.name}nlp
133+
# Specific SigmaNLP props
134+
#app.name=sigma
135+
#web.app.name=${app.name}nlp
136136
ontologyportal.git=${workspace}
137137
#web.dir=web
138138
sigma_src=${workspace}/sigmakee
@@ -174,13 +174,13 @@ mgr.url=http://${tomcat.server}:${tomcat.port}/manager/text
174174
# Check that these properties match in ${catalina.home}/conf/tomcat-users.xml
175175
username=tomcat
176176
password=tomcat
177-
context=/${app.name}
177+
context=/${web.app.name}
178178

179-
deploy.url=http://localhost:8080/${app.name}/NLP.jsp
179+
deploy.url=http://localhost:8080/${web.app.name}/NLP.jsp
180180

181181
dist_home=${catalina.base}/webapps
182-
deploy_home=${dist_home}/${app.name}
183-
dist_war=${dist_home}/${app.name}.war
182+
deploy_home=${dist_home}/${web.app.name}
183+
dist_war=${dist_home}/${web.app.name}.war
184184

185185
#reports.dir=${build.home}/reports
186186
#report.html=file:${basedir}/${reports.dir}/html/index.html

nbproject/ide-targets.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
5959
</tstamp>
6060

61+
<ant antfile="../sigmakee/nbproject/ide-targets.xml" inheritAll="false" target="all" />
62+
<copy todir="${basedir}/lib" file="../sigmakee/build/sigmakee.jar" />
63+
<copy todir="${basedir}/lib" file="../SigmaUtils/sigmaUtils.jar" />
64+
6165
<mkdir dir="${build.home}"/>
6266
<mkdir dir="${build.classes.dir}"/>
6367
<mkdir dir="${build.lib}"/>
@@ -310,7 +314,7 @@
310314
username="${username}"
311315
password="${password}"
312316
path="${context}"
313-
war="${basedir}/${dist.dir}/${app.name}.war"/>
317+
war="${basedir}/${dist.dir}/${web.app.name}.war"/>
314318
<sleep seconds="2"/>
315319
<antcall target="open.sigmanlp.url"/>
316320
</sequential>
@@ -504,7 +508,7 @@
504508
=====
505509
-->
506510

507-
<target name="dist" depends="compile" description="Prepare and distribute the sigma.war and ${app.name}.jar files and place in ${dist.dir}.">
511+
<target name="dist" depends="compile" description="Prepare and distribute the ${web.app.name}.war and ${web.app.name}.jar files and place in ${dist.dir}.">
508512
<manifest file="${manifest.mf}">
509513
<attribute name="Built-By" value="${my.name} ${my.email}"/>
510514
<attribute name="Specification-Title"
@@ -526,7 +530,7 @@
526530
<attribute name="Main-Class"
527531
value="${main.class}"/>
528532
</manifest>
529-
<war destfile="${dist.dir}/${app.name}.war"
533+
<war destfile="${dist.dir}/${web.app.name}.war"
530534
webxml="${web.dir}/web.xml"
531535
manifest="${manifest.mf}">
532536
<metainf file="LICENSE"/>
@@ -564,7 +568,7 @@
564568
<delete includeemptydirs="true" failonerror="false">
565569
<!-- Delete the old web code -->
566570
<fileset dir="${deploy_home}"/>
567-
<fileset dir="${catalina.base}/work/Catalina/localhost/${app.name}"/>
571+
<fileset dir="${catalina.base}/work/Catalina/localhost/${web.app.name}"/>
568572
<!-- JUnit generated products -->
569573
<fileset dir="${basedir}">
570574
<include name="junit*.properties"/>
@@ -573,6 +577,7 @@
573577
</fileset>
574578
<!-- Prune KB after integration tests -->
575579
<fileset dir="${sigma_home}/KBs">
580+
<include name="*.fof"/>
576581
<include name="*.tptp"/>
577582
<include name="*.ser"/>
578583
</fileset>

0 commit comments

Comments
 (0)