private static PipelineOp addDistinctProjectionOp(PipelineOp left,final AST2BOpContext ctx,final ASTBase node,final IVariable<?>[] projectionVars){
  if (!ctx.nativeDistinctSolutions) {
    final List<NV> anns=new LinkedList<NV>();
    anns.add(new NV(JVMDistinctBindingSetsOp.Annotations.BOP_ID,ctx.nextId()));
    anns.add(new NV(JVMDistinctBindingSetsOp.Annotations.VARIABLES,projectionVars));
    anns.add(new NV(JVMDistinctBindingSetsOp.Annotations.EVALUATION_CONTEXT,BOpEvaluationContext.CONTROLLER));
    anns.add(new NV(JVMDistinctBindingSetsOp.Annotations.SHARED_STATE,true));
    left=new JVMDistinctBindingSetsOp(leftOrEmpty(left),anns.toArray(new NV[anns.size()]));
  }
 else {
    final INamedSolutionSetRef namedSolutionSet=NamedSolutionSetRefUtility.newInstance(ctx.queryId,"--distinct-" + ctx.nextId(),projectionVars);
    final List<NV> anns=new LinkedList<NV>();
    anns.add(new NV(HTreeDistinctBindingSetsOp.Annotations.BOP_ID,ctx.nextId()));
    anns.add(new NV(HTreeDistinctBindingSetsOp.Annotations.VARIABLES,projectionVars));
    anns.add(new NV(HTreeDistinctBindingSetsOp.Annotations.EVALUATION_CONTEXT,BOpEvaluationContext.CONTROLLER));
    anns.add(new NV(HTreeDistinctBindingSetsOp.Annotations.SHARED_STATE,true));
    anns.add(new NV(PipelineOp.Annotations.MAX_PARALLEL,1));
    anns.add(new NV(HTreeDistinctBindingSetsOp.Annotations.NAMED_SET_REF,namedSolutionSet));
    anns.add(new NV(IPredicate.Annotations.RELATION_NAME,new String[]{ctx.getLexiconNamespace()}));
    left=new HTreeDistinctBindingSetsOp(leftOrEmpty(left),anns.toArray(new NV[anns.size()]));
  }
  return left;
}

private static PipelineOp addDistinctProjectionOp ( PipelineOp left , final AST2BOpContext ctx , final ASTBase node , final IVariable < ? > [ ] projectionVars ) { if ( ! ctx . nativeDistinctSolutions ) { final List < NV > anns = new LinkedList < NV > ( ) ; anns . add ( new NV ( JVMDistinctBindingSetsOp . Annotations . BOP_ID , ctx . nextId ( ) ) ) ; anns . add ( new NV ( JVMDistinctBindingSetsOp . Annotations . VARIABLES , projectionVars ) ) ; anns . add ( new NV ( JVMDistinctBindingSetsOp . Annotations . EVALUATION_CONTEXT , BOpEvaluationContext . CONTROLLER ) ) ; anns . add ( new NV ( JVMDistinctBindingSetsOp . Annotations . SHARED_STATE , true ) ) ; left = new JVMDistinctBindingSetsOp ( leftOrEmpty ( left ) , anns . toArray ( new NV [ anns . size ( ) ] ) ) ; } else { final INamedSolutionSetRef namedSolutionSet = NamedSolutionSetRefUtility . newInstance ( ctx . queryId , "--distinct-" + ctx . nextId ( ) , projectionVars ) ; final List < NV > anns = new LinkedList < NV > ( ) ; anns . add ( new NV ( HTreeDistinctBindingSetsOp . Annotations . BOP_ID , ctx . nextId ( ) ) ) ; anns . add ( new NV ( HTreeDistinctBindingSetsOp . Annotations . VARIABLES , projectionVars ) ) ; anns . add ( new NV ( HTreeDistinctBindingSetsOp . Annotations . EVALUATION_CONTEXT , BOpEvaluationContext . CONTROLLER ) ) ; anns . add ( new NV ( HTreeDistinctBindingSetsOp . Annotations . SHARED_STATE , true ) ) ; anns . add ( new NV ( PipelineOp . Annotations . MAX_PARALLEL , 1 ) ) ; anns . add ( new NV ( HTreeDistinctBindingSetsOp . Annotations . NAMED_SET_REF , namedSolutionSet ) ) ; anns . add ( new NV ( IPredicate . Annotations . RELATION_NAME , new String [ ] { ctx . getLexiconNamespace ( ) } ) ) ; left = new HTreeDistinctBindingSetsOp ( leftOrEmpty ( left ) , anns . toArray ( new NV [ anns . size ( ) ] ) ) ; } return left ; }
appends a distinct projection to the current pipeline
