Skip to content

Latest commit

 

History

History
103 lines (75 loc) · 7.76 KB

README.md

File metadata and controls

103 lines (75 loc) · 7.76 KB

Jetisu

Jetisu is a toolset for modelling with sigma complete relations.

  • a "relation" is a table with columns and rows,
  • "sigma complete" means the table started its life complete and has been shaped by a relational algebraic σ operator (WHERE clause).

To use an artisanal metaphor complete relations are like a raw block of stone. The WHERE clause is like the sculptor's hammer that shapes a stature. And the sigma complete relation is like the finished statue that represents any computable relation.

Doing for computation and business rules what the relational model did for data

Prior to the advent of the relational model, programmers' mental model of data spanned multiple levels of abstraction and required them to procedurally navigate either hierarchies or networks to access data. The relational model challenged this approach and provided a stable and robust mental model of data for programmers to use (Schemas and Relational Queries).

The Jetisu Toolkit is exploring the possibility that the relational model can do for computation and business logic what it did for data. And provide programmers with a way to specify computations and business logic without the need for procedural code. The following diagram is a representation of what this might look like:

Papers and Presentations

Watch the video Slide deck

Puzzle Examples

Rules As Code Examples

The examples are chosen to illustrate the benefits (and/or challenges) of using sigma complete relations to model rules as code.

Interactive Q&A with Rules as Code

This example shows interactive Q&A using the same rule-set as the above "Australian COVID vaccinations mandatory for work roles" example:

Edit and re-run the example notebooks

You can docker run the example Jupyter notebooks for yourself.

docker run -p 8888:8888 ghcr.io/davidpratten/jetisu:latest

Here is help on How to run the example notebooks

Background to "sigma complete relations"

Let's compare regular data relations with sigma complete relations.

Data Relations Sigma Complete Relations
Purpose Capture data about entities of interest Do computation and implement business rules
Consists of a rows (tuples) and columns (attributes) Yes Yes
When created the table is Empty Complete
(full, containing every possible row)
Specific table is created by Rows are inserted, updated and removed using Data Manipulation Statements (DML) INSERT, UPDATE, and DELETE The relation is shaped using constraints in a WHERE clause.
Is it a constant value in the database? No Yes
Holds data about entities of interest Yes No
Discipline which has focused on these Relational Database community Constraint Programming community

Computed or Algorithmic Relations

The idea of a relation that is defined by constraints and rules goes back to the 1970's and 1980's at the beginning of the relational database era. Early references include:

  • Algorithmic relations proposed in 1975 by Patrick Hall, Peter Hitchcock and Stephen Todd (hereafter HHT). (PDF)
  • Computed relations described in 1981 by David Maier and David Warren (hereafter MW). (PDF)

Constraint Programming

From the late 1980s the discipline of Constraint Programming CP and Constraint Logic Programming CLP emerged and begin to explore what it took to define a relation as a computable predicate over the cross product of the domains of attributes. Here is a survey of this work and a key reference for the constraint programming language MiniZinc:

  • Constraint Logic Programming: A Survey. (1994) J. Jaffar, Michael J. Maher (PDF)
  • MiniZinc: Towards a Standard CP Modelling Language. (2007) N. Nethercote, Peter James Stuckey, Ralph Becket, S. Brand, Gregory J. Duck, Guido Tack (SpringerLink PDF)

The two ideas of computed and algorithmic relations put together with constraint logic programming are foundations of what the Jetisu toolkit calls: "sigma complete relations".

A formal definition of sigma complete relations

An sigma complete relation is

  • a set of typed attributes (or columns) A, along with
  • a computable predicate (or constraint) P over the attributes in A,
  • and has the value given by the following relational algebraic expression:

σP(dom(a1) × dom(a2) × … × dom(aN)) for predicate P and typed attributes a1, a2, …, aN ∈ A.

Built With Open Source Software

Acknowledgements

The Jetisu toolkit has been helped along by inspiration from