public class TestOptionals extends AbstractDataDrivenSPARQLTestCase
AbstractDataDrivenSPARQLTestCase.TestHelper, AbstractDataDrivenSPARQLTestCase.UpdateTestHelperAbstractDataAndSPARQLTestCase.AbsHelperTestCase2.MyProperties, TestCase2.RandomTypebaseURI, store, valueFactory_randomType| Constructor and Description |
|---|
TestOptionals() |
TestOptionals(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
test_complex_optional_01()
Unit test for an optional which is too complex to be handled as a simple
optional (it involves more than one statement pattern).
|
void |
test_nested_optionals()
select ?s ?label ?comment
where {
?s rdf:type :Person .
|
void |
test_non_matching_optional_01()
Unit test for trac 712
|
void |
test_non_matching_optional_02()
Unit test for trac 712
|
void |
test_optional_with_filter_that_fails()
The FILTER will always fail.
|
void |
test_optional_with_filter()
Unit test for an optional which is too complex to be handled as a simple
optional (it uses a filter which can not be lifted since it requires a
materialized variable).
|
void |
test_optionals_emptyWhereClause()
Test case for issue #1079.
|
void |
test_optionals_simplest()
select *
where {
?a :knows ?b .
|
void |
test_optionals_simplestWithConditional()
select *
where {
?a :knows ?b .
|
void |
test_optionals_simplestWithFilter()
select *
where {
?a :knows ?b .
|
void |
test_prune_groups()
select *
where {
?s rdf:type :Person .
|
void |
test_simple_optional_01()
Unit test for a simple optional (one where the statement pattern can
be lifted into the parent group).
|
assertSameAST, asSet, asSet, asSet, asSet, asSet, enableDeleteMarkersInIndes, getBOpContext, getProperties, getStore, makeIV, setUp, tearDownassertSameSolutions, assertSameSolutions, assertSameSolutions, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, compareGraphs, compareTupleQueryResults, diffassertEquals, 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, logPropertiesassertEquals, 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, toStringpublic TestOptionals()
public TestOptionals(String name)
public void test_simple_optional_01()
throws Exception
Exceptionpublic void test_optional_with_filter()
throws Exception
Exceptionpublic void test_optional_with_filter_that_fails()
throws Exception
Note: If this test fails, then it is likely that the optional hash join was not triggered for its last pass evaluation. For this test to pass the optional hash join needs to be triggered for last pass evaluation even though no solutions reached the optional hash join through normal evaluation (they were all failed by the filter).
Exceptionpublic void test_complex_optional_01()
throws Exception
select ?x ?o ?y ?z
where {
?x rdf:type foaf:Person
OPTIONAL {
?x rdfs:label ?o
}
OPTIONAL {
?x foaf:knows ?y .
?y foaf:knows ?z .
FILTER ( ?z != ?x )
}
}
Exceptionpublic void test_non_matching_optional_01()
throws Exception
select ?x
where {
OPTIONAL {
FILTER ( false )
}
}
Exceptionpublic void test_non_matching_optional_02()
throws Exception
select ?x
where {
BIND ( 1 as ?y )
OPTIONAL {
FILTER ( false )
}
}
Exceptionpublic void test_prune_groups()
throws Exception
select *
where {
?s rdf:type :Person .
OPTIONAL {
?s :p1 ?p1 .
OPTIONAL {
?p1 :p2 ?o2 .
}
}
}
Note: This test was ported from
TestBigdataSailEvaluationStrategyImpl#test_prune_groups()Exceptionpublic void test_nested_optionals()
throws Exception
select ?s ?label ?comment
where {
?s rdf:type :Person .
?s rdf:type :Object .
OPTIONAL { ?s rdfs:label ?label . }
OPTIONAL { ?s rdfs:comment ?comment . }
}
Note: This test was ported from
TestBigdataSailEvaluationStrategyImpl#test_prune_groups()Exceptionpublic void test_optionals_simplest()
throws Exception
select *
where {
?a :knows ?b .
OPTIONAL {
?b :knows ?c .
?c :knows ?d .
}
}
Exceptionpublic void test_optionals_simplestWithFilter()
throws Exception
select *
where {
?a :knows ?b .
OPTIONAL {
?b :knows ?c .
?c :knows ?d .
filter(?d != :leon)
}
}
Exceptionpublic void test_optionals_simplestWithConditional()
throws Exception
select *
where {
?a :knows ?b .
OPTIONAL {
?b :knows ?c .
?c :knows ?d .
filter(?d != :paul)
}
}
Exceptionpublic void test_optionals_emptyWhereClause()
throws Exception
select * where {
optional {
rdfs:label ?labelPrefered_l_ru.
filter( langMatches(lang(?labelPrefered_l_ru),"de") )
}
optional {
rdfs:label ?labelPrefered_l_ru.
filter( langMatches(lang(?labelPrefered_l_ru),"en") )
}
}
ExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.