Disabled/Commented Rules

It is not uncommon for rule files, particularly from some ruleset providers, to contain “disabled” rules – rules that are valid and syntactically correct, but are commented out. Such rules are loaded by Aristotle but the fact that they are disabled is noted and can be used as criteria for rule filtering and Post Filter Modification.

Identification

Disabled rules are identified by the lines starting with the comment character # but containing what appears to be a valid rule. Whitespace before and after the comment character, as well as trailing whitespace is disregarded.

Input

By default, when a disabled rule is loaded, it is marked as “disabled”. All rules, including disabled rules, can be enabled at load time by using the “enable-all-rules” command line option (also supported in the Ruleset class constructor). If this is set, then all rules are marked as “enabled”, but the originally_disabled key/value pair (see below) is set to reflect the state of the rule as originally loaded. For example, if “enable-all-rules” was enabled, a rule that was originally disabled in a loaded rules file will be marked as “enabled”, but will have metadata key/value pair: originally_disabled true.

Hint

Enable all rules upon loading by using the “enable-all-rules” option. Alternatively, all rules can be enabled via a boolean filter string file by including a line in the file that starts with the string: <enable-all-rules>`.

During ruleset loading, the originally_disabled key is added to Aristotle’s internal metadata data structure for each rule, with a boolean value – true or false. Manifestly, disabled rules have originally_disabled set to true, otherwise false.

The originally_disabled metadata key can be used for boolean filtering and Post Filter Modification, just like any other metadata key/value pair.

Disabled rules are still considered when filtering rules with boolean filter strings, but they remain disabled. Disabled rules can only be enabled at ruleset load (with the “enable-all-rules” option) or during Post Filter Modification.

Warning

Only rules that match the boolean filter string are passed to Post Filter Modification (PFMod). So if there are disabled rules that should be considered by PFMod (e.g. so they can be set to “enabled”), then they must first match in the boolean filter string phase.

Output

Hint

Include disabled rules as commented out lines in the output by using the “output-disabled-rules” option.

Some downstream ruleset management systems or engine interfaces may expect and/or make use of disabled rules. Disabled rules are not included in ruleset output by default, but can be by enabling the “output-disabled-rules” command line option (also supported in the Ruleset class constructor).

If “enhance” is enabled (along with Modify Metadata), then the originally_disabled key/value pair will be included in the ruleset output.