Skip to content

Commit 53dacb5

Browse files
authored
Merge pull request #123 from ppasupat/fix-sparql-doc
Updated contents on SPARQL in README / TUTORIAL
2 parents 3b31ba7 + f0248a0 commit 53dacb5

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,12 @@ For Ubuntu, follow this:
123123
sudo apt-get install -y automake gawk gperf libtool bison flex libssl-dev
124124

125125
# Clone the repository
126-
git clone https://github.com/openlink/virtuoso-opensource
127-
cd virtuoso-opensource
128-
git checkout tags/v7.0.0
126+
./pull-dependencies virtuoso
129127

130-
# Configure
128+
# Make and install
129+
cd virtuoso-opensource
131130
./autogen.sh
132-
mv INSTALL INSTALL.txt # Avoid conflict on case-insensitive file systems
133131
./configure --prefix=$PWD/install
134-
135-
# Make (this takes a while)
136132
make
137133
make install
138134
cd ..

TUTORIAL.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Recall that in semantic parsing, *natural language utterances* are mapped into
1717
*logical forms* (think programs), which are executed to produce some
1818
*denotation* (think return value).
1919

20-
We have assumed you have already downloaded SEMPRE and can open up a shell:
20+
We have assumed you have already [installed](README.md#installation)
21+
SEMPRE and can open up a shell:
2122

2223
./run @mode=simple
2324

@@ -32,7 +33,7 @@ shell command and executes it. To see which command is run, do:
3233

3334
This should print out:
3435

35-
rlwrap java -cp libsempre/*:lib/* -ea edu.stanford.nlp.sempre.Main -interactive
36+
java -cp libsempre/*:lib/* -ea edu.stanford.nlp.sempre.Main -Main.interactive
3637

3738
You can pass in additional options:
3839

@@ -586,7 +587,7 @@ To stop the server:
586587
### Setting up a copy of Freebase
587588

588589
The best case is someone already installed Freebase for you and handed you a
589-
host:port. Otherwise, to run your own copy of the Freebase graph (a
590+
host:port. Otherwise, to run your own copy of the entire Freebase graph (a
590591
2013 snapshot), read on.
591592

592593
Download it (this is really big and takes a LONG time):
@@ -611,12 +612,9 @@ We assume you have started the Virtuoso database:
611612

612613
Then start up a prompt:
613614

614-
./run @mode=simple-freebase @sparqlserver=localhost:3001
615-
616-
The simplest logical formula in lambda DCS is a single entity:
617-
618-
fb:en.california
615+
./run @mode=simple-freebase-nocache @sparqlserver=localhost:3001
619616

617+
The simplest logical formula in lambda DCS is a single entity such as `fb:en.california`.
620618
To execute this query, simply type the following into the interactive prompt:
621619

622620
(execute fb:en.california)
@@ -753,7 +751,7 @@ is the basis for the overloading.
753751

754752
Now start the interactive prompt:
755753

756-
./run @mode=simple-freebase @sparqlserver=localhost:3001 -Grammar.inPaths freebase/data/tutorial-freebase.grammar -SimpleLexicon.inPaths freebase/data/tutorial-freebase.lexicon
754+
./run @mode=simple-freebase-nocache @sparqlserver=localhost:3001 -Grammar.inPaths freebase/data/tutorial-freebase.grammar -SimpleLexicon.inPaths freebase/data/tutorial-freebase.lexicon
757755

758756
We should be able to parse the following utterances:
759757

run

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,22 @@ addMode('simple-freebase', 'Simple shell for using Freebase', lambda { |e| l(
489489
o('Main.interactive'),
490490
nil) })
491491

492+
addMode('simple-freebase-nocache', 'Simple shell for using Freebase (without a cache server)', lambda { |e| l(
493+
'java', '-Dmodules=core,freebase', '-cp', 'libsempre/*:lib/*', '-ea', 'edu.stanford.nlp.sempre.Main',
494+
o('executor', 'freebase.SparqlExecutor'),
495+
letDefault(:sparqlserver, 'freebase.cloudapp.net:3093'),
496+
sparqlOpts,
497+
o('FeatureExtractor.featureDomains', 'rule'),
498+
o('Parser.coarsePrune'),
499+
o('JoinFn.typeInference'),
500+
o('UnaryLexicon.unaryLexiconFilePath', '/dev/null'),
501+
o('BinaryLexicon.binaryLexiconFilesPath', '/dev/null'),
502+
#o('JoinFn.showTypeCheckFailures'), # Use this to debug
503+
o('Grammar.inPaths', 'freebase/data/demo1.grammar'), # Override with your own custom grammar
504+
#o('SparqlExecutor.includeSupportingInfo'), # Show full information
505+
o('Main.interactive'),
506+
nil) })
507+
492508

493509
############################################################
494510
# {2014-12-27} [Percy]: Overnight semantic parsing

src/edu/stanford/nlp/sempre/JoinFn.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class JoinFn extends SemanticFn {
2323
public static class Options {
2424
@Option(gloss = "Verbose") public int verbose = 0;
2525
@Option public boolean showTypeCheckFailures = false;
26-
@Option public boolean typeInference = false;
26+
@Option public boolean typeInference = true;
2727
// TODO(joberant): this flag is for backward compatibility. If we don't
2828
// need it for the new results, get rid of it.
29-
@Option public boolean specializedTypeCheck = true;
29+
@Option public boolean specializedTypeCheck = false;
3030
}
3131

3232
public static Options opts = new Options();

0 commit comments

Comments
 (0)