Skip to content

Commit

Permalink
Explain Pine's SBVR in docs/SBVR.md
Browse files Browse the repository at this point in the history
- Explain SBVR as understood by Pine in more programmer-friendly
  terms
- Map out how Pine interprets SBVR's structured english

Change-type: patch
Signed-off-by: Carol Schulze <[email protected]>
  • Loading branch information
Ereski authored and Balena CI committed Mar 26, 2020
1 parent 8015d9d commit 9313b1e
Show file tree
Hide file tree
Showing 2 changed files with 394 additions and 10 deletions.
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Pine.js
Pine.js is a sophisticated rules-driven API engine that enables you to define rules in a structured subset of English. Those rules are used in order for Pine.js to generate a database schema and the associated [OData](http://www.odata.org/) API. This makes it very easy to rapidly create, update and maintain a backend while keeping the logic in an easily understood form, as well as providing the ability to update and maintain this logic going forward.

Rules are described in *SBVR* format, which stands for "Semantics of Business Vocabulary and Business Rules". SBVR provides a way to capture specifications in natural language and represent them in formal logic, so they can be machine processed.
Pine.js is a sophisticated rules-driven API engine that enables you to define rules in a structured subset of English. Those rules are used in order for Pine.js to generate a database schema and the associated [OData](http://www.odata.org/) API. This makes it very easy to rapidly create, update and maintain a backend while keeping the logic in an easily understood form, as well as providing the ability to update and maintain this logic going forward.

The basic components of SBVR are as follows:
Rules are described in *SBVR* format, which stands for "Semantics of Business Vocabulary and Business Rules". SBVR provides a way to capture specifications in natural language and represent them in formal logic, so they can be machine processed. See [docs/SBVR.md](docs/SBVR.md) for an explanation of how Pine understands SBVR.

* Terms - these are the atomic elements of your data model, defined via `Term: [Term Name]`. Generally speaking, these map to tables in a relational database, or attributes of other tables.
* Fact Types - these define *relations* between different terms and properties of those terms, e.g. `Fact type: pilot can fly plane` or `Fact type: pilot is experienced` - these *somewhat* map to fields and foreign keys in a relational database.
* Rules - these define *logical constraints* on the data model and is the most powerful aspect of SBVR and Pine.js itself. Rules map loosely to constraints in a relational database, but extend them to constraints that can traverse tables and generally be far more powerful than a database constraint. E.g. `Rule: It is obligatory that each pilot can fly at least 1 plane`. The expressive capability of SBVR rules is much more than simple SQL DDL, and has the full power of First Order Logic.
## See Also

In order to get an idea of how SBVR works, visit the [sbvr lab](http://www.sbvr.co/), and for more details, check out the [SBVR spec](http://www.omg.org/spec/SBVR/).

The following tools demonstrate the way to use the compile chain from a SBVR file to SQL and from an OData URL to SQL:
The following tools demonstrate the way to use the compile chain from a SBVR file to SQL and from an OData URL to SQL:

* [https://github.com/resin-io-modules/sbvr-compiler](https://github.com/resin-io-modules/sbvr-compiler)
* [https://github.com/resin-io-modules/odata-compiler](https://github.com/resin-io-modules/odata-compiler)
Expand Down Expand Up @@ -47,7 +44,5 @@ The documentation inside /docs folder also provide a great overview of the main

One can experiment with Pine.js, its main dependencies and the above tools inside the development environment of resin.


### Where to go from here:
## Where to go from here:
Start by creating your very first application with Pine.js. Jump to the [Getting Started guide](https://github.com/resin-io/pinejs/blob/master/docs/GettingStarted.md).

Loading

0 comments on commit 9313b1e

Please sign in to comment.