eval_translator
translate_multi_rule_eval(rule_inputs, data_input, with_comments=False, custom_nodes=None)
Given some rule inputs and a data input, generate the corresponding ASP definition ready to be executed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rule_inputs |
List[RuleInput]
|
multiple rule input objects with the rule definitions |
required |
data_input |
DataInput
|
single data input with data to be evaluated against the rules |
required |
with_comments |
bool
|
whether the returning ASP statements should include ASP comments |
False
|
custom_nodes |
Optional[Dict[str, Type]]
|
optional dictionary of custom nodes to support in the rule translation |
None
|
Returns:
| Type | Description |
|---|---|
RuleOutput
|
data object with the generated ASP definition |
Source code in json_logic_asp/translator/eval_translator.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
translate_single_rule_eval(rule_input, data_input, with_comments=False, custom_nodes=None)
Given a rule input and a data input, generate the corresponding ASP definition ready to be executed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rule_input |
RuleInput
|
single rule input objects with the rule definition |
required |
data_input |
DataInput
|
single data input with data to be evaluated against the rules |
required |
with_comments |
bool
|
whether the returning ASP statements should include ASP comments |
False
|
custom_nodes |
Optional[Dict[str, Type]]
|
optional dictionary of custom nodes to support in the rule translation |
None
|
Returns:
| Type | Description |
|---|---|
RuleOutput
|
data object with the generated ASP definition |
Source code in json_logic_asp/translator/eval_translator.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |