Engineering Rules come in many forms, such as mathematical expressions, logical statements, and tabular data. Often tabular data coupled with mathematical or logical Rules provides the best way to represent a Design or a set of Rules.
For example, a single ‘bolt’ Design may have many valid combinations of
•Diameter
•Length
•Thread
•Head
If the valid combinations are stored in a database table, they are easy to reference and maintain. Also, new additions to the table can be considered automatically by the Rules because database changes do not necessarily require follow-on changes in the Rules.
Using data tables can simplify Rules. Instead of embedding large amounts of data in the Rule, for example with many if/then statements, a simple query to a table can do the job.
•As a general Rule, if your formula includes a lot of "if, then…", then you should consider if it could be written and maintained easier using a database table
More advanced SQL statements make it possible to search the tables with complex criteria.
In addition to reading data from a table, kBridge enables you to write to a table so that data from a Project can be stored to a database.
Knowledge Bridge allows the end user or Rule author to import data in different formats to a database table:
•SQLite files (db file)
•Excel files (xls, csv)
•Text files (txt)
Note that you can use DB Browser for SQLite to create a simple database and save it as a db file. DB Browser is a free separate add-on to the free SQLite application.
To access a database, the user needs to use the SqliteDb Design, Mixing it into a user-defined Design or using it alone.
Main Rules of the SqliteDb Design:
oDBFile – the link to the database file from the Resources folder
ogetRows, getRow, getValue – methods to get data from the database using SQL queries