Formal syntax

Yes, we have listed it as a feature! Systems that allow free form natural input have inherent ambiguities during interpretation. NLQ avoids ambiguities by accepting a formal language, which is free of ambiguities and yet feels like natural language.

"But isn't that restrictive?", you might ask. Well, the next feature addresses that.

Suggestions as you type

The system automatically suggests valid completions while the user types his query. This helps the user to formulate their query correctly. The speed of the completion system is fast enough to give real-time feedback to the user. (Give the demo a spin)

This feature is important because the parser is not tolerant of errors in input. It is a unique approach among natural language systems. Other systems that don't have completion either return an error on partial input or try to guess the user's intention. The former is inconvenient, while the latter can lead to ambiguious output.

High level model

NLQ takes as input a high level model of the database and generates a parser for querying this database automatically. The model is an Entity-Relationship diagram which can be expressed in text, XML, or a Scala DSL.

Here is an example of a complete model expressed in a Scala DSL:

val paymentEntity = Entity("payment"KeyAttrib("id"),

                            DatePropAttrib("date", "made", ""),

                            IntValueAttrib("amount"))


val companyEntity = Entity("company"KeyAttrib("id"),

                            StringValueAttrib("name"),

                            StringPropAttrib("city", "located in", "in"))


val relationPayCmpny = RelationTwoTable (

                            companyEntity, paymentEntity,

                            "which made", "made by", "id", "company_id")

For a complete example with comments see here