This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-website.git
The following commit(s) were added to refs/heads/master by this push:
new c5d07fb WIP.
c5d07fb is described below
commit c5d07fbc14c501dc48e2123411cafb9920bfbe03
Author: Aaron Radzinski <[email protected]>
AuthorDate: Mon Jan 11 15:08:28 2021 -0800
WIP.
---
community.html | 4 +-
download.html | 6 +-
examples/sql_model.html | 2 +-
server-and-probe.html | 18 ++---
tools/embedded_probe.html | 3 +
tools/script.html | 6 +-
tools/sql_model_gen.html | 173 ++++++++++++----------------------------------
tools/syn_tool.html | 4 +-
tools/test_framework.html | 8 +--
9 files changed, 71 insertions(+), 153 deletions(-)
diff --git a/community.html b/community.html
index 16396c2..c9e153e 100644
--- a/community.html
+++ b/community.html
@@ -190,13 +190,13 @@ layout: interior
<ul>
<li>
Add remote for Apache NLPCraft mirror as a remote
(you need to do it <b>once</b>):
- <pre class="brush: plain">
+ <pre class="brush: bash">
git remote add upstream
https://github.com/apache/incubator-nlpcraft.git
</pre>
</li>
<li>
Each time when you want to update your local
<code>master</code> do the following:
- <pre class="brush: plain">
+ <pre class="brush: bash">
git pull upstream
git checkout release
</pre>
diff --git a/download.html b/download.html
index fd999c7..35ad0b6 100644
--- a/download.html
+++ b/download.html
@@ -183,12 +183,12 @@ layout: interior
the following commands:
</p>
<b>Unpack the source package:</b>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ unzip -q
apache-nlpcraft-incubating-{{site.latest_version}}.zip
$ cd apache-nlpcraft-incubating-{{site.latest_version}}
</pre>
<b>Build NLPCraft:</b>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ mvn clean package -DskipTests
</pre>
<p>
@@ -306,7 +306,7 @@ layout: interior
<p>
If you want to contribute to the project you need to get the
full developer snapshot from <a target="github"
href="https://github.com/apache/incubator-nlpcraft">GitHub</a> mirror:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ git clone https://github.com/apache/incubator-nlpcraft.git
$ mvn clean package
</pre>
diff --git a/examples/sql_model.html b/examples/sql_model.html
index 4fa94b6..90b4f00 100644
--- a/examples/sql_model.html
+++ b/examples/sql_model.html
@@ -187,7 +187,7 @@ id: sql_model
by starting H2 database (using <code>SqlServerRunner</code>
application in <code>db/SqlServer.java</code> file)
and running SQL Model Generator as follows:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator -r
jdbc:h2:tcp://localhost:9092/nlp2sql -d org.h2.Driver -s PUBLIC -o
src/main/scala/org/apache/nlpcraft/examples/sql/sql_model_init.yaml
</pre>
<p>
diff --git a/server-and-probe.html b/server-and-probe.html
index 1c3acee..1e61cc2 100644
--- a/server-and-probe.html
+++ b/server-and-probe.html
@@ -78,7 +78,7 @@ id: server_and_probe
</nav>
<div class="tab-content">
<div class="tab-pane fade show active" id="nav-srv-script"
role="tabpanel">
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ bin/nlpcraft.sh start-server
</pre>
<p>
@@ -86,7 +86,7 @@ id: server_and_probe
</p>
<ul>
<li>
- Use <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
+ <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
</li>
<li>
Run <code>bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
@@ -98,13 +98,13 @@ id: server_and_probe
<p>
If using just executable JAR:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ java -Xms1024m -jar
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar -server
</pre>
<p>
If specifying additional classpath components and need
<code>-cp</code> parameter:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ java -Xms1024m -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
org.apache.nlpcraft.NCStart -server
</pre>
<p>
@@ -157,7 +157,7 @@ id: server_and_probe
<p>
If Docker image is available for given version you can
start REST server as follows:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ docker run -m 8G -p 8081:8081 -p 8201:8201 -p 8202:8202
nlpcraftserver/server:{{site.latest_version}}
</pre>
</div>
@@ -223,7 +223,7 @@ id: server_and_probe
</nav>
<div class="tab-content">
<div class="tab-pane fade show active" id="nav-probe-script"
role="tabpanel">
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ bin/nlpcraft.sh start-probe
</pre>
<p>
@@ -231,7 +231,7 @@ id: server_and_probe
</p>
<ul>
<li>
- Use <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
+ <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
</li>
<li>
Run <code>bin/nlpcraft.sh help
--cmd=start-probe</code> to get a full help on this command.
@@ -243,13 +243,13 @@ id: server_and_probe
<p>
If using just executable JAR:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ java -jar
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar -probe
</pre>
<p>
If specifying additional classpath components and need
<code>-cp</code> parameter:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar:/my/project/classes
org.apache.nlpcraft.NCStart -probe -config=/my/project/probe.conf
</pre>
<p>
diff --git a/tools/embedded_probe.html b/tools/embedded_probe.html
index 13dd5d8..21b5019 100644
--- a/tools/embedded_probe.html
+++ b/tools/embedded_probe.html
@@ -137,6 +137,9 @@ public class AlarmTest {
resources on the REST server.
</li>
</ul>
+ <p>
+ Note that embedded probe is automatically used by the <a
href="/tools/test_framework.html#autotest">auto model validator</a>.
+ </p>
</section>
</div>
<div class="col-md-2 third-column">
diff --git a/tools/script.html b/tools/script.html
index 214d961..ef2a81d 100644
--- a/tools/script.html
+++ b/tools/script.html
@@ -121,19 +121,19 @@ id: script
You can run any external OS-specific commands from
<code>bin/nlpcraft.{sh|cmd}</code> script by prepending such
command with a <code>$</code> symbol. For example:
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
> $git pull
</pre>
<p style="margin-left: 20px">
Runs <code>git pull</code> command in the current directory.
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
> $ls -la
</pre>
<p style="margin-left: 20px">
Runs <code>ls -la</code> Unix shell command.
</p>
- <pre class="brush: plain">
+ <pre class="brush: bash">
> $cmd /c dir
</pre>
<p style="margin-left: 20px">
diff --git a/tools/sql_model_gen.html b/tools/sql_model_gen.html
index 19138ec..187e915 100644
--- a/tools/sql_model_gen.html
+++ b/tools/sql_model_gen.html
@@ -27,145 +27,60 @@ id: sql_model_gen
<p>
When using NLPCraft to develop natural language interface to the
existing SQL RDBMS one of the
routine tasks is to develop a data model that mirrors the SQL
schema for the given
- database. Doing it manually can be time consuming and error
prone...
+ database. Doing it manually can be time consuming and error prone.
</p>
<p>
SQL model generator automates this task. This is a Java-based
utility that takes JDBC configuration,
reads database schema using it and creates initial JSON or YAML
stub for the data model. This stub then
- can be used as is or be extended further.
+ can be further extended and modified.
</p>
</section>
<section id="usage">
<h2 class="section-title">Usage</h2>
<p>
- This utility is highly configurable. It take several parameters
like JDBC URL and driver, database schema,
- optional set of tables and columns to include or exclude for which
it will generate YAML/JSON NLPCraft
- model stub. Run this utility with <code>--help</code> parameter to
get a full up-to-date documentation:
+ This utility can be run in several ways:
</p>
- <pre class="brush: plain">
-java -cp apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
- </pre>
- <p>
- NOTE: this utility is Java-based and can be run similarly from
command line or any IDE.
- </p>
- <p>
- At the time of this writing (NLPCraft ver. 0.5.0) this would
produce the following output:
- </p>
- <pre class="brush: plain">
-NAME:
- NCSqlModelGenerator -- NLPCraft model generator for SQL databases.
-
-SYNOPSIS:
- java -cp apache-nlpcraft-incubating-0.5.0-all-deps.jar
org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator [PARAMETERS]
-
-DESCRIPTION:
- This utility generates NLPCraft model stub for a given SQL database
schema. You
- can choose database schema, set of tables and columns for which you
- want to generate NLPCraft model. After the model is generated you can
- further configure and customize it for your specific needs.
-
- This Java class can be run from the command line or from an IDE like any
other
- Java application. Note that required JDBC driver class must be available
on the
- classpath and therefore its JAR should be added to the classpath when
running
- this application.
-
-PARAMETERS:
- [--url|-r] url
- Mandatory database JDBC URL.
-
- [--driver|-d] class
- Mandatory JDBC driver class. Note that 'class' must be a
- fully qualified class name. It should also be available on
- the classpath.
-
- [--schema|-s] schema
- Mandatory database schema to scan.
-
- [--out|-o] filename
- Mandatory name of the output JSON or YAML model file. It should
- have one of the following extensions: .js, .json, .yml, or .yaml
- File extension determines the output file format.
-
- [--user|-u] username
- Optional database user name.
-
- [--password|-w] password
- Optional database user password.
-
- [--model-id|-x] id
- Optional generated model ID. By default, the model ID will be
'sql.model.id'.
-
- [--model-ver|-v] version
- Optional generated model version. By default, the model ID will be
'1.0.0-timestamp'.
-
- [--model-name|-n] name
- Optional generated model name. By default, the model name will be
'SQL-based model'.
-
- [--exclude|-e] list
- Optional semicolon-separate list of tables and/or columns to exclude.
By
- default, none of the tables and columns in the schema are excluded.
See below
- for more information.
-
- [--prefix|-f] list
- Optional comma-separate list of table or column name prefixes to
remove.
- These prefixes will be removed when name is used for model elements
- synonyms. By default, no prefixes will be removed.
-
- [--suffix|-q] list
- Optional comma-separate list of table or column name suffixes to
remove.
- These suffixes will be removed when name is used for model elements
- synonyms. By default, no suffixes will be removed.
-
- [--include|-i] list
- Optional semicolon-separate list of tables and/or columns to include.
By
- default, all tables and columns in the schema are included. See below
- for more information.
-
- [--synonyms|-y] [true|false]
- Optional flag on whether or not to generated auto synonyms for the
model elements.
- Default is true.
-
- [--override|-z] [true|false]
- Flag to determine whether or not to override output file if it already
exist.
- If override is disabled (default) and output file exists - a unique
file name will
- be used instead.
- Default is false.
-
- [--parent|-p] [true|false]
- Optional flag on whether or not to use element's parent relationship
for
- defining SQL columns and their containing (i.e. parent) tables.
- Default is false.
-
- [--help|-h|-?]
- Prints this usage information.
-
-DETAILS:
- -r, -d, -s, and -o are mandatory parameters, everything else is optional.
-
- Each -i or -e parameter is a semicolon ';' separated list of table or
columns names.
- Each table or column name can be one of following forms:
- - table -- to filter on table names only.
- - table#column -- to filter on both table and column names.
- - #column -- to filter on columns only (regardless of the table).
-
- Table and column names are treated as standard Java regular expressions.
Note that
- both '#' and ';' cannot be used inside of the regular expression:
-
- -e "#_.+" -- excludes any columns starting with '_'.
- -e "tmp.+" -- excludes all tables starting with 'tmp'.
- -i "Order.*;#[^_].+" -- includes only tables starting with 'Order' and
columns that
- do not start with '_'.
-
-EXAMPLES:
- java -cp apache-nlpcraft-incubating-0.5.0-all-deps.jar
org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator
- -r jdbc:postgresql://localhost:5432/mydb
- -d org.postgresql.Driver
- -f "tbl_, col_"
- -q "_tmp, _old, _unused"
- -s public
- -e "#_.+"
- -o model.json
- </pre>
+ <nav>
+ <div class="nav nav-tabs" role="tablist">
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-script" role="tab" aria-controls="nav-home"
aria-selected="true">NLPCraft CLI</a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-class" role="tab" aria-controls="nav-home" aria-selected="true">Java
Class</a>
+ </div>
+ </nav>
+ <div class="tab-content">
+ <div class="tab-pane fade show active" id="nav-script"
role="tabpanel">
+ <pre class="brush: bash">
+ $ bin/nlpcraft.sh gen-sql
--url=jdbc:postgresql://localhost:5432/mydb --driver=org.postgresql.Driver
--schema=public --out=model.json
+ </pre>
+ <p>
+ <b>NOTES:</b>
+ </p>
+ <ul>
+ <li>
+ <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
+ </li>
+ <li>
+ Run <code>bin/nlpcraft.sh help --cmd=gen-sql</code> to
get a full help on this command.
+ </li>
+ </ul>
+ </div>
+ <div class="tab-pane fade show" id="nav-class" role="tabpanel">
+ <pre class="brush: bash">
+ $ java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator
+ </pre>
+ <p>
+ <b>NOTES:</b>
+ </p>
+ <ul>
+ <li>
+ Run this class without arguments to get a full help.
+ </li>
+ <li>
+ Use
<code>org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator</code> class
directly to execute
+ it from IDE or programmatically.
+ </li>
+ </ul>
+ </div>
+ </div>
<p>
After the data model stub is generated:
</p>
diff --git a/tools/syn_tool.html b/tools/syn_tool.html
index 523166b..02f2bdd 100644
--- a/tools/syn_tool.html
+++ b/tools/syn_tool.html
@@ -70,7 +70,7 @@ id: syn_tool
</nav>
<div class="tab-content">
<div class="tab-pane fade show active" id="nav-nix"
role="tabpanel">
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ cd nlpcraft/src/main/python/ctxword
$ bin/install_dependencies.sh
</pre>
@@ -91,7 +91,7 @@ id: syn_tool
</li>
<li>
Start the 'ctxword' server by running the following commands
from NLPCraft installation directory:
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ cd nlpcraft/src/main/python/ctxword
$ bin/start_server.{sh|cmd}
</pre>
diff --git a/tools/test_framework.html b/tools/test_framework.html
index ffc955a..5032b16 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -180,7 +180,7 @@ public class AlarmModel extends NCModelFileAdapter {
</p>
<h3 class="section-sub-title">Running</h3>
<p>
- Auto mode validator can be executed in several ways:
+ Auto mode validator can be executed in two different ways:
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
@@ -190,7 +190,7 @@ public class AlarmModel extends NCModelFileAdapter {
</nav>
<div class="tab-content">
<div class="tab-pane fade show active" id="nav-script"
role="tabpanel">
- <pre class="brush: plain">
+ <pre class="brush: bash">
$ bin/nlpcraft.sh test-model
</pre>
<p>
@@ -198,7 +198,7 @@ public class AlarmModel extends NCModelFileAdapter {
</p>
<ul>
<li>
- Use <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
+ <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
</li>
<li>
Run <code>bin/nlpcraft.sh help --cmd=test-model</code>
to get a full help on this command.
@@ -206,7 +206,7 @@ public class AlarmModel extends NCModelFileAdapter {
</ul>
</div>
<div class="tab-pane fade show" id="nav-class" role="tabpanel">
- <pre class="brush: plain">
+ <pre class="brush: bash">
java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
-DNLPCRAFT_TEST_MODELS=org.apache.nlpcraft.examples.alarm.AlarmModel
org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator
</pre>
<p>