From: <mrp...@us...> - 2010-09-24 17:25:54
|
Revision: 3626 http://bigdata.svn.sourceforge.net/bigdata/?rev=3626&view=rev Author: mrpersonick Date: 2010-09-24 17:25:48 +0000 (Fri, 24 Sep 2010) Log Message: ----------- no longer punt to Sesame when exceptions are thrown from our query engine Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-24 17:18:40 UTC (rev 3625) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-24 17:25:48 UTC (rev 3626) @@ -483,16 +483,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation - - ex.printStackTrace(); + throw new QueryEvaluationException(ex); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(union, bindings); - return super.evaluate(union, bindings); - } } @@ -617,16 +619,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation + throw new QueryEvaluationException(ex); - ex.printStackTrace(); +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(join, bindings); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } - - return super.evaluate(join, bindings); - } } @@ -721,16 +725,18 @@ } catch (Exception ex) { - // Use Sesame 2 evaluation + throw new QueryEvaluationException(ex); - ex.printStackTrace(); +// // Use Sesame 2 evaluation +// +// ex.printStackTrace(); +// +// if (log.isInfoEnabled()) { +// log.info("could not evaluate natively, punting to Sesame"); +// } +// +// return super.evaluate(join, bindings); - if (log.isInfoEnabled()) { - log.info("could not evaluate natively, punting to Sesame"); - } - - return super.evaluate(join, bindings); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-29 16:03:06
|
Revision: 3679 http://bigdata.svn.sourceforge.net/bigdata/?rev=3679&view=rev Author: thompsonbry Date: 2010-09-29 16:03:00 +0000 (Wed, 29 Sep 2010) Log Message: ----------- Modified to use variable arity Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-29 15:48:34 UTC (rev 3678) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-09-29 16:03:00 UTC (rev 3679) @@ -1509,7 +1509,18 @@ !tripleSource.includeInferred ? ExplicitSPOFilter.INSTANCE : null; - return new SPOPredicate(new BOp[] { s, p, o, c }, new NV( + // Decide on the correct arity for the predicate. + final BOp[] vars; + if (!database.isQuads() && !database.isStatementIdentifiers()) { + vars = new BOp[] { s, p, o }; + } else if (c == null) { + vars = new BOp[] { s, p, o, com.bigdata.bop.Var.var() }; + } else { + vars = new BOp[] { s, p, o, c }; + } + + return new SPOPredicate(vars, // + new NV( IPredicate.Annotations.RELATION_NAME, new String[] { database .getSPORelation().getNamespace() }),// // @todo move to the join. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-10-20 14:09:25
|
Revision: 3825 http://bigdata.svn.sourceforge.net/bigdata/?rev=3825&view=rev Author: thompsonbry Date: 2010-10-20 14:09:18 +0000 (Wed, 20 Oct 2010) Log Message: ----------- reverting to the old behavior for a query which contains a single statement pattern. this will get the wrong answer for default graph queries against quads, but it does better overall. we are continuing to look into this issue. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-10-19 20:46:00 UTC (rev 3824) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-10-20 14:09:18 UTC (rev 3825) @@ -1829,6 +1829,46 @@ } } + /** + * Override evaluation of StatementPatterns to recognize magic search + * predicate. + */ + @Override + public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( + final StatementPattern sp, final BindingSet bindings) + throws QueryEvaluationException { + + if (log.isDebugEnabled()) { + log.debug("evaluating statement pattern:\n" + sp); + } + + // check for magic search + final Var predVar = sp.getPredicateVar(); + final Value predValue = getVarValue(predVar, bindings); + if (BD.SEARCH.equals(predValue)) { + final Var ovar = sp.getObjectVar(); + final Value oval = getVarValue(ovar, bindings); + if (oval == null) { + throw new QueryEvaluationException(BD.SEARCH + + " : object must be bound."); + } + if (!(oval instanceof Literal)) { + throw new QueryEvaluationException(BD.SEARCH + + " : object must be literal."); + } + final Literal lit = (Literal) oval; + if (lit.getDatatype() != null) { + throw new QueryEvaluationException(BD.SEARCH + + " : object is datatype literal."); + } + return search(sp.getSubjectVar(), lit.getLanguage(), + lit.getLabel(), bindings, sp.getScope()); + } + + return super.evaluate(sp, bindings); + + } + // /** // * Override evaluation of StatementPatterns to recognize magic search // * predicate. @@ -1838,72 +1878,32 @@ // final StatementPattern sp, final BindingSet bindings) // throws QueryEvaluationException { // +// // no check against the nativeJoins property here because we are simply +// // using the native execution model to take care of magic searches. +// // if (log.isDebugEnabled()) { // log.debug("evaluating statement pattern:\n" + sp); // } // -// // check for magic search -// final Var predVar = sp.getPredicateVar(); -// final Value predValue = getVarValue(predVar, bindings); -// if (BD.SEARCH.equals(predValue)) { -// final Var ovar = sp.getObjectVar(); -// final Value oval = getVarValue(ovar, bindings); -// if (oval == null) { -// throw new QueryEvaluationException(BD.SEARCH -// + " : object must be bound."); -// } -// if (!(oval instanceof Literal)) { -// throw new QueryEvaluationException(BD.SEARCH -// + " : object must be literal."); -// } -// final Literal lit = (Literal) oval; -// if (lit.getDatatype() != null) { -// throw new QueryEvaluationException(BD.SEARCH -// + " : object is datatype literal."); -// } -// return search(sp.getSubjectVar(), lit.getLanguage(), -// lit.getLabel(), bindings, sp.getScope()); +// final IStep query = createNativeQuery(sp); +// +// if (query == null) { +// return new EmptyIteration<BindingSet, QueryEvaluationException>(); // } +// +// try { // -// return super.evaluate(sp, bindings); +// return execute(query, bindings); +// +// } catch (Exception ex) { +// +// throw new QueryEvaluationException(ex); +// +// } // // } - /** - * Override evaluation of StatementPatterns to recognize magic search - * predicate. - */ - @Override - public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( - final StatementPattern sp, final BindingSet bindings) - throws QueryEvaluationException { - - // no check against the nativeJoins property here because we are simply - // using the native execution model to take care of magic searches. - - if (log.isDebugEnabled()) { - log.debug("evaluating statement pattern:\n" + sp); - } - - final IStep query = createNativeQuery(sp); - - if (query == null) { - return new EmptyIteration<BindingSet, QueryEvaluationException>(); - } - try { - - return execute(query, bindings); - - } catch (Exception ex) { - - throw new QueryEvaluationException(ex); - - } - - } - - /** * Evaluates the {@link BD#SEARCH} magic predicate as a full-text search * against the index literal in the database, binding <i>svar</i> to each This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-11-01 16:01:47
|
Revision: 3856 http://bigdata.svn.sourceforge.net/bigdata/?rev=3856&view=rev Author: thompsonbry Date: 2010-11-01 16:01:41 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Made the "single tail rule" conditional on the database mode. It is only used for quads. For triples it imposes unnecessary overhead. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-11-01 15:29:45 UTC (rev 3855) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/BigdataEvaluationStrategyImpl.java 2010-11-01 16:01:41 UTC (rev 3856) @@ -1834,7 +1834,13 @@ final StatementPattern sp, final BindingSet bindings) throws QueryEvaluationException { - if (sp.getParentNode() instanceof Projection) { + if (database.isQuads() && sp.getParentNode() instanceof Projection) { + /* + * Note: This is required in order to get the correct semantics for + * named graph or default graph access paths in quads mode. However, + * doing this in triples more imposes a significant performance + * penalty. + */ return evaluateSingleTailRule(sp, bindings); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |