Natural Language Interface to DataBases
Parse the input and map nodes to SQL components and database attributes.
Adjust the structure of the parse tree to make it syntactically valid.
Translate the parse tree to an SQL query.
change some thing to set CI
Note:
All terminal nodes are defined in the paper.
+ represents a parent-child relationship.
* represents a sibling relationship.
One Query (Q) can must have one SClause and zero or more ComplexConditions.
A ComplexCondition must have one ON, with a leftSubtree and a rightSubtree.
An NP is: one NN (since an SQL query has to select at least one attribute), whose children
are multiple NNs and Conditions. (All other selected attributes and conditions are stacked
here to form a wide "NP" tree.)
This is a project managed using maven. Just in case, if you don't know about maven, checkout this wonderful tutorial, which you have to pay for though...
Right now it uses the dblp database on local machine. To connect to the database, make sure you have database "dblp" on your localhost with post 5432, accessible to user "dblpuser" with password "dblpuser". Or modify the startConnection()
method in class Controller
to connect to database.
To get hands on the development, import it into eclipse, but first make sure you've installed the following eclipse plugins:
To use WordNet inside the project (I'm using MIT JWI as the interface, which is already included in maven pom.xml
):
com.dukenlidb.nlidb.model.WordNet
.)The entry point of the application is the com.dukenlidb.nlidb.main()
method in UserView
class.