THF translation is broken
Opened this issue · 6 comments
It looks like the code has some hardcoded path, see sigma-2-02
that doesn't exist in my system:
% java -Xmx7g -classpath $SIGMA_CP com.articulate.sigma.trans.THF
Info in KBmanager.initializeOnce()
Info in KBmanager.initializeOnce(): initializing with /Users/arademaker/sigma-2-02/KBs
KBmanager.readConfiguration()
INFO in KBmanager.writeConfiguration()
Error writing file /Users/arademaker/sigma-2-02/KBs/config.xml.
/Users/arademaker/sigma-2-02/KBs/config.xml (No such file or directory)
ERROR in KBmanager.readConfiguration(/Users/arademaker/sigma-2-02/KBs):
Exception parsing configuration file
Error writing file /Users/arademaker/sigma-2-02/KBs/config.xml.
/Users/arademaker/sigma-2-02/KBs/config.xml (No such file or directory)
java.io.IOException: Error writing file /Users/arademaker/sigma-2-02/KBs/config.xml.
/Users/arademaker/sigma-2-02/KBs/config.xml (No such file or directory)
at com.articulate.sigma.KBmanager.writeConfiguration(KBmanager.java:770)
at com.articulate.sigma.KBmanager.readConfiguration(KBmanager.java:537)
at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:586)
at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:561)
at com.articulate.sigma.trans.THF.main(THF.java:2049)
Error reading configuration file in KBmanager.initializeOnce()
java.lang.Exception: Error reading configuration file in KBmanager.initializeOnce()
at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:588)
at com.articulate.sigma.KBmanager.initializeOnce(KBmanager.java:561)
at com.articulate.sigma.trans.THF.main(THF.java:2049)
KBmanager.getKB(): KB SUMO not found.
Test on all KB kb content:
java.lang.NullPointerException
at com.articulate.sigma.trans.THF.main(THF.java:2061)
from the line
java.io.IOException: Error writing file /Users/arademaker/sigma-2-02/KBs/config.xml
it looks like you may not have set your $SIGMA_HOME environment variable
Indeed, the recently update of macOS to zsh caused some troubles to me. But after solving the ENVIRONMENT issues, I got:
% java -Xmx7g -classpath $SIGMA_CP com.articulate.sigma.trans.THF
Info in KBmanager.initializeOnce()
Info in KBmanager.initializeOnce(): initializing with /Users/ar/workspace/KBs
KBmanager.readConfiguration()
KBmanager.serializedExists(): true
KBmanager.serializedOld(config):
KBmanager.serializedOld(config): save date: Wed Nov 06 12:28:34 BRST 2019
kbsFilenamesFromXML(): Completed loading KB names
KBmanager.serializedOld(config): returning false (not old)
KBmanager.loadSerialized(): KBmanager has been deserialized
WordNet.initOnce(): using baseDir = /Users/ar/workspace/sumo/WordNetMappings
WordNet.loadFresh():
INFO in WordNet.compileRegexPatterns(): compiling patterns
INFO in WordNet.readNouns(): Reading WordNet noun files
..................................................................................x
2.55 seconds to process /Users/ar/workspace/sumo/WordNetMappings/WordNetMappings30-noun.txt with 82241 lines
0.007 seconds to process /Users/ar/workspace/sumo/WordNetMappings/noun.exc
INFO in WordNet.readVerbs(): Reading WordNet verb files
.............x
0.236 seconds to process /Users/ar/workspace/sumo/WordNetMappings/WordNetMappings30-verb.txt with 13837 lines
0.002 seconds to process /Users/ar/workspace/sumo/WordNetMappings/verb.exc
INFO in WordNet.readAdjectives(): Reading WordNet adjective files
..................x
0.255 seconds to process /Users/ar/workspace/sumo/WordNetMappings/WordNetMappings30-adj.txt with 18226 lines
INFO in WordNet.readAdverbs(): Reading WordNet adverb files
...x
0.046 seconds to process /Users/ar/workspace/sumo/WordNetMappings/WordNetMappings30-adv.txt with 3691 lines
INFO in WordNet.readWordFrequencies(): Reading WordNet word frequencies
.................................x
1.059 seconds to process /Users/ar/workspace/sumo/WordNetMappings/wordFrequencies.txt
INFO in WordNet.readStopWords(): Reading stop words
0.0 seconds to process /Users/ar/workspace/sumo/WordNetMappings/stopwords.txt
INFO in WordNet.readSenseIndex(): Reading WordNet sense index
..............................................................................................................................................................................................................x
0.662 seconds to process /Users/ar/workspace/sumo/WordNetMappings/index.sense with 206000 senses.
INFO in WordNet.readSenseCount(): Reading WordNet sense counts
.....Info in WordNet.readSenseCount(): > 100 missing senses, suppressing messages
................................x
0.219 seconds to process /Users/ar/workspace/sumo/WordNetMappings/cntlist with 37000 senses.
INFO in WordNet.serialize(): origMaxNounSynsetID: 15300051 and: 15300051
WordNet.serialize(): WN has been serialized
ENTER DB.readSpreadsheet(/Users/ar/workspace/sumo/WordNetMappings/sentiment.csv, null)
ENTER DB.readSpreadsheet(java.io.FileReader@7383ac7f, null)
EXIT DB.readSpreadsheet(java.io.FileReader@7383ac7f, null)
rows == [list of 8222 rows]
0.088 seconds elapsed time
EXIT DB.readSpreadsheet(/Users/ar/workspace/sumo/WordNetMappings/sentiment.csv, null)
NLGUtils.init(): initializing with /Users/ar/workspace/KBs
NLGUtils.readKeywordMap():
NLGUtils.serializedExists(): true
NLGUtils.loadSerialized()
NLGUtils.loadSerialized(): NLGUtils has been deserialized
INFO in OMWordnet.readOMWfiles(): reading files:
OMWordnet.loadSerialized(): OMW has been deserialized
VerbNet.readVerbFiles(): loading files from:
VerbNet.readVerbFiles(): no such dir:
Info in KBmanager.initializeOnce(): initialized is true
KBmanager.getKB(): KB SUMO not found.
Test on all KB kb content:
java.lang.NullPointerException
at com.articulate.sigma.trans.THF.main(THF.java:2061)
it looks like you may have pointed your $SIGMA_HOME to your $ONTOLOGYPORTAL_GIT and they can't be the same. If you set your environment variables as in the install instructions it will probably solve this. If that isn't it, please delete your catalina.out, restart Tomcat, and send me your catalina.out file and I'll take a look
Yes, all sumo files are in my ~/workspace
... is it a problem? Why? The other transformations are working correctly. My ENV is the following:
# environment for SigmaKEE and SUMO
export SIGMA_SRC=/Users/ar/workspace/sigmakee
export SIGMA_HOME=/Users/ar/workspace
export SIGMA_CP=$SIGMA_SRC/build/classes:$SIGMA_SRC/build/lib/*:$SIGMA_SRC/lib/*
export ONTOLOGYPORTAL_GIT=~/workspace
export CATALINA_OPTS="$CATALINA_OPTS -Xms500M -Xmx2500M"
export CATALINA_HOME=/Users/ar/workspace/apache-tomcat-8.5.23
yes that is a problem. As per the installation README, you should have a .sigmakee directory in which Sigma keeps copies of the files it displays, and a Git repository (under ~/workspace). If you put them in the same place files can clash during loading and saving. It's a good practice to follow the instructions exactly and be sure everything is working before attempting to change the installation.
OK, but this doesn't explain why the other transformations are working and only the THF gives me the error:
KBmanager.getKB(): KB SUMO not found.
Test on all KB kb content:
java.lang.NullPointerException
at com.articulate.sigma.trans.THF.main(THF.java:2061)
The #52 fixed it.
Regarding now following the instructions, it is good to have some flexibility to allow personal preferences. Since the configuration is based on ENV variables, one should be free to choose the best way to organize the directories. But
files can clash during loading and saving
It would be nice to have in the documentation something about what actions could change files (and what files) on the disk. I thought that KIF files are only manually edited. If that is the case, I prefer to have KBs as a symbolic link to the SUMO directory. In that way: (1) I don't duplicate files; 2) changes in the KIF are reflected in the SigmaKEE web interface without the need to copy files (OK, maybe I would still need to restart SigmaKEE, bad but not a big problem).
Having the KBs symbolic linked to SUMO repository is also good to understand what was touched by SigmaKEE. In my computer, I see that SigmaKEE creates some .ser
files that I added in the .gitignore
:
% git st
?? NLGUtils.ser
?? WordNetMappings/omw.ser
?? WordNetMappings/wn.ser
?? kbmanager.ser