Package lupos.engine.operators.singleinput.modifiers.distinct

Examples of lupos.engine.operators.singleinput.modifiers.distinct.InMemoryDistinct


          replaceVari.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
        }

        final BasicOperator startingOperator =tripleSet.jjtGetChild(1).jjtGetChild(0).accept(this, connection, graphConstraint, subject, object, subjectNode, objectNode);

        final InMemoryDistinct memoryDistinct = new InMemoryDistinct();
        final Filter filter = new Filter("(" + subject + " != " + object + ")");

        startingOperator.addSucceedingOperator(new OperatorIDTuple(filter,0));
        startingOperator.addSucceedingOperator(connection.getOperatorIDTuple());
        final Join intermediateJoinOperator = new Join();
        replaceVar.addSucceedingOperator(new OperatorIDTuple(memoryDistinct,0));
        memoryDistinct.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,1));
        filter.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,0));
        filter.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        intermediateJoinOperator.addSucceedingOperator(new OperatorIDTuple(replaceVari,0));
        replaceVari.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        replaceVari.addSucceedingOperator(connection.getOperatorIDTuple());
View Full Code Here


      final Union union = new Union();
      zeroOperator.addSucceedingOperator(new OperatorIDTuple(union,0));
      startingOperator.addSucceedingOperator(new OperatorIDTuple(union,1));

      final InMemoryDistinct distinct = new InMemoryDistinct();
      union.addSucceedingOperator(new OperatorIDTuple(distinct,0));

      return distinct;
    } else {
      // alternative way to evaluate (...)? without using the PathLengthZero operator!
View Full Code Here

      if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
        projection.addProjectionElement((Variable)graphConstraint);
      }

      final Union union = new Union();
      final InMemoryDistinct memoryDistinct = new InMemoryDistinct();
      try {
        final Filter filter = new Filter("(" + subject + " != " + object + ")");

        final ReplaceVar replaceVar = new ReplaceVar();
        replaceVar.addSubstitution(object, subject);
        final Variable variable = this.getVariable(subject.toString(), object.toString(), "interimVariable");
        replaceVar.addSubstitution(variable, object);
        if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
          replaceVar.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
        }
        final ReplaceVar replaceVari = new ReplaceVar();
        replaceVari.addSubstitution(subject, subject);
        replaceVari.addSubstitution(object, variable);
        if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
          replaceVari.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
        }

        startingOperator.addSucceedingOperator(new OperatorIDTuple(filter,0));
        startingOperator.addSucceedingOperator(new OperatorIDTuple(union,1));
        final Join intermediateJoinOperator = new Join();
        replaceVar.addSucceedingOperator(new OperatorIDTuple(memoryDistinct,0));
        memoryDistinct.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,1));
        filter.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,0));
        filter.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        intermediateJoinOperator.addSucceedingOperator(new OperatorIDTuple(replaceVari,0));
        replaceVari.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        replaceVari.addSucceedingOperator(new OperatorIDTuple(union,1));
View Full Code Here

      n.setName(subject.toString().substring(1));
      final Bind bind = new Bind(subject);
      bind.addProjectionElement(object,n);
      union.addSucceedingOperator(new OperatorIDTuple(bind,0));
      bind.addSucceedingOperator(new OperatorIDTuple(projection,0));
      final InMemoryDistinct memoryDistinct = new InMemoryDistinct();
      projection.addSucceedingOperator(new OperatorIDTuple(memoryDistinct,0));
      return memoryDistinct;
    }
  }
View Full Code Here

      projection.addProjectionElement(object);
      if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
        projection.addProjectionElement((Variable)graphConstraint);
      }

      final InMemoryDistinct memoryDistinct = new InMemoryDistinct();
      try {
        final Filter filter = new Filter("(" + subject + " != " + object + ")");

        replaceVar.addSubstitution(object, subject);
        final Variable variable = this.getVariable(subject.toString(), object.toString(), "interimVariable");
        replaceVar.addSubstitution(variable, object);
        if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
          replaceVar.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
        }
        replaceVari.addSubstitution(subject, subject);
        replaceVari.addSubstitution(object, variable);
        if(graphConstraint!=null && graphConstraint.isVariable() && !graphConstraint.equals(getItem(subjectNode)) && !graphConstraint.equals(getItem(objectNode))) {
          replaceVari.addSubstitution((Variable)graphConstraint, (Variable)graphConstraint);
        }

        startingOperator.addSucceedingOperator(new OperatorIDTuple(filter,0));
        startingOperator.addSucceedingOperator(new OperatorIDTuple(projection,0));
        final Join intermediateJoinOperator = new Join();
        replaceVar.addSucceedingOperator(new OperatorIDTuple(memoryDistinct,0));
        memoryDistinct.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,1));
        filter.addSucceedingOperator(new OperatorIDTuple(intermediateJoinOperator,0));
        filter.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        intermediateJoinOperator.addSucceedingOperator(new OperatorIDTuple(replaceVari,0));
        replaceVari.addSucceedingOperator(new OperatorIDTuple(replaceVar,0));
        replaceVari.addSucceedingOperator(new OperatorIDTuple(projection,0));
View Full Code Here

TOP

Related Classes of lupos.engine.operators.singleinput.modifiers.distinct.InMemoryDistinct

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.