public static PipelineOp compileJoinGraph(final QueryEngine queryEngine,final JoinGraph joinGraph,final Path path){
  if (queryEngine == null)   throw new IllegalArgumentException();
  if (joinGraph == null)   throw new IllegalArgumentException();
  if (path == null)   throw new IllegalArgumentException();
  final IPredicate<?>[] predicates=path.getPredicates();
  final IConstraint[] constraints=joinGraph.getConstraints();
  final Set<IVariable<?>> doneSet=new LinkedHashSet<IVariable<?>>(joinGraph.getDoneSet());
  final JoinGroupNode rtoJoinGroup=(JoinGroupNode)joinGraph.getRequiredProperty(JoinGraph.Annotations.JOIN_GROUP);
  final Map<Integer,StatementPatternNode> index=getIndex(rtoJoinGroup);
  final BOpIdFactory idFactory=new BOpIdFactory();
  idFactory.reserveIds(predicates);
  idFactory.reserveIds(constraints);
  final IConstraint[][] constraintAttachmentArray=PartitionedJoinGroup.getJoinGraphConstraints(predicates,constraints,null,true);
  final AST2BOpContext ctx=getExecutionContext(queryEngine,(NT)joinGraph.getRequiredProperty(JoinGraph.Annotations.NT));
  PipelineOp left=null;
  for (int i=0; i < predicates.length; i++) {
    final Predicate<?> pred=(Predicate<?>)predicates[i];
    final IConstraint[] attachedJoinConstraints=constraintAttachmentArray[i];
    final boolean optional=pred.isOptional();
    final StatementPatternNode sp=index.get(pred.getId());
    left=join(left,pred,optional ? new LinkedHashSet<IVariable<?>>(doneSet) : doneSet,attachedJoinConstraints == null ? null : Arrays.asList(attachedJoinConstraints),null,sp.getQueryHints(),ctx);
  }
  return left;
}

public static PipelineOp compileJoinGraph ( final QueryEngine queryEngine , final JoinGraph joinGraph , final Path path ) { if ( queryEngine == null ) throw new IllegalArgumentException ( ) ; if ( joinGraph == null ) throw new IllegalArgumentException ( ) ; if ( path == null ) throw new IllegalArgumentException ( ) ; final IPredicate < ? > [ ] predicates = path . getPredicates ( ) ; final IConstraint [ ] constraints = joinGraph . getConstraints ( ) ; final Set < IVariable < ? > > doneSet = new LinkedHashSet < IVariable < ? > > ( joinGraph . getDoneSet ( ) ) ; final JoinGroupNode rtoJoinGroup = ( JoinGroupNode ) joinGraph . getRequiredProperty ( JoinGraph . Annotations . JOIN_GROUP ) ; final Map < Integer , StatementPatternNode > index = getIndex ( rtoJoinGroup ) ; final BOpIdFactory idFactory = new BOpIdFactory ( ) ; idFactory . reserveIds ( predicates ) ; idFactory . reserveIds ( constraints ) ; final IConstraint [ ] [ ] constraintAttachmentArray = PartitionedJoinGroup . getJoinGraphConstraints ( predicates , constraints , null , true ) ; final AST2BOpContext ctx = getExecutionContext ( queryEngine , ( NT ) joinGraph . getRequiredProperty ( JoinGraph . Annotations . NT ) ) ; PipelineOp left = null ; for ( int i = 0 ; i < predicates . length ; i ++ ) { final Predicate < ? > pred = ( Predicate < ? > ) predicates [ i ] ; final IConstraint [ ] attachedJoinConstraints = constraintAttachmentArray [ i ] ; final boolean optional = pred . isOptional ( ) ; final StatementPatternNode sp = index . get ( pred . getId ( ) ) ; left = join ( left , pred , optional ? new LinkedHashSet < IVariable < ? > > ( doneSet ) : doneSet , attachedJoinConstraints == null ? null : Arrays . asList ( attachedJoinConstraints ) , null , sp . getQueryHints ( ) , ctx ) ; } return left ; }
compile a join graph into a query plan .
