License build Documentation Status Gitter

SQL Model Example

This example demonstrates the relatively complex case of taking an existing SQL schema and developing a natural language interface to it. Although it does not support many standard SQL capabilities (to limit the size of the example itself) - it is designed in a such a way that it can be easily extended and developed further.

Running

This example can be run the same way as other examples with one exception - it needs to run H2 database server. The unit test for this example runs H2 database server automatically (which can be run manually, if necessary). You need to start H2 database server standalone when you are using NCSqlModelGenerator model generation utility. You can run necessary JVMs for this example similarly from command line or IDE. NOTE: that you don't need to start Data Probe standalone if you are only running the unit test as it uses the embedded probe and starts it automatically:

  • Run REST server:

    • Main class: org.apache.nlpcraft.NCStart
    • Program arguments: -server
  • To run unit test with embedded probe:

    • JUnit 5 test: org.apache.nlpcraft.examples.sql.SqlTest
  • To run probe standalone and use your own REST client:

    • Main class: org.apache.nlpcraft.NCStart
    • VM arguments: -Dconfig.override_with_env_vars=true
    • Environment variables: CONFIG_FORCE_nlpcraft_probe_models.0=org.apache.nlpcraft.examples.sql.SqlModel
    • Program arguments: -probe

    When running data probe standalone you need run H2 database sever manually (from command line or IDE):

    • Main class: org.apache.nlpcraft.examples.sql.db.SqlServerRunner

Documentation

See Getting Started guide for more instructions on how to run these examples.

For any questions, feedback or suggestions:

Copyright

Copyright (C) 2020 Apache Software Foundation