Fork me on GitHub
#clara
<
2018-08-10
>
henrik06:08:15

I’m working on an ingestion pipeline for scholarly material. It takes XML files and adds them to a (Datomic) database. There’s a ton of little decisions to be made along the way. Depending on the publisher, the type of material, the presence of related material already in the database, the subject matter, the presence or absence of a myriad of little attributes in the file itself, and so on, the ingestion process behaves differently. This means tons and tons of conditionals all over the place, and it quickly gets hard to get an overview. I’ve been contemplating ways to extract this decision making process into its own place. Would Clara be a suitable tool for this?

wparker10:08:00

@ that sounds like a plausible use-case. Much depends on how much involved the logic is - IMO a rules engine has some upfront cost to bring in especially if the team hasn’t used one before, but at a certain complexity of business logic it helps a lot. Clara does what it can to help by “playing nicely” with the rest of the Clojure ecosystem e.g. by being simple Clojure code rather than an entirely separate framework with its own IDEs etc., but it still is a different way of thinking and is a nontrivial component to introduce to a system. FWIW the analysis in the ThoughtWorks radar linked above seems on-target to me. My guess would be that something like you describe would work best with a rules engine if large chunks of logic can be computed before needing to return to the stateful pipeline, but as always it is hard to say since so often it is the details that are most important.

devn17:08:02

howdy folks

devn17:08:07

im interested in partial condition matches

devn17:08:34

i want to answer the question: what conditions didn't match for a given rule

devn17:08:12

i'm not sure this is possible at the moment

wparker19:08:22

Could you give a concrete example @devn? I'm not sure what exactly you mean; session inspection has some things that might help.

devn20:08:36

@wparker I'm looking to answer questions of "what LHS conditions for which rules weren't satisfiable?" My understanding may be incorrect, but I seem to recall the condition matches from session inspection not including information on when a rule's conditions were partially satisfied.

devn20:08:23

truth: I keep avoiding working out a tracing listener setup that will give me the Real Ultimate Power™ I desire

devn20:08:11

@alex-dixon I am reminded of a previous conversation that was had here about making something akin to precept-devtools work with clara. However, I am failing to remember details. Which parts of precept-devtools would not be possible without modification to clara?

alex-dixon20:08:05

@devn Pretty much all of it would need redone since it’s so Precept specific…

alex-dixon20:08:11

Clara’s listeners API is what you’re looking for though. You should be able to see every operation the rule engine does

alex-dixon20:08:54

I’ve only ever used the terminal node ones but they have everything…alpha activate, alpha retract…stuff I can’t remember

alex-dixon20:08:14

If you’re interested in CR or rule engines whatsoever it’ll pay off I promise 🙂