public class TestAST extends AbstractDataDrivenSPARQLTestCase
AbstractDataDrivenSPARQLTestCase.TestHelper, AbstractDataDrivenSPARQLTestCase.UpdateTestHelperAbstractDataAndSPARQLTestCase.AbsHelperTestCase2.MyProperties, TestCase2.RandomTypebaseURI, store, valueFactory_randomType| Modifier and Type | Method and Description |
|---|---|
void |
test_ast_01()
select ?s where { ?s ?p ?o }
|
void |
test_ast_01b()
select ?s where { ?s ?p ?o } order by ?s limit 1
|
void |
test_ast_01c()
select DISTINCT ?s where { ?s ?p ?o }
|
void |
test_ast_01d()
select (count(*) as ?count) where { ?s ?p ?o } limit 1
|
void |
test_ast_02()
select ?s ?o
where {
?s rdf:type :C .
|
void |
test_ast_02b()
select DISTINCT ?s ?o
where {
?s rdf:type :C .
|
void |
test_ast_03()
select ?index
where {
?s rdf:type :C .
|
void |
test_ast_04()
Unit test developed to demonstrate a problem where the incorrect
materialization requirements are computed.
|
void |
test_materialization_extensions() |
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 TestAST()
public TestAST(String name)
name - public void test_ast_01()
throws Exception
select ?s where { ?s ?p ?o }
Note: This is a port of TestASTTriplesModeEvaluation#testAST() (as are
all of the ast_01x methods).Exceptionpublic void test_ast_01b()
throws Exception
select ?s where { ?s ?p ?o } order by ?s limit 1
Note: I had to add an ORDER BY into this method in order to make the
results stable. The original unit test only checked the #of results but
not their data.Exceptionpublic void test_ast_01c()
throws Exception
select DISTINCT ?s where { ?s ?p ?o }
Exceptionpublic void test_ast_01d()
throws Exception
select (count(*) as ?count) where { ?s ?p ?o } limit 1
Exceptionpublic void test_ast_02()
throws Exception
select ?s ?o
where {
?s rdf:type :C .
OPTIONAL {
?s :B ?o
}
}
Note: This is a port of
TestASTTriplesModeEvaluation#testOptionalDistinct() (as are all of the
ast_02x methods).Exceptionpublic void test_ast_02b()
throws Exception
select DISTINCT ?s ?o
where {
?s rdf:type :C .
OPTIONAL {
?s :B ?o
}
}
Exceptionpublic void test_ast_03()
throws Exception
select ?index
where {
?s rdf:type :C .
?s :predicate1 ?o .
}
GROUP BY (?o+1 as ?index)
Note: This is a port of
TestASTTriplesModeEvaluation#testProjectedGroupWithConstant().Exceptionpublic void test_ast_04()
throws Exception
I just happened to run into an issue dealing with materialization. Say I
have a constraint that needs materialization, Str(...) If
that constraint has as its arg another constraint:
Coalesce (?x,?y) [this returns the first none null value in
the list of ?x,?y]
Its seems that the logic that determines the extra materialization steps
doesn't handle the fact that Coalesce (?x,?y) doesn't need any
materialization, so never sets the INeedsMaterialization
interface, so the result of that valueExpression is going to be either ?x
or ?y, and Str does need those variables materialized, but the
materialization steps would never have seem that lists of terms(?x,?y) as
something that needs materialization. Does the fact that a
ValueExpression returns a non computed IV value, ie returns one of its
arguments, have to be captured in order to somehow handle this?
QueryType: SELECT
SELECT VarNode(index)
JoinGroupNode {
StatementPatternNode(VarNode(s), ConstantNode(TermId(4U)), ConstantNode(TermId(2U)), DEFAULT_CONTEXTS)
StatementPatternNode(VarNode(s), ConstantNode(TermId(5U)), VarNode(o), DEFAULT_CONTEXTS)
( com.bigdata.rdf.sparql.ast.ValueExpressionNode()[ valueExpr=com.bigdata.rdf.internal.constraints.StrBOp(com.bigdata.rdf.internal.constraints.CoalesceBOp(s,o))[ com.bigdata.rdf.internal.constraints.StrBOp.namespace=kb]] AS VarNode(index) )
}
Note: This is a port of
TestASTTriplesModeEvaluation#testProjectedGroupByWithNestedVars()ExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.