clara

http://www.clara-rules.org/
baptiste-from-paris 2018-06-26T13:43:47.000360Z

hello friends, is there a way to save the entire LocalSession in a db

baptiste-from-paris 2018-06-26T13:44:08.000282Z

I mean serialize/deserialise for later analyse

2018-06-26T13:45:38.000301Z

@baptiste-from-paris there is some support for this. It’s referred to as durability in the Clara codebase. You do have to implement a protocol though to serialize the working memory facts that are specific to your domain of use

baptiste-from-paris 2018-06-26T13:46:43.000742Z

nice 🙂

2018-06-26T13:46:53.000479Z

Also, the durability is currently targeted at being fast for serialization, but especially for deserialization. It doesn’t attempt to be able to deal with evolution to the stored data structures. If you have a change of rules, or a change of Clara version, sometime you may have to rerun rules and re-serialize.

baptiste-from-paris 2018-06-26T13:47:14.000308Z

ok, got it

2018-06-26T13:47:39.000275Z

Well to clarify, any change in rules requires a new run. A change in Clara version may or may not. It just depends on what changes.

baptiste-from-paris 2018-06-26T13:47:48.000479Z

yes offcourse

baptiste-from-paris 2018-06-26T13:48:08.000443Z

thanks for your time 🙂

baptiste-from-paris 2018-06-26T13:48:30.000055Z

was on it, but I had to ask the communuty 😉

1👍
dominicm 2018-06-26T14:20:54.000170Z

Is this related to #portkey in some way? 😄

jeremy 2018-06-26T15:22:45.000825Z

How might I accumulate facts of the same type to test if they are: all contain the same value and any contain a certain value?

2018-06-26T15:34:00.001006Z

@jeremy642 Sounds like 2 separate things, if so

2018-06-26T15:34:04.000244Z

;; ?all contain the same value for :val
[?all <- (acc/all) :from [A (= ?val val)]]


;; ?all has at least one containing :some-val for :val
[?all <- (acc/all) :from [A]]
[:test (some #(= :some-val (:val %))
             ?all)]

jeremy 2018-06-26T15:34:14.000136Z

Yes 😛

2018-06-26T15:34:15.001016Z

However, the 2nd accumulator is weird, not sure why you want to accumulate like that

2018-06-26T15:34:23.000159Z

but perhaps

2018-06-26T15:35:24.000360Z

“any contain a certain value” sounds like a typical rule match

2018-06-26T15:35:45.000297Z

[?all <- (acc/all) :from [A (= ?val val)]] and this will group each A where they have the same value for val

jeremy 2018-06-26T15:35:46.000553Z

Yes it is.

2018-06-26T15:36:00.000555Z

it’ll match and propagate for each grouping possible

jeremy 2018-06-26T15:36:11.000334Z

Yeah, I think any would be a typical rule match.

jeremy 2018-06-26T15:36:20.000601Z

I think my mind was just farting on it.

jeremy 2018-06-26T15:37:00.000681Z

But on the all, does that work if there is a fact of the same type with a diff value?

jeremy 2018-06-26T15:37:40.000730Z

A : 1, A : 1, A : 2, it shouldn't match since all As don't have the same value.

jeremy 2018-06-26T15:39:26.000115Z

Maybe it'd be more like the 2nd one

jeremy 2018-06-26T15:39:38.000349Z

Where you accumulate them all together, then apply a test to them.

jeremy 2018-06-26T16:34:05.000429Z

Got it :thumbsup: Feel so accomplished when a rule works.

1🎉
jeremy 2018-06-26T19:23:39.000318Z

Did any of the visualization stuff that Ryan talks about in his videos get released?

tony.kay 2018-06-26T23:34:17.000455Z

I’m not seeing anything in the docs that would allow you to separate rule sets, and defrule seems global…is there support (planned) for having “rule sets” for different things, or is the idea that you just keep your domains separate by having facts that don’t cross over and trust that the optimizations in the engine will make it mostly “not matter” when your rule set gets big because it covers 10 different domains?