From: <jer...@us...> - 2013-09-04 20:39:21
|
Revision: 7390 http://bigdata.svn.sourceforge.net/bigdata/?rev=7390&view=rev Author: jeremy_carroll Date: 2013-09-04 20:39:14 +0000 (Wed, 04 Sep 2013) Log Message: ----------- Fix for trac734 - problem is to do with allowing legal paths when both ends are bound. Including tests in suite. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestAll.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java 2013-09-04 20:18:31 UTC (rev 7389) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/bop/paths/ArbitraryLengthPathOp.java 2013-09-04 20:39:14 UTC (rev 7390) @@ -360,8 +360,7 @@ * * :a (:p*)* ?y */ - if (lowerBound == 0 && gearing.outVar != null && - !childSolutionIn.isBound(gearing.outVar)) { + if (lowerBound == 0 && canBind(gearing, childSolutionIn, seed)) { final IBindingSet bs = parentSolutionIn.clone(); @@ -648,6 +647,20 @@ // return runningSubquery; } // processChunk method + + /** + * Is it possible to bind the out of the gearing to the seed? + * This may be because it is an unbound variable, or it may be that it is already the seed + * (either as a const or as a var) + */ + @SuppressWarnings("unchecked") + private boolean canBind(final Gearing gearing, IBindingSet childSolutionIn, IConstant<?> seed) { + if ( gearing.outVar == null ) + return seed.equals(gearing.outConst); + if ( !childSolutionIn.isBound(gearing.outVar) ) + return true; + return seed.equals(childSolutionIn.get(gearing.outVar)); + } /** * Choose forward or reverse gear based on the scematics of the operator Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestAll.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestAll.java 2013-09-04 20:18:31 UTC (rev 7389) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestAll.java 2013-09-04 20:39:14 UTC (rev 7390) @@ -156,6 +156,7 @@ * Tests corresponding to various trouble tickets. */ suite.addTestSuite(TestTickets.class); + suite.addTestSuite(TestTwoPropertyPaths734.class); // test suite for inline constraints: GT, LT, GTE, LTE suite.addTestSuite(TestInlineConstraints.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |