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:
@@ -52,22 +52,16 @@ class TestSheerkaQueryManager(TestUsingMemoryBasedSheerka):
|
||||
assert sheerka.filter_objects(context, lst, prop2={"key": "value"}) == [lst[3]]
|
||||
# assert sheerka.filter_objects(context, lst, prop1={1, "v"}) == [lst[2]] set are not supported
|
||||
|
||||
# complex properties
|
||||
assert sheerka.filter_objects(context, lst, prop1_contains="a") == [lst[0], lst[1]]
|
||||
assert sheerka.filter_objects(context, lst, prop1_contains=1) == [lst[2], lst[3]]
|
||||
|
||||
def test_i_can_filter_by_object_type(self):
|
||||
sheerka, context = self.init_test().unpack()
|
||||
lst = [A("a11", "a12"), Concept("foo", body="a").auto_init(), Concept("foo", body="b").auto_init()]
|
||||
|
||||
assert sheerka.filter_objects(context, lst, __type="foo") == [lst[1], lst[2]]
|
||||
|
||||
def test_i_can_filter_on_atomic_def(self):
|
||||
sheerka, context, isa, plus, isa2 = self.init_concepts(
|
||||
Concept('x is a y').def_var("x").def_var("y"),
|
||||
Concept('a plus b').def_var("a").def_var("b"),
|
||||
Concept('u is a v').def_var("u").def_var("v"),
|
||||
)
|
||||
|
||||
lst = [isa, plus, isa2]
|
||||
assert sheerka.filter_objects(context, lst, atomic_def="is a") == [lst[0], lst[2]]
|
||||
|
||||
def test_i_can_filter_on_as_bag_property(self):
|
||||
sheerka, context = self.init_test().unpack()
|
||||
lst = [B("a11", "a12"), B("a21", "a22"), B("a31", "a32")]
|
||||
|
||||
Reference in New Issue
Block a user