You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/03/18 22:18:01 UTC

[incubator-nlpcraft] branch NLPCRAFT-13 updated: WIP on sqlgen documentation.

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-13
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-13 by this push:
     new 84cd731  WIP on sqlgen documentation.
84cd731 is described below

commit 84cd7312e492e38aa5eb2814cd0891c14f157f81
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Wed Mar 18 15:17:49 2020 -0700

    WIP on sqlgen documentation.
---
 .../model/tools/sqlgen/NCSqlModelGenerator.java    | 26 +++++++++++++++++-----
 .../nlpcraft/model/tools/sqlgen/package-info.java  |  2 +-
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
index a9708c1..c74e085 100644
--- a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
+++ b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/NCSqlModelGenerator.java
@@ -17,19 +17,35 @@
 
 package org.apache.nlpcraft.model.tools.sqlgen;
 
+import org.apache.nlpcraft.model.*;
 import org.apache.nlpcraft.model.tools.sqlgen.impl.NCSqlModelGeneratorImpl;
 
 /**
  * Command line utility to generate NLPCraft model stub from given SQL RDBMS.
  * <p>
- * You need to provide JDBC URL and driver, database schema, as well as set of tables and columns for which you
- * want to generate NLPCraft model stub. After the model stub is generated you need to further configure and customize
- * it for your specific needs.
- * <p>
- * Run this class with <code>--help</code> parameter to get a full documentation:
+ * You need to provide JDBC URL and driver, database schema, as well as optional set of tables and columns for which you
+ * want to generate NLPCraft model stub. Run this class with <code>--help</code> parameter to get a full documentation:
  * <pre class="brush:plain">
  * java -cp apache-nlpcraft-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
  * </pre>
+ * <p>
+ * After the model stub is generated:
+ * <ul>
+ *     <li>
+ *         Modify and extend generated model stub to your own needs. In most cases, you'll need
+ *         to add, remove or modify auto-generated synonyms, add intents, etc. Note, however, that generated model
+ *         is fully complete and can be used as is.
+ *     </li>
+ *     <li>
+ *         Use generated YAML/JSON-based model together with {@link NCModelFileAdapter}
+ *         class to instantiate model from this file.
+ *     </li>
+ *     <li>
+ *         Use {@link NCSqlSchemaBuilder#makeSchema(NCModel)} method to get an object representation of the
+ *         SQL data schema for the model. You can use this object representation along with many utility
+ *         methods in {@link NCSqlUtils} class to efficiently auto-generate SQL queries against the original RDBMS.
+ *     </li>
+ * </ul>
  */
 public class NCSqlModelGenerator {
     /**
diff --git a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/package-info.java b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/package-info.java
index a0c66bb..c882985 100644
--- a/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/package-info.java
+++ b/src/main/scala/org/apache/nlpcraft/model/tools/sqlgen/package-info.java
@@ -18,7 +18,7 @@
 /**
  * Contains model stub generator for SQL RDBMS.
  * <p>
- * Run the following from the command line to get a full documentation:
+ * Run the following from the command line to get a full documentation on how to run model stub generator:
  * <pre class="brush:plain">
  * java -cp apache-nlpcraft-x.x.x-all-deps.jar org.apache.nlpcraft.model.tools.sqlgen.NCSqlModelGenerator --help
  * </pre>