use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method multipleOrOperatorsWithoutBrackets.
@Test
public void multipleOrOperatorsWithoutBrackets() throws Exception {
final Expression actual = eval(String.format("%s OR %s OR %s", ROOT_ID, ROOT_ID, ROOT_ID));
assertNotNull(actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method selfAndOther.
@Test
public void selfAndOther() throws Exception {
final Expression actual = eval(ROOT_ID + " AND " + OTHER_ID);
final Expression expected = Expressions.matchNone();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method descendantOfAny.
@Test
public void descendantOfAny() throws Exception {
// special case that converts to a negated parent query
final Expression actual = eval("<*");
final Expression expected;
if (isInferred()) {
expected = Expressions.builder().mustNot(parents(Collections.singleton(IComponent.ROOT_ID))).build();
} else {
expected = Expressions.builder().mustNot(statedParents(Collections.singleton(IComponent.ROOT_ID))).build();
}
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method memberOf.
@Test
public void memberOf() throws Exception {
final Expression actual = eval("^" + Concepts.REFSET_DESCRIPTION_TYPE);
final Expression expected = activeMemberOf(Concepts.REFSET_DESCRIPTION_TYPE);
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method ancestorOf.
@Test
public void ancestorOf() throws Exception {
// SCT Core module has a single parent and a single ancestor in this test case
indexRevision(MAIN, concept(Concepts.MODULE_SCT_CORE).ancestors(Long.parseLong(Concepts.ROOT_CONCEPT)).parents(Long.parseLong(Concepts.MODULE_ROOT)).statedAncestors(Long.parseLong(Concepts.ROOT_CONCEPT)).statedParents(Long.parseLong(Concepts.MODULE_ROOT)).build());
final Expression actual = eval(">" + Concepts.MODULE_SCT_CORE);
final Expression expected = ids(Set.of(Concepts.ROOT_CONCEPT, Concepts.MODULE_ROOT));
assertEquals(expected, actual);
}
Aggregations