11# Json Logic Scala
2- Build complex rules, serialize them as JSON, and execute them in Scala
2+ Build complex rules, serialize them as JSON, and execute them in Scala.
3+
34Json-logic-scala enables you to serialize in JSON format logical expressions.
45It also enables you to load a scala object from a logical expression/JSON.
56
@@ -21,6 +22,27 @@ This project is compiled, tested, and published for the following Scala versions
2122* 2.12.6
2223* 2.13.1
2324
25+ # Table of Contents
26+ 1 . [ Installation] ( )
27+ 2 . [ Main concepts: Boolean-Algebra-Tree] ( )
28+
29+ 2.1 [ ` ComposeLogic ` : Internal Node] ( )
30+
31+ 2.2 [ ` ValueLogic ` : Leaf Node] ( )
32+ 3 . [ Example] ( )
33+ 4 . [ Read/Write json] ( )
34+
35+ 4.1 [ Read json: Define ` Decoder ` ] ( )
36+
37+ 4.2 [ Write json: Define ` Encoder ` ] ( )
38+ 5 . [ Evaluating logical expression: ` reduce ` ] ( )
39+
40+ 5.1 [ ` reduceValueLogic ` method] ( )
41+
42+ 5.2 [ ` reduceComposeLogic ` method] ( )
43+ 6 . [ More examples] ( )
44+ 7 . [ Scaladoc API] ( )
45+
2446## 1. Installation
2547
2648To get started, add json-logic-scala as a dependency to your project:
@@ -94,7 +116,9 @@ filtering rules before loading it.
94116| ...........| ..........| ..........| ..........| ..........| .....................|
95117
96118Let ' s suppose we are only interested in rows which satisfy logical expression :
97- $price \ gte 20 \ and label \ neq label2$.
119+ <p align =" center" >
120+ <img src =" .img/logical_expression.png" alt =" drawing" width =" 200" />
121+ </p >
98122If you want to store the logic (logical expression) in an universal format that can
99123be shared between scala, R , python code you can store in jsonLogic format.
100124
@@ -365,7 +389,7 @@ implicit val reducer = new ReduceLogic() {
365389
366390
367391
368- ## Scaladoc API
392+ ## 7 . Scaladoc API
369393
370394The Scaladoc API for this project can be found [here](http:// celadari.github.io/ json- logic- scala/ latest/ api).
371395
0 commit comments