Fixed #100 : SheerkaAdmin: Add builtins() command

Fixed #99 : SheerkaQueryManager: I can manage contains predicate when filtering objects
Fixed #97 : ERROR: list indices must be integers or slices, not Concept
Fixed #96 : SequenceNodeParser: SequenceNodeParser must correctly handle concept definition
Fixed #95 : ResolveAmbiguity must not remove concepts that do not require evaluation
Fixed #94 : Concepts with the same key are lost when new ontology
Fixed #93 : Introduce BuiltinConcepts.EVAL_GLOBAL_TRUTH_REQUESTED
Fixed #92 : ExpressionParser: Implement compile_disjunctions()
Fixed #91 : Implement get_concepts_complexity(context, concepts, concept_parts)
Fixed #90 : ResolveAmbiguity : where predicate is not used to resolve ambiguity
Fixed #89 : ResolveAmbiguityEvaluator: Concepts embedded in ConceptNode are not resolved
Fixed #88: SyaNodeParser: Parse multiple parameters when some of the are not recognized
Fixed #87: SyaNodeParser : Parse the multiple parameters
This commit is contained in:
2021-07-31 08:52:00 +02:00
parent 7dcaa9c111
commit e69745adc8
70 changed files with 1561 additions and 455 deletions
@@ -26,13 +26,13 @@ class SheerkaQueryManager(BaseService):
self.rule_evaluator = None
def initialize(self):
self.sheerka.bind_service_method(self.filter_objects, False)
self.sheerka.bind_service_method(self.select_objects, False)
self.sheerka.bind_service_method(self.collect_attributes, False)
self.sheerka.bind_service_method(self.NAME, self.filter_objects, False)
self.sheerka.bind_service_method(self.NAME, self.select_objects, False)
self.sheerka.bind_service_method(self.NAME, self.collect_attributes, False)
self.sheerka.bind_service_method(self.filter_objects, False, as_name="pipe_where")
self.sheerka.bind_service_method(self.select_objects, False, as_name="pipe_select")
self.sheerka.bind_service_method(self.collect_attributes, False, as_name="pipe_props")
self.sheerka.bind_service_method(self.NAME, self.filter_objects, False, as_name="pipe_where")
self.sheerka.bind_service_method(self.NAME, self.select_objects, False, as_name="pipe_select")
self.sheerka.bind_service_method(self.NAME, self.collect_attributes, False, as_name="pipe_props")
self.sheerka.register_debug_vars(SheerkaQueryManager.NAME, "filter_objects", "query")
@@ -59,12 +59,13 @@ class SheerkaQueryManager(BaseService):
if k == "__type":
conditions.append(f"get_type(self) == {current_variable_name}")
elif k == "atomic_def":
conditions.append(f"atomic_def(self) == {current_variable_name}")
elif k in ("__self", "_"):
conditions.append(f"self == {current_variable_name}")
elif k.endswith("_contains"):
prop_name = k[:-9]
conditions.append(f"{current_variable_name} in self.{prop_name}")
else:
conditions.append(f"self.{k} == {current_variable_name}")
@@ -91,6 +92,7 @@ class SheerkaQueryManager(BaseService):
objects = objects.body
debugger.debug_entering(nb_objects=len(objects), predicate=predicate, **kwargs)
local_namespace = {}
query_by_kwargs = self.get_query_by_kwargs(local_namespace, **kwargs)