public class TestSubqueryOp extends AbstractSubqueryTestCase
-Dlog4j.configuration=bigdata/src/resources/logging/log4j.properties
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestSubqueryOp() |
TestSubqueryOp(String name) |
Modifier and Type | Method and Description |
---|---|
Properties |
getProperties()
Reads in the configuration properties for the test from a
variety of resources and returns a properties hierarchy.
|
void |
setUp() |
void |
tearDown() |
void |
test_join_selectOnly_x()
Unit test for a simple join in which only
x is projected
into the subquery. |
void |
test_join()
Unit test for a simple join.
|
void |
test_joinWithConstraint()
Unit test for simple join with a constraint.
|
void |
test_query_join2_optionals()
Unit test for optional join group.
|
void |
test_query_optionals_filter()
Unit test for optional join group with a filter.
|
void |
test_query_optionals_filter2()
Unit test for optional join group with a filter on a variable outside the
optional join group.
|
newBindingSetIterator, newBindingSetIterator, newBindingSetIterator
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
public TestSubqueryOp()
public TestSubqueryOp(String name)
name
- public Properties getProperties()
TestCase2
Properties
object, then the lower levels of the
hierarchy are recursively searched.The hierarchy is constructed from the following properties files in the following order. The first property file in this list corresponds to the top of the property hierarchy. The last property file in this list corresponds to the bottom of the property hierarchy. The property resources are:
getProperties
in class TestCase2
Properties
object that supplies bindings for
property names according to the described hierarchy among
property resources. The returned Properties
is NOT
cached.
TODO This does not handle the recursive truncation of the
class name to search for "test.properties" yet.public void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public void test_joinWithConstraint() throws Exception
Exception
public void test_join_selectOnly_x() throws Exception
x
is projected
into the subquery.Exception
public void test_query_join2_optionals() throws Exception
SliceOp
. The 2nd and 3rd joins are embedded in an
SubqueryOp
.
The optional join group takes the form:
(a b) optional { (b c) (c d) }The (a b) tail will match everything in the knowledge base. The join group takes us two hops out from ?b. There should be four solutions that succeed the optional join group:
(paul mary brad fred) (paul mary brad leon) (john mary brad fred) (john mary brad leon)and five more that don't succeed the optional join group:
(paul brad) * (john brad) * (mary brad) * (brad fred) (brad leon)In this cases marked with a
*
, ?c will become temporarily
bound to fred and leon (since brad knows fred and leon), but the (c d)
tail will fail since fred and leon don't know anyone else. At this point,
the ?c binding must be removed from the solution.Exception
public void test_query_optionals_filter() throws Exception
SliceOp
. The 2nd and 3rd joins are embedded in an
optional join group. The optional join group contains a filter.
The optional join group takes the form:
(a b) optional { (b c) (c d) filter(d != Leon) }The (a b) tail will match everything in the knowledge base. The join group takes us two hops out from ?b. There should be two solutions that succeed the optional join group:
(paul mary brad fred) (john mary brad fred)and five more that don't succeed the optional join group:
(paul brad) * (john brad) * (mary brad) * (brad fred) (brad leon)In the cases marked with a
*
, ?c will become temporarily
bound to fred and leon (since brad knows fred and leon), but the (c d)
tail will fail since fred and leon don't know anyone else. At this point,
the ?c binding must be removed from the solution.
The filter (d != Leon) will prune the two solutions:
(paul mary brad leon) (john mary brad leon)since ?d is bound to Leon in those cases.
Exception
public void test_query_optionals_filter2() throws Exception
SliceOp
.
The 2nd and 3rd joins are in embedded an SubqueryOp
. The
optional join group contains a filter that uses a variable outside the
optional join group.
The query takes the form:
(a b) optional { (b c) (c d) filter(a != Paul) }The (a b) tail will match everything in the knowledge base. The join group takes us two hops out from ?b. There should be two solutions that succeed the optional join group:
(john mary brad fred) (john mary brad leon)and six more that don't succeed the optional join group:
(paul mary) * (paul brad) * (john brad) (mary brad) (brad fred) (brad leon)In the cases marked with a
*
, ?a is bound to Paul even
though there is a filter that specifically prohibits a = Paul. This is
because the filter is inside the optional join group, which means that
solutions can still include a = Paul, but the optional join group should
not run in that case.Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.