Fork me on GitHub
#clara
<
2018-06-26
>
baptiste-from-paris13:06:47

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

dominicm14:06:54

Is this related to #portkey in some way? 😄

baptiste-from-paris13:06:08

I mean serialize/deserialise for later analyse

mikerod13:06:38

@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

mikerod13:06:53

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.

mikerod13:06:39

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-paris13:06:08

thanks for your time 🙂

baptiste-from-paris13:06:30

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

👍 4
jeremy15:06:45

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?

mikerod15:06:00

@jeremy642 Sounds like 2 separate things, if so

mikerod15:06:04

;; ?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)]

mikerod15:06:15

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

mikerod15:06:23

but perhaps

mikerod15:06:24

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

mikerod15:06:45

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

jeremy15:06:46

Yes it is.

mikerod15:06:00

it’ll match and propagate for each grouping possible

jeremy15:06:11

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

jeremy15:06:20

I think my mind was just farting on it.

jeremy15:06:00

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

jeremy15:06:40

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

jeremy15:06:26

Maybe it'd be more like the 2nd one

jeremy15:06:38

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

jeremy16:06:05

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

🎉 4
jeremy19:06:39

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

tony.kay23:06:17

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?