private Optimize(ExecutionContext execCxt) { this(execCxt.getContext()) ; }
private Optimize(ExecutionContext execCxt) { this(execCxt.getContext()) ; }
@Override protected IndexLARQ getIndex(ExecutionContext execCxt) { if ( index == null ) index = LARQ.getDefaultIndex(execCxt.getContext()) ; return index ; } }
public static Op optimize(Op op, ExecutionContext execCxt) { return optimize(op, execCxt.getContext()) ; }
public static Op optimize(Op op, ExecutionContext execCxt) { return optimize(op, execCxt.getContext()) ; }
protected OpExecutor(ExecutionContext execCxt) { this.execCxt = execCxt ; this.dispatcher = new ExecutionDispatch(this) ; this.hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ; this.stageGenerator = StageBuilder.chooseStageGenerator(execCxt.getContext()) ; }
public FunctionEnvBase(ExecutionContext execCxt) { this(execCxt.getContext(), execCxt.getActiveGraph(), execCxt.getDataset()) ; execContext = execCxt ; }
public FunctionEnvBase(ExecutionContext execCxt) { this(execCxt.getContext(), execCxt.getActiveGraph(), execCxt.getDataset()) ; execContext = execCxt ; }
protected QueryIterator execute(BasicPattern pattern, ReorderTransformation reorder, StageGenerator execution, QueryIterator input, ExecutionContext execCxt) { Explain.explain(pattern, execCxt.getContext()) ; if ( reorder != null ) { pattern = reorder.reorder(pattern) ; Explain.explain("Reorder", pattern, execCxt.getContext()) ; } return execution.execute(pattern, input, execCxt) ; }
protected QueryIterator execute(BasicPattern pattern, ReorderTransformation reorder, StageGenerator execution, QueryIterator input, ExecutionContext execCxt) { Explain.explain(pattern, execCxt.getContext()) ; if ( reorder != null ) { pattern = reorder.reorder(pattern) ; Explain.explain("Reorder", pattern, execCxt.getContext()) ; } return execution.execute(pattern, input, execCxt) ; }
public QueryIterDistinct(QueryIterator qIter, ExecutionContext context) { super(qIter, context) ; ThresholdPolicy<Binding> policy = ThresholdPolicyFactory.policyFromContext(context.getContext()) ; Comparator<Binding> comparator = new BindingComparator(new ArrayList<SortCondition>(), context) ; this.db = BagFactory.newDistinctNet(policy, SerializationFactoryFinder.bindingSerializationFactory(), comparator) ; }
private static QueryIterator baseExecute(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) { if ( execCxt.getContext().isTrueOrUndef(altMatcher) ) return executeInline(pattern, input, execCxt) ; else return executeQueryHandler(pattern, input, execCxt) ; }
public static QueryIterator execute(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) { if ( pattern.isEmpty() ) return input ; boolean hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ; StageGenerator gen = chooseStageGenerator(execCxt.getContext()) ; QueryIterator qIter = gen.execute(pattern, input, execCxt) ; // Remove non-distinguished variables here. // Project out only named variables. if ( hideBNodeVars ) qIter = new QueryIterDistinguishedVars(qIter, execCxt) ; return qIter ; }
private static QueryIterator executeBGP(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) { if (pattern.isEmpty()) return input ; boolean hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ; StageGenerator gen = StageBuilder.executeInline ; QueryIterator qIter = gen.execute(pattern, input, execCxt) ; // Remove non-distinguished variables here. // Project out only named variables. if (hideBNodeVars) qIter = new QueryIterDistinguishedVars(qIter, execCxt) ; return qIter ; }
public QueryIterSort(final QueryIterator qIter, final Comparator<Binding> comparator, final ExecutionContext context) { super(null, context) ; this.embeddedIterator = qIter ; ThresholdPolicy<Binding> policy = ThresholdPolicyFactory.policyFromContext(context.getContext()); this.db = BagFactory.newSortedBag(policy, SerializationFactoryFinder.bindingSerializationFactory(), comparator); this.setIterator(new SortedBindingIterator(qIter)); }
public static Procedure build(Node procId, ExprList args, ExecutionContext execCxt) { Context context = execCxt.getContext() ; ProcedureRegistry reg = chooseProcedureRegistry(context) ; ProcedureFactory f = reg.get(procId.getURI()) ; Procedure proc = f.create(procId.getURI()) ; args.prepareExprs(context) ; // Allow args to build as well. proc.build(procId, args, execCxt) ; return proc ; }
public static Procedure build(Node procId, ExprList args, ExecutionContext execCxt) { Context context = execCxt.getContext() ; ProcedureRegistry reg = chooseProcedureRegistry(context) ; ProcedureFactory f = reg.get(procId.getURI()) ; Procedure proc = f.create(procId.getURI()) ; args.prepareExprs(context) ; // Allow args to build as well. proc.build(procId, args, execCxt) ; return proc ; }
public static Procedure build(Node procId, PropFuncArg subjArg, PropFuncArg objArg, ExecutionContext execCxt) { Context context = execCxt.getContext() ; PropertyFunctionRegistry reg = choosePropFuncRegistry(context) ; PropertyFunctionFactory f = reg.get(procId.getURI()) ; PropertyFunction pf = f.create(procId.getURI()) ; pf.build(subjArg, procId, objArg, execCxt) ; //Make wrapper return new ProcedurePF(pf, subjArg, procId, objArg) ; }
public static Procedure build(Node procId, PropFuncArg subjArg, PropFuncArg objArg, ExecutionContext execCxt) { Context context = execCxt.getContext() ; PropertyFunctionRegistry reg = choosePropFuncRegistry(context) ; PropertyFunctionFactory f = reg.get(procId.getURI()) ; PropertyFunction pf = f.create(procId.getURI()) ; pf.build(subjArg, procId, objArg, execCxt) ; //Make wrapper return new ProcedurePF(pf, subjArg, procId, objArg) ; }
@Override protected QueryIterator nextStage(Binding outerBinding) { Op op = QC.substitute(opService, outerBinding) ; boolean silent = opService.getSilent() ; QueryIterator qIter ; try { qIter = Service.exec((OpService)op, getExecContext().getContext()) ; // This iterator is materialized already otherwise we may end up // not servicing the HTTP connection as needed. // In extremis, can cause a deadlock when SERVICE loops back to this server. // Add tracking. qIter = QueryIter.makeTracked(qIter, getExecContext()) ; } catch (RuntimeException ex) { if ( silent ) { Log.warn(this, "SERVICE <" + opService.getService().toString() + ">: " + ex.getMessage()) ; // Return the input return QueryIterSingleton.create(outerBinding, getExecContext()) ; } throw ex ; } // Need to put the outerBinding as parent to every binding of the service call. // There should be no variables in common because of the OpSubstitute.substitute QueryIterator qIter2 = new QueryIterCommonParent(qIter, outerBinding, getExecContext()) ; return qIter2 ; } }