Class SPARQLCrossProductIteration

  • All Implemented Interfaces:
    AutoCloseable, org.eclipse.rdf4j.common.iteration.CloseableIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException>, org.eclipse.rdf4j.common.iteration.Iteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException>

    public class SPARQLCrossProductIteration
    extends org.eclipse.rdf4j.common.iteration.LookAheadIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException>
    Iteration which forms the cross product of a list of materialized input bindings with each result obtained from the inner iteration. Example: inputBindings := {b1, b2, ...} resultIteration := {r1, r2, ...} getNextElement() returns (r1,b1), (r1, b2), ..., (r2, b1), (r2, b2), ... i.e. compute the cross product per result binding Note that this class is a fully equivalent copy of org.eclipse.rdf4j.query.algebra.evaluation.iterator.CrossProductIteration, and is only included here to avoid a circular dependency between the algebra-evaluation module and the sparql-repository module.
    Author:
    Andreas Schwarte
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.rdf4j.query.BindingSet currentInputBinding  
      protected List<org.eclipse.rdf4j.query.BindingSet> inputBindings  
      protected Iterator<org.eclipse.rdf4j.query.BindingSet> inputBindingsIterator  
      protected org.eclipse.rdf4j.common.iteration.CloseableIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException> resultIteration  
    • Constructor Summary

      Constructors 
      Constructor Description
      SPARQLCrossProductIteration​(org.eclipse.rdf4j.common.iteration.CloseableIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException> resultIteration, List<org.eclipse.rdf4j.query.BindingSet> inputBindings)  
    • Field Detail

      • inputBindings

        protected final List<org.eclipse.rdf4j.query.BindingSet> inputBindings
      • resultIteration

        protected final org.eclipse.rdf4j.common.iteration.CloseableIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException> resultIteration
      • inputBindingsIterator

        protected Iterator<org.eclipse.rdf4j.query.BindingSet> inputBindingsIterator
      • currentInputBinding

        protected org.eclipse.rdf4j.query.BindingSet currentInputBinding
    • Constructor Detail

      • SPARQLCrossProductIteration

        public SPARQLCrossProductIteration​(org.eclipse.rdf4j.common.iteration.CloseableIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException> resultIteration,
                                           List<org.eclipse.rdf4j.query.BindingSet> inputBindings)
    • Method Detail

      • getNextElement

        protected org.eclipse.rdf4j.query.BindingSet getNextElement()
                                                             throws org.eclipse.rdf4j.query.QueryEvaluationException
        Specified by:
        getNextElement in class org.eclipse.rdf4j.common.iteration.LookAheadIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException>
        Throws:
        org.eclipse.rdf4j.query.QueryEvaluationException
      • handleClose

        protected void handleClose()
                            throws org.eclipse.rdf4j.query.QueryEvaluationException
        Overrides:
        handleClose in class org.eclipse.rdf4j.common.iteration.LookAheadIteration<org.eclipse.rdf4j.query.BindingSet,​org.eclipse.rdf4j.query.QueryEvaluationException>
        Throws:
        org.eclipse.rdf4j.query.QueryEvaluationException