ontologyportal / sigmakee

Sigma Knowledge Engineering Environment
GNU General Public License v3.0
100 stars 34 forks source link

Problems installing SUMO manually on Ubuntu #73

Closed ArunSingh94 closed 2 years ago

ArunSingh94 commented 2 years ago

Good day, I am trying to install SUMO using the manual installation on Ubuntu but I'm getting the same issue as: https://github.com/ontologyportal/sigmakee/issues/17#issue-168502527

However, the fixes there do not seem to be working for me.

Running the ant command in ~/workspace/sigmakee is successful but when I run:

java -Xmx7g -classpath /home/arun/workspace/sigmakee/build/classes:/home/arun/workspace/sigmakee/build/lib/* com.articulate.sigma.KB -t

The output is: Error: Could not find or load main class com.articulate.sigma.KB

In workspace/sigmakee/build there are the lib and vagrant folders and a sigmakee.jar file.

And in /.sigmakee there is only the KBs folder.

So the classes folder seems to be missing for me.

My .bashrc file looks like this:

export SIGMA_HOME=/home/arun/.sigmakee export SIGMA_SRC=/home/arun/workspace/sigmakee export ONTOLOGYPORTAL_GIT=/home/arun/workspace export CATALINA_OPTS=" -Xms500M -Xmx7g" export CATALINA_HOME=/home/arun/Programs/apache-tomcat-8.5.23

I also replaced all instances of theuser with my username arun in the config.xml file.

Appreciate any help in advance. Thank you.

apease commented 2 years ago

Hi Arun, Sorry for the trouble. Could you try

java -Xmx7g -classpath /home/arun/workspace/sigmakee/build/sigmakee.jar:/home/arun/workspace/sigmakee/build/lib/* com.articulate.sigma.KB -t

also we should verify your java installation with

java -version

and make sure it's getting the Oracle JDK

ArunSingh94 commented 2 years ago

My java version is:

java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

That java command worked and the program began initializing but ended in an error.

The first exception thrown was:

Error in OMWordnet.loadSerialized(): IOException is caught
java.io.FileNotFoundException: /home/arun/.sigmakee/KBs/WordNetMappings/omw.ser (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at com.articulate.sigma.wordNet.OMWordnet.loadSerialized(OMWordnet.java:277)
    at com.articulate.sigma.wordNet.OMWordnet.readOMWfiles(OMWordnet.java:331)
    at com.articulate.sigma.KBmanager.setConfiguration(KBmanager.java:731)
    at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:688)
    at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:626)
    at com.articulate.sigma.KB.main(KB.java:3781)

However, I do see the omw.ser file in the /home/arun/.sigmakee/KBs/WordNetMappings/ folder.

But the program continued to execute.

It then outputted SUMOKBtoTPTPKB.writeFile() : still working for a couple minutes.

Finally, output ended with:

KBmanager.serialize(): KBmanager has been serialized 
SUMOKBtoTPTPKB.writeFile(): axiomKey: 143742
SUMOKBtoTPTPKB.writeFile(): seconds: 703
INFO in EProver.writeBatchFile(): writing EBatchConfig.txt with KB file /home/arun/.sigmakee/KBs/SUMO.tptp
INFO in EProver(): executable: /home/arun/E/bin/e_ltb_runner
INFO in EProver(): kbFile: /home/arun/.sigmakee/KBs/SUMO.tptp
EProver(): command: [/home/arun/E/bin/e_ltb_runner, --interactive, /home/arun/.sigmakee/KBs/EBatchConfig.txt, /home/arun/E/bin/eprover]
Cannot run program "/home/arun/E/bin/e_ltb_runner": error=2, No such file or directory
java.io.IOException: Cannot run program "/home/arun/E/bin/e_ltb_runner": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at com.articulate.sigma.tp.EProver.<init>(EProver.java:192)
    at com.articulate.sigma.KB.loadEProver(KB.java:3462)
    at com.articulate.sigma.KBmanager.loadKBforInference(KBmanager.java:452)
    at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:698)
    at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:626)
    at com.articulate.sigma.KB.main(KB.java:3781)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 6 more
Error in KB.loadEProver(): EProver not loaded
Info in KBmanager.initializeOnce(): initialized is true
KBmanager.initializeOnce(): total init time in seconds: 894
Info in KBmanager.initializeOnce()
Info in KBmanager.initializeOnce(): initialized is true
Info in KBmanager.initializeOnce(): initializing is false
Info in KBmanager.initializeOnce(): returning 
KB.test(): []
KB.test(): query Vampire with: (subclass ?X Entity)
KB.test(): query Vampire on file: /home/arun/.sigmakee/KBs/temp-comb.tptp
INFO in KB.loadVampire()
Error in Vampire: no executable /home/arun/workspace/vampire/vampire
KB.askVampire(): processed query: [(subclass ?X Entity)]
KB.askVampire(): calling with: /home/arun/.sigmakee/KBs/SUMO.tptp, 30, [fof(query_0,conjecture,(( ( ? [V__X] : (s__subclass(V__X,s__Entity) ) ) ))).]
Error in Vampire.run(): no executable /home/arun/workspace/vampire/vampire
Vampire.run(): Initializing Vampire with:
[/home/arun/workspace/vampire/vampire, --avatar, off, -qa, answer_literal, --mode, casc, --proof, tptp, -t, 30, /home/arun/.sigmakee/KBs/temp-comb.tptp]
java.io.IOException: Cannot run program "/home/arun/workspace/vampire/vampire": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at com.articulate.sigma.tp.Vampire.run(Vampire.java:172)
    at com.articulate.sigma.tp.Vampire.run(Vampire.java:285)
    at com.articulate.sigma.KB.askVampire(KB.java:1801)
    at com.articulate.sigma.KB.test(KB.java:3704)
    at com.articulate.sigma.KB.main(KB.java:3797)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 5 more
null

Let me know if you need to see the entire output.

My E folder is located in the Programs folder.

I do not have a vampire folder.

apease commented 2 years ago

I think my instructions are confusing. It looks like you need to install Vampire, as described in the section header under Vampire. I'll change the test so that it doesn't require Vampire.

ArunSingh94 commented 2 years ago

I installed Vampire and ran the java command again.

This time receiving this error:

KB.askVampire(): processed query: [(subclass ?X Entity)]
KB.askVampire(): calling with: /home/arun/.sigmakee/KBs/SUMO.tptp, 30, [fof(query_0,conjecture,(( ( ? [V__X] : (s__subclass(V__X,s__Entity) ) ) ))).]
Vampire.run(): Initializing Vampire with:
[/home/arun/workspace/vampire/vampire, --avatar, off, -qa, answer_literal, --mode, casc, --proof, tptp, -t, 30, /home/arun/.sigmakee/KBs/temp-comb.tptp]
Vampire.run() done executing
removePrefix(): s__PositiveInteger
Error in TPTP3ProofProcessor.parseProofStep() bad format: fof(f143795,plain,(
Error in TPTP3ProofProcessor.parseProofStep() format error in line:   $false),
Error in TPTP3ProofProcessor.parseProofStep() bad type:   inference
Error in TPTP3ProofProcessor.parseProofStep(): unexpected token: (
line 1:12: unexpected token: (
    at tptp_parser.TptpParser.tptp_input(TptpParser.java:163)
    at tptp_parser.TptpParser.topLevelItem(TptpParser.java:55)
    at TPTPWorld.TPTPParser.<init>(TPTPParser.java:52)
    at TPTPWorld.TPTPParser.parse(TPTPParser.java:124)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofStep(TPTP3ProofProcessor.java:367)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofOutput(TPTP3ProofProcessor.java:715)
    at com.articulate.sigma.KB.test(KB.java:3707)
    at com.articulate.sigma.KB.main(KB.java:3797)
TPTP3ProofProcessor.parseProofStep(): with input:   inference(unit_resulting_resolution,[],[f143794,f143793])).
Error in TPTP3ProofProcessor.parseProofStep() bad format: fof(f143793,plain,(
Error in TPTP3ProofProcessor.parseProofStep() format error in line:   ~ans0(s__PositiveInteger)),
Error in TPTP3ProofProcessor.parseProofStep() bad type:   inference
Error in TPTP3ProofProcessor.parseProofStep(): unexpected token: (
line 1:12: unexpected token: (
    at tptp_parser.TptpParser.tptp_input(TptpParser.java:163)
    at tptp_parser.TptpParser.topLevelItem(TptpParser.java:55)
    at TPTPWorld.TPTPParser.<init>(TPTPParser.java:52)
    at TPTPWorld.TPTPParser.parse(TPTPParser.java:124)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofStep(TPTP3ProofProcessor.java:367)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofOutput(TPTP3ProofProcessor.java:715)
    at com.articulate.sigma.KB.test(KB.java:3707)
    at com.articulate.sigma.KB.main(KB.java:3797)
TPTP3ProofProcessor.parseProofStep(): with input:   inference(resolution,[],[f143762,f143768])).
Error in TPTP3ProofProcessor.parseProofStep() bad format: fof(f143768,plain,(
Error in TPTP3ProofProcessor.parseProofStep() bad type:   s__subclass
Error in TPTP3ProofProcessor.parseProofStep() bad format:   s__subclass(s__PositiveInteger,s__Entity)),
Error in TPTP3ProofProcessor.parseProofStep() bad type:   inference
Error in TPTP3ProofProcessor.parseProofStep(): unexpected token: (
line 1:12: unexpected token: (
    at tptp_parser.TptpParser.tptp_input(TptpParser.java:163)
    at tptp_parser.TptpParser.topLevelItem(TptpParser.java:55)
    at TPTPWorld.TPTPParser.<init>(TPTPParser.java:52)
    at TPTPWorld.TPTPParser.parse(TPTPParser.java:124)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofStep(TPTP3ProofProcessor.java:367)
    at com.articulate.sigma.trans.TPTP3ProofProcessor.parseProofOutput(TPTP3ProofProcessor.java:715)
    at com.articulate.sigma.KB.test(KB.java:3707)
    at com.articulate.sigma.KB.main(KB.java:3797)
TPTP3ProofProcessor.parseProofStep(): with input:   inference(cnf_transformation,[],[f127152])).
Index: 4, Size: 4
queryExp(): bindings: [PositiveInteger]
null
apease commented 2 years ago

thanks for the bug report. I've been making changes to the TPTP translator recently and must have introduced a bug. That shouldn't affect browsing/editing/NLP functions in Sigma for the time being. I can replicate the error and will see if there's a quick fix.

apease commented 2 years ago

Interesting, the translator to TPTP is working and Vampire gets the expected answer but then Sigma has an error upon parsing the proof...

apease commented 2 years ago

I've pushed a fix. I just hadn't set an internal flag to use Vampire for this test. Please let me know if it works for you now.

ArunSingh94 commented 2 years ago

Yes it works now! Thank you for your help Adam.

ArunSingh94 commented 2 years ago

Hello again Adam!

I'm not sure if this belongs as a new issue, please let me know if so.

I was trying a fresh install of SUMO and ran into a couple errors when running the ant command.

compile:
    [mkdir] Created dir: /home/arun/workspace/TPTP-ANTLR/build/classes
    [javac] Compiling 18 source files to /home/arun/workspace/TPTP-ANTLR/build/classes
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:12: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.JUnitCore;
    [javac]                        ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:13: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.Request;
    [javac]                        ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:14: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.Result;
    [javac]                        ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:3: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:7: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:8: error: package org.junit does not exist
    [javac] import org.junit.BeforeClass;
    [javac]                 ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:17: error: cannot find symbol
    [javac]     @BeforeClass
    [javac]      ^
    [javac]   symbol:   class BeforeClass
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:57: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:71: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:83: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:96: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:108: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/src/java/tptp_parser/ThfAstGen.java:22: warning: [deprecation] ANTLRInputStream in org.antlr.v4.runtime has been deprecated
    [javac]     public static ParseContext parse(ANTLRInputStream inputStream, String rule, String name) throws ParseException {
    [javac]                                      ^
    [javac] /home/arun/workspace/TPTP-ANTLR/src/java/tptp_parser/ThfAstGen.java:72: warning: [deprecation] ANTLRInputStream in org.antlr.v4.runtime has been deprecated
    [javac]          return ThfAstGen.parse(new ANTLRInputStream(inputString), rule, name);
    [javac]                                     ^
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:25: error: cannot find symbol
    [javac]             Request request = Request.method(Class.forName(classAndMethod[0]),
    [javac]             ^
    [javac]   symbol:   class Request
    [javac]   location: class SingleJUnitTestRunner
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:25: error: cannot find symbol
    [javac]             Request request = Request.method(Class.forName(classAndMethod[0]),
    [javac]                               ^
    [javac]   symbol:   variable Request
    [javac]   location: class SingleJUnitTestRunner
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:28: error: cannot find symbol
    [javac]             Result result = new JUnitCore().run(request);
    [javac]             ^
    [javac]   symbol:   class Result
    [javac]   location: class SingleJUnitTestRunner
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/SingleJUnitTestRunner.java:28: error: cannot find symbol
    [javac]             Result result = new JUnitCore().run(request);
    [javac]                                 ^
    [javac]   symbol:   class JUnitCore
    [javac]   location: class SingleJUnitTestRunner
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:51: error: cannot find symbol
    [javac]         assertEquals(expectTHF, actualTHF);
    [javac]         ^
    [javac]   symbol:   method assertEquals(String,String)
    [javac]   location: class THFTest
    [javac] /home/arun/workspace/TPTP-ANTLR/test/src/main/java/tptp_parser/THFTest.java:52: error: cannot find symbol
    [javac]         assertEquals(expectSUMO, actualSUMO);
    [javac]         ^
    [javac]   symbol:   method assertEquals(String,String)
    [javac]   location: class THFTest
    [javac] 18 errors
    [javac] 2 warnings

I tried adding some junit dependencies to the pom.xml file in /home/workspace/TPTP-ANTLR/test but that didn't work. If this is the problem, I'm not sure I'm adding the correct dependency.

Some of the ones I tried are:

<dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
</dependency>

and

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.2.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-runner</artifactId>
    <version>1.2.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-params</artifactId>
    <version>5.2.0</version>
    <scope>test</scope>
</dependency>

Appreciate any help in advance. Thanks.

apease commented 2 years ago

Hi Arun, It looks like I neglected to add necessary libraries to the TPTP-ANTLR/lib directory. I've added them now. Could you do a git pull and try again?

ArunSingh94 commented 2 years ago

Yes that fixed the issue. Thank you Adam.

apease commented 2 years ago

excellent, many thanks for the bug report