public class TestAST extends AbstractDataDrivenSPARQLTestCase
AbstractDataDrivenSPARQLTestCase.TestHelper, AbstractDataDrivenSPARQLTestCase.UpdateTestHelper
AbstractDataAndSPARQLTestCase.AbsHelper
TestCase2.MyProperties, TestCase2.RandomType
baseURI, 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, tearDown
assertSameSolutions, assertSameSolutions, assertSameSolutions, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, assertSameSolutionsAnyOrder, compareGraphs, compareTupleQueryResults, diff
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 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).
Exception
public void test_ast_01b() throws Exception
select ?s where { ?s ?p ?o } order by ?s limit 1Note: 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.
Exception
public void test_ast_01c() throws Exception
select DISTINCT ?s where { ?s ?p ?o }
Exception
public void test_ast_01d() throws Exception
select (count(*) as ?count) where { ?s ?p ?o } limit 1
Exception
public 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).
Exception
public void test_ast_02b() throws Exception
select DISTINCT ?s ?o where { ?s rdf:type :C . OPTIONAL { ?s :B ?o } }
Exception
public 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().
Exception
public 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()
Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.