cogai
cogai copied to clipboard
Chunks syntax: Is "rule" a specific chunk type?
Looking at rule definitions in Introduction to chunks and rules, I see that all examples use a rule
chunk type. Is this how rules are identified? Or are rules identified because they have @condition
and @action
properties?
If the former, same question as in #2, shouldn't rule
be prefixed with @
since it's specific to the rule language itself?
Rules are identified by having the type "rule" and being in the "rules" module. A chunk of type "rule" is expected to have both the @condition and @action properties. Note that rules can be compiled from other modules, and in principle uncompiled. This is needed when you want to reason about rules, see: https://www.w3.org/Data/demos/chunks/chunks.html#compilation