Talking to Your Database

Dateline: 10/12/99

Although today's visual data wizards offer easy access to data stored in modern relational databases, SQL (Structured Query Language) is still the premium choice for professional programmers. However, almost all of database query languages tend to be rigid and difficult to learn, not to mention that is is often difficult even for the experienced user to get the desired information out of databases. A natural language interface to the SQL language overcomes the need for users to master the complexities of SQL. There are several software products on the market that enable users to access the vital business or personal information by typing questions in plain and simple English.


A natural language interface to the SQL language overcomes the need for users to master the complexities of SQL.

ELF

Access ELF from Elf Software Co. understands your plain-English questions and translates them into SQL, the native language for Microsoft Access. One of its main strengths is a full and easy customization process. There are no long "word-definition" dialogs - Access ELF includes its own 16,000 word dictionary. You can add words, phrases, and edit the system grammar. The rules that the ELF engine uses to translate between English and SQL are not hard-coded into the software, but are distributed as part of the package in a set of Microsoft Access tables. These rules can be translated for use with other languages besides English (although it may be a difficult task). People at Elf Software will begin integrating their software with the popular commercial speech recognition sometime next year.

VB ELF can be used to add natural language database query capability to any Visual Basic database application. As of version 2.0, VB ELF supports SQL Server 7.0 T-SQL as well as Oracle's PL/SQL dialect. Every feature available in the earlier Jet-only version of the software has been extended to these new dialects - whether or not they are natively supported by the language. It is the only royalty-free natural language interface available for Jet, ODBC and OLE DB data sources, and the only natural language interface which supports OLE DB data access. Other features include support for triggering a VBScript or JScript applet for any word or phrase typed by users.

Microsoft English Query

English Query is a component of SQL Server 7.0 that provides the ability for users to query databases using plain English. The development process is at higher level than traditional programming, but can be mastered by non-programmers with some database background. To implement natural language searching, you first use the authoring tool to provide domain knowledge to the engine. The authoring tool is used to relate database entities to objects in the domain. For example, user needs to create a verb relationship between salespeople table and a products table by indicating that "salespeople sell products." English Query engine than uses these relationships to perform natural language parsing of users' questions, which provides better search results than you would get using keyword-based technology. It can be embedded into any application that supports COM, but most commonly it's embedded into a Web site built with ASP scripts. For more information, see Microsoft's technical white paper, "Developing with Microsoft English Query in Microsoft SQL Server 7.0"

English Wizard

Dr. Larry Harris, chairman of Linguistic Technology, developed English Wizard as the successor to AI Corp.'s, mainframe natural language product called Intellect, which he also developed. The company has recently changed its name to EasyAsk Inc. and subsequently started to launch new business intelligence and e-commerce solutions. As a base product, English Wizard can be deployed in various configurations: as a stand-alone query tool, an add-in for popular reporting tools, a DLL, OCX, VBX component or a web server. It uses a semantic layer with a dictionary initially built from database metadata to translate English questions into SQL queries. Besides a basic English vocabulary, the English Wizard dictionary includes or determines from the target database a thesaurus, special date support, database definitions, and join logic. Dictionary Editor can be used to modify the dictionary by adding business-specific phrases or restricting database views.
Other interesting products include English Wizard/Voice for converting spoken queries into SQL required by the database, and English Wizard SDK/Voice for developing custom software solutions using application program interfaces (APIs) for popular development environments such as C/C++, VisualBasic, PowerBuilder, Delphi and Informix. Both products use DragonDictate voice recognition engine for speech recognition.

NLBean

The NLBean is a freeware natural language interface to databases written by Mark Watson, author of several excellent Java programming books. Its Open Source distribution is distributed as a small ZIP file that contains the source code, UML class diagrams, and a compiled version ready to run.
The previous version of the NLBean contained JDBC code to access local databases. This new version relies on Java bean properties to specify database names, table names, and any column names that might be useful for parsing natural language queries and converting these queries into SQL queries.

InterBase

InterBASE (InterB), "natural-language shell for common DBMS", is one of the oldest products in this category: it doesn't support relational databases. Its MS-DOS version has been distributed as a shareware for a number of years, and it works with the Russian and English languages for the DBMS supporting the dbf standard: dBase, FoxBASE, FoxPro, and Clipper. It can also be combined with voice recognition systems, and serve as a basis for interfaces understanding spoken queries/messages of the user. However, taking into account the level of technology used here, there is a small chance that it can be deployed for new projects using modern database engines.

Scripting language for the next century

While we are on the subject of natural language interfaces, let's mention a newcomer in the field of programming/scripting languages. REBOL (Relative Expression-Based Object Language) introduces the concept of a messaging language, which puts it in the same category with other natural languages like English. Today's mainstream computer languages are used to command and compute, while REBOL is used to communicate or describe, providing a seamless network connectivity to the Internet protocols such as HTTP, FTP, SMTP, POP, NNTP, Finger, etc. While it is still formal language like Java or C, its "commands" can take on different meanings in different context just like in the case of an informal language like English. This way the language can evolve and create variations for domain-specific communication as users' needs are evolving. It uses syntactic and semantic structure very similar to ordinary everyday English. While scripting languages like Tcl/Tk, PERL and Python are easier than standard programming languages like Java, REBOL beats all of them taking simplicity as a key virtue in a complex programming environments. Of course, it has some minor drawbacks (performance can be an issue here, but "not another scripting language" effect was the greatest problem with the people I've talked to about REBOL).
"Write once-run anywhere" philosophy is not limited to Java anymore: the same unmodified REBOL code will run on a server, a desktop, a set-top, a PDA, or a cell phone (around 40 platforms are already supported, from Amiga And BeOS to IRIX and Solaris).
REBOL is probably the best tool to glue together components of your complex, distributed AI applications. For an illustration, the program that sends an email message to your guide is exactly one line "long":

send [email protected] "Hello there!" 

The program that downloads the content of a Web page and stores it into the local file is still very simple:
page: read https://aboutai.net/
write %about.htm page 

So, forget complex shell scripts or CGI programs, and make simple things simple to do. It is now available for free download along with the example script library and documentation, and will be a great addition for every programmer's toolbox.

   Site(s) of interest: