Skip to content

Commit

Permalink
Merge pull request #30 from terry-norbraten/master
Browse files Browse the repository at this point in the history
Update README and build tasks
  • Loading branch information
apease authored Feb 9, 2025
2 parents d90be00 + 8ac53d5 commit a2521c1
Show file tree
Hide file tree
Showing 49 changed files with 728 additions and 586 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
First follow the instructions to install sigmakee at https://github.com/ontologyportal/sigmakee
Check the version number of the CoreNLP zip that you download and unzip and modify paths
Installation
============

First follow the instructions to install sigmakee at https://github.com/ontologyportal/sigmakee.\
Check the version number of the CoreNLP zip that you download and unzip and modify paths\
accordingly. For macOS, replace .bashrc with .zshrc

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

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

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

```
export CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m"
source ~/.*shrc
```
Add the following to your $CATALINA_HOME/conf/context.xml
<Context crossContext="true">

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

If you want to run sigmanlp's web interface then:
```
```sh
ant dist
```

Start Tomcat with:
```
```sh
$CATALINA_HOME/bin/startup.sh
```
http://localhost:8080/sigmanlp/NLP.jsp
Expand All @@ -60,28 +64,24 @@ the following in your config.xml
<preference name="nlpTools" value="yes" />

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

Account Management
==================

Add the following to your $CATALINA_HOME/conf/context.xml

<Context crossContext="true">


jUnit
=====

```sh
java -Xmx10g -Xss1m -cp /home/user/workspace/sigmanlp/build/classes:
/home/user/workspace/sigmanlp/build/lib/*:/home/user/workspace/sigmanlp/lib/*
org.junit.runner.JUnitCore com.articulate.nlp.semRewrite.RunAllUnitSemRewrite

java -Xmx10g -Xss1m -cp /home/user/workspace/sigmanlp/build/classes:
/home/user/workspace/sigmanlp/build/lib/*:/home/user/workspace/sigmanlp/lib/*
org.junit.runner.JUnitCore com.articulate.nlp.semRewrite.RunAllSemRewriteIntegTest
```

IDE
===

To build/run/debug/test using the NetBeans IDE, define a
nbproject/private/private.properties file with these keys:
Expand Down
30 changes: 15 additions & 15 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
<property name="main.class" value="com.articulate.nlp.semRewrite.Interpreter"/>
<property name="impl.vendor.id" value="edu.nps.cs"/>

<property name="app.name" value="sigmanlp"/>
<property name="app.name" value="sigma"/>
<property name="web.app.name" value="${app.name}nlp"/>
<property name="build.home" value="build"/>
<property name="build.classes.dir" value="${build.home}/classes"/>
<property name="build.lib" value="${build.home}/lib"/>
<property name="build.test.classes.dir" value="${build.home}/test/classes"/>
<property name="dist.dir" value="dist"/>
<property name="dist.jar" value="${dist.dir}/${app.name}.jar"/>
<property name="dist.jar" value="${dist.dir}/${web.app.name}.jar"/>
<property name="dist.javadoc.dir" value="doc"/>
<property name="web.dir" value="web"/>
<property name="reports.dir" value="${build.home}/test/results"/>
Expand All @@ -41,8 +42,9 @@
<property environment="env"/>
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>
<property name="dist.home" value="${tomcat.home}/webapps"/>
<property name="dist.war" value="${dist.home}/${app.name}.war"/>
<property name="deploy.home" value="${dist.home}/${app.name}"/>
<property name="dist.war" value="${dist.home}/${web.app.name}.war"/>
<property name="deploy.home" value="${dist.home}/${web.app.name}"/>
<property name="git.home" value="${env.ONTOLOGYPORTAL_GIT}"/>
<property name="sigmakee.home" value="${env.SIGMA_SRC}" />
<property name="deploy.classes" value="${build.home}/WEB-INF/classes"/>
<property name="deploy.lib" value="${build.home}/WEB-INF/lib"/>
Expand All @@ -58,7 +60,6 @@
<not>
<os family="mac"/>
</not>

</and>
</condition>

Expand Down Expand Up @@ -90,7 +91,6 @@
<path refid="compile.test.classpath"/>
<pathelement location="${build.test.classes.dir}"/>
</path>

<path id="sourcepath">
<dirset dir="${basedir}">
<include name="src/main/java"/>
Expand All @@ -117,19 +117,19 @@
<echo message="SIGMA_HOME is set to: ${env.SIGMA_HOME}"/>
<echo message="sigmakee is set to: ${env.SIGMA_SRC}"/>

<tstamp>
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
</tstamp>

<ant antfile="../sigmakee/build.xml" inheritAll="false" target="all" />
<copy todir="${basedir}/lib" file="${sigmakee.home}/build/sigmakee.jar" />
<copy todir="${basedir}/lib" file="../SigmaUtils/sigmaUtils.jar" />

<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.lib}"/>

<tstamp>
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
</tstamp>
</target>

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

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

<target name="dist" depends="compile" description="Create the *.war file and place in ${build.home}.">
<target name="dist" depends="compile,compile.test" description="Create the *.war file and place in $CATALINA_HOME/webapps.">
<manifest file="${manifest.mf}">
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Specification-Title"
Expand Down Expand Up @@ -246,7 +246,7 @@
</lib>
<classes dir="${build.classes.dir}"/>
</war>
<jar destfile="${build.home}/${app.name}.jar"
<jar destfile="${build.home}/${web.app.name}.jar"
manifest="${manifest.mf}">
<metainf file="LICENSE"/>
<fileset dir="${build.classes.dir}"/>
Expand All @@ -271,7 +271,7 @@
<!-- git macro utils setup from: https://tonyyan.wordpress.com/2017/03/10/integrate-git-into-ant-targets/-->
<macrodef name="git">
<attribute name="command"/>
<attribute name="dir" default="${workspace.dir}"/>
<attribute name="dir" default="${git.home}"/>
<element name="args" optional="true"/>
<sequential>
<echo message="git @{command}"/>
Expand All @@ -289,7 +289,7 @@
<fileset dir="${dist.dir}"/>
<!-- Delete the old web code -->
<fileset dir="${deploy.home}"/>
<fileset dir="${tomcat.home}/work/Catalina/localhost/${app.name}"/>
<fileset dir="${tomcat.home}/work/Catalina/localhost/${web.app.name}"/>
</delete>
<delete file="${dist.war}"/>
</target>
Expand Down
16 changes: 8 additions & 8 deletions nbproject/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ debug.test.modulepath=\
dist.archive.excludes=
# This directory is removed when the project is cleaned:
#dist.dir=dist
#dist.jar=${dist.dir}/${app.name}.jar
#dist.jar=${dist.dir}/${web.app.name}.jar
#dist.javadoc.dir=${dist.dir}/doc/api
excludes=
file.reference.src-java=src/java
Expand Down Expand Up @@ -130,9 +130,9 @@ source.encoding=UTF-8
#test.integration.dir=${file.reference.integration-java}
#test.unit.dir=${file.reference.unit-java}

# Specific SigmaKEE props
#web.app.name=sigma
#app.name=${web.app.name}nlp
# Specific SigmaNLP props
#app.name=sigma
#web.app.name=${app.name}nlp
ontologyportal.git=${workspace}
#web.dir=web
sigma_src=${workspace}/sigmakee
Expand Down Expand Up @@ -174,13 +174,13 @@ mgr.url=http://${tomcat.server}:${tomcat.port}/manager/text
# Check that these properties match in ${catalina.home}/conf/tomcat-users.xml
username=tomcat
password=tomcat
context=/${app.name}
context=/${web.app.name}

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

dist_home=${catalina.base}/webapps
deploy_home=${dist_home}/${app.name}
dist_war=${dist_home}/${app.name}.war
deploy_home=${dist_home}/${web.app.name}
dist_war=${dist_home}/${web.app.name}.war

#reports.dir=${build.home}/reports
#report.html=file:${basedir}/${reports.dir}/html/index.html
Expand Down
13 changes: 9 additions & 4 deletions nbproject/ide-targets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
<format property="TODAY_US" pattern="EEE, d MMM yyyy HHmm Z" locale="en,US"/>
</tstamp>

<ant antfile="../sigmakee/nbproject/ide-targets.xml" inheritAll="false" target="all" />
<copy todir="${basedir}/lib" file="../sigmakee/build/sigmakee.jar" />
<copy todir="${basedir}/lib" file="../SigmaUtils/sigmaUtils.jar" />

<mkdir dir="${build.home}"/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.lib}"/>
Expand Down Expand Up @@ -310,7 +314,7 @@
username="${username}"
password="${password}"
path="${context}"
war="${basedir}/${dist.dir}/${app.name}.war"/>
war="${basedir}/${dist.dir}/${web.app.name}.war"/>
<sleep seconds="2"/>
<antcall target="open.sigmanlp.url"/>
</sequential>
Expand Down Expand Up @@ -504,7 +508,7 @@
=====
-->

<target name="dist" depends="compile" description="Prepare and distribute the sigma.war and ${app.name}.jar files and place in ${dist.dir}.">
<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}.">
<manifest file="${manifest.mf}">
<attribute name="Built-By" value="${my.name} ${my.email}"/>
<attribute name="Specification-Title"
Expand All @@ -526,7 +530,7 @@
<attribute name="Main-Class"
value="${main.class}"/>
</manifest>
<war destfile="${dist.dir}/${app.name}.war"
<war destfile="${dist.dir}/${web.app.name}.war"
webxml="${web.dir}/web.xml"
manifest="${manifest.mf}">
<metainf file="LICENSE"/>
Expand Down Expand Up @@ -564,7 +568,7 @@
<delete includeemptydirs="true" failonerror="false">
<!-- Delete the old web code -->
<fileset dir="${deploy_home}"/>
<fileset dir="${catalina.base}/work/Catalina/localhost/${app.name}"/>
<fileset dir="${catalina.base}/work/Catalina/localhost/${web.app.name}"/>
<!-- JUnit generated products -->
<fileset dir="${basedir}">
<include name="junit*.properties"/>
Expand All @@ -573,6 +577,7 @@
</fileset>
<!-- Prune KB after integration tests -->
<fileset dir="${sigma_home}/KBs">
<include name="*.fof"/>
<include name="*.tptp"/>
<include name="*.ser"/>
</fileset>
Expand Down
Loading

0 comments on commit a2521c1

Please sign in to comment.