sempre
sempre copied to clipboard
Can't run query mode or simple-freebase mode
Hello,
When I try to run this query: ./run @mode=query @sparqlserver=localhost:3001 -formula '(fb:location.location.containedby fb:en.california)'
I get the following error: Error: Could not find or load main class edu.stanford.nlp.sempre.freebase.SparqlExecutor Command failed: java -ea -cp libsempre/:lib/ edu.stanford.nlp.sempre.freebase.SparqlExecutor -SparqlExecutor.endpointUrl http://localhost:3001/sparql -formula (fb:location.location.containedby fb:en.california)
And when I try to run simple-freebase mode: ./run @mode=simple-freebase @sparqlserver=localhost:3001
I get this error: Problem processing: freebase edu.stanford.nlp.sempre.freebase.BinaryLexicon Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.freebase.BinaryLexicon at edu.stanford.nlp.sempre.Master.getOptionsParser(Master.java:443) at edu.stanford.nlp.sempre.Main.main(Main.java:38) Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.sempre.freebase.BinaryLexicon at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at edu.stanford.nlp.sempre.Master.getOptionsParser(Master.java:437) ... 1 more Command failed: java -Dmodules=core,freebase -cp libsempre/:lib/ -ea edu.stanford.nlp.sempre.Main -executor freebase.SparqlExecutor -SparqlExecutor.endpointUrl http://localhost:3001/sparql -FreebaseSearch.cachePath FreebaseSearch.cache -EntityLexicon.mid2idPath freebase.cloudapp.net:4000:freebase-rdf-2013-06-09-00-00.canonical-id-map.gz -TypeInference.typeLookup freebase.FreebaseTypeLookup -FreebaseTypeLookup.entityTypesPath freebase.cloudapp.net:4000:freebase-rdf-2013-06-09-00-00.canonicalized.en-types.gz -EntityLexicon.maxEntries 2 -FeatureExtractor.featureDomains rule -Parser.coarsePrune -JoinFn.typeInference -UnaryLexicon.unaryLexiconFilePath /dev/null -BinaryLexicon.binaryLexiconFilesPath /dev/null -Grammar.inPaths freebase/data/demo1.grammar -SparqlExecutor.returnTable -Main.interactive
These errors persist despite running ./pull-dependencies freebase make freebase
Any thoughts? osmode
Hi, osmode. Could you try running ant clean
and then ant
? Maybe the class was not compiled correctly.
Thanks for your quick reply, ppasupat. When I run "ant clean" and "ant", I get:
... [echo] Compiling semparse: freebase [mkdir] Created dir: /home/breitkopf/Desktop/sempre/classes/freebase [javac] Compiling 55 source files to /home/breitkopf/Desktop/sempre/classes/freebase [javac] Note: /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/freebase/LambdaCalculusConverter.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [jar] Building jar: /home/breitkopf/Desktop/sempre/libsempre/sempre-freebase.jar
tables: [echo] Compiling semparse: tables [mkdir] Created dir: /home/breitkopf/Desktop/sempre/classes/tables [javac] Compiling 50 source files to /home/breitkopf/Desktop/sempre/classes/tables [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/ConvertCsvToTtl.java:7: error: package au.com.bytecode.opencsv does not exist [javac] import au.com.bytecode.opencsv.CSVReader; [javac] ^ [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/TableKnowledgeGraph.java:6: error: package au.com.bytecode.opencsv does not exist [javac] import au.com.bytecode.opencsv.CSVReader; [javac] ^ [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/ConvertCsvToTtl.java:205: error: cannot find symbol [javac] try (CSVReader csv = new CSVReader(new FileReader(inPath))) { [javac] ^ [javac] symbol: class CSVReader [javac] location: class ConvertCsvToTtl [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/ConvertCsvToTtl.java:205: error: cannot find symbol [javac] try (CSVReader csv = new CSVReader(new FileReader(inPath))) { [javac] ^ [javac] symbol: class CSVReader [javac] location: class ConvertCsvToTtl [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/TableKnowledgeGraph.java:181: error: cannot find symbol [javac] try (CSVReader csv = new CSVReader(new FileReader(filename))) { [javac] ^ [javac] symbol: class CSVReader [javac] location: class TableKnowledgeGraph [javac] /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/TableKnowledgeGraph.java:181: error: cannot find symbol [javac] try (CSVReader csv = new CSVReader(new FileReader(filename))) { [javac] ^ [javac] symbol: class CSVReader [javac] location: class TableKnowledgeGraph [javac] Note: /home/breitkopf/Desktop/sempre/src/edu/stanford/nlp/sempre/tables/features/PredicateInfo.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 6 errors
BUILD FAILED /home/breitkopf/Desktop/sempre/build.xml:25: The following error occurred while executing this line: /home/breitkopf/Desktop/sempre/build.xml:75: Compile failed; see the compiler error output for details.
I see. Could you try ant clean
and then ant freebase corenlp
?
This fixed half the problem. Now I can run this query: ./run @mode=query @sparqlserver=localhost:3001 -formula '(fb:location.location.containedby fb:en.california)'
However, when I try to run: ./run @mode=simple-freebase @sparqlserver=localhost:3001
I get this error:
main() {
Grammar.read {
Lexicon() {
Loading unary lexicon file /dev/null {
Number of lexemes: 0
}
Loading Freebase schema: lib/fb_data/93.exec/schema2.ttl {
1163 CVTs, (19337,19282) property types, 858 property units
}
Loading formula info... {
Adding schema properties
Current number of binary formulas: 19278
Current number of unary formulas: 19284
Compuing reverse for schema formulas
Adding reverse formulas: 19278
Current number of binary formulas: 38556
Generate formulas through CVTs
Current number of binary formulas: 57226
} [1.5s, cum. 2.3s]
Loading binary lexicon file /dev/null {
Number of entries: 0
}
} [2.3s, cum. 2.3s]
RemoteStringCache: connecting to freebase.cloudapp.net:4000 to access freebase-rdf-2013-06-09-00-00.canonicalized.en-types.gz
java.lang.RuntimeException: java.net.UnknownHostException: freebase.cloudapp.net
at edu.stanford.nlp.sempre.cache.RemoteStringCache.
I'll venture a guess here and say that this is a freebase connection error ("connecting to freebase.cloudapp.net:4000 ...")
I'm able to start simple-sparql mode just fine and run a few basic queries that way: ./run @mode=simple-sparql @sparqlserver=localhost:3001
Thanks very much for all of your help ppasupat.
Has anyone recently been able to run simple-freebase mode?
I'm able to run some examples in simple-sparql mode, but I would like to use my own custom triples, and this is where I'm getting stuck. I set up an Apache Jena server to do this, but I'm having trouble finding a mode that will let me take advantage of using my own RDF client. Can anyone point me in the right direction?
@osmode ,i get the same problem with you, but i also don't know how to solve it.
@percyliang I got the same problem
Same problem, simple-freebase mode is giving the error
The command:
./run @mode=simple-freebase @sparqlserver=localhost:3001
works if I remove the following rule from demo1.grammar:
(rule $NP (actors) (ConstantFn (fb:people.person.profession fb:en.film_actor)))
I don't know why though
Basically the Virtuoso instance on the default URL (cloudapp.net) is already dead. You can still use your local Virtuoso instance though.
For the simple-freebase mode, the cache server must also be specified. To start the cache server, run:
./run @mode=cacheserver -readOnly -capacity MAX -basePath lib/fb_data
To specify a port, add @port=[portnumber]
to the command. The default port is 4000.
Then try:
./run @mode=simple-freebase @sparqlserver=localhost:3001 @cacheserver=localhost:4000
If you run the SPARQL server on another port, use that port number instead of 3001.
@argoel You solution works for me.
@argoel what is the expected output of the sentence "height of tom cruise" if i run the following: ./run @mode=simple-freebase @sparqlserver=localhost:3001
Also, do i need to comment out the (rule $NP ($Str) (LexiconFn entity fbsearch)), as it says freebase search api is deprecated.
And, do i need to download the whole freebase database?