/** Locate a suitable factory for this algebra expression and dataset * * @param op Algebra expression * @param dataset DatasetGraph * @param context * * @return A QueryExecutionFactory or null if none accept the request */ public QueryEngineFactory find(Op op, DatasetGraph dataset, Context context) { for ( Iterator<QueryEngineFactory> iter = factories.listIterator() ; iter.hasNext() ; ) { QueryEngineFactory f = iter.next() ; if ( f.accept(op, dataset, context) ) return f ; } return null ; }
@Override public Plan create(Query query, DatasetGraph dsg, Binding inputBinding, Context context) { if ( !( dsg instanceof DatasetGraphWrapper ) ) return null ; DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ; return QueryEngineRegistry.findFactory(query, dsg2, context).create(query, dsg2, inputBinding, context) ; }
@Override public Plan create(Op op, DatasetGraph dsg, Binding inputBinding, Context context) { if ( !( dsg instanceof DatasetGraphWrapper ) ) return null ; DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ; return QueryEngineRegistry.findFactory(op, dsg2, context).create(op, dsg2, inputBinding, context) ; } }
/** Locate a suitable factory for this query and dataset * * @param query Query * @param dataset Dataset * @return A QueryExecutionFactory or null if none accept the request */ public QueryEngineFactory find(Query query, DatasetGraph dataset, Context context) { for ( Iterator<QueryEngineFactory> iter = factories.listIterator() ; iter.hasNext() ; ) { QueryEngineFactory f = iter.next() ; if ( f.accept(query, dataset, context) ) return f ; } return null ; }
static public QueryIterator exec(Op op, DatasetGraph ds) { QueryEngineFactory f = QueryEngineRegistry.findFactory(op, ds, null) ; Plan plan = f.create(op, ds, BindingRoot.create(), null) ; return plan.iterator() ; }
/** Locate a suitable factory for this query and dataset * * @param query Query * @param dataset Dataset * @return A QueryExecutionFactory or null if none accept the request */ public QueryEngineFactory find(Query query, DatasetGraph dataset, Context context) { for ( Iterator<QueryEngineFactory> iter = factories.listIterator() ; iter.hasNext() ; ) { QueryEngineFactory f = iter.next() ; if ( f.accept(query, dataset, context) ) return f ; } return null ; }
static public QueryIterator exec(Op op, DatasetGraph ds) { QueryEngineFactory f = QueryEngineRegistry.findFactory(op, ds, null) ; Plan plan = f.create(op, ds, BindingRoot.create(), null) ; return plan.iterator() ; }
/** Locate a suitable factory for this algebra expression and dataset * * @param op Algebra expression * @param dataset DatasetGraph * @param context * * @return A QueryExecutionFactory or null if none accept the request */ public QueryEngineFactory find(Op op, DatasetGraph dataset, Context context) { for ( Iterator<QueryEngineFactory> iter = factories.listIterator() ; iter.hasNext() ; ) { QueryEngineFactory f = iter.next() ; if ( f.accept(op, dataset, context) ) return f ; } return null ; }
private static Plan makePlan(Query query, DatasetGraph dataset, Binding input, Context context) { if ( context == null ) context = new Context(ARQ.getContext()) ; if ( input == null ) input = BindingRoot.create() ; QueryEngineFactory f = findFactory(query, dataset, context) ; if ( f == null ) return null ; return f.create(query, dataset, input, context) ; } // ---------------- Internal routines
@Override public boolean accept(Query query, DatasetGraph dsg, Context context) { if ( !( dsg instanceof DatasetGraphWrapper ) ) return false ; DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ; return QueryEngineRegistry.findFactory(query, dsg2, context).accept(query, dsg2, context) ; }
private static Plan makePlan(Query query, DatasetGraph dataset, Binding input, Context context) { if ( context == null ) context = new Context(ARQ.getContext()) ; if ( input == null ) input = BindingRoot.create() ; QueryEngineFactory f = findFactory(query, dataset, context) ; if ( f == null ) return null ; return f.create(query, dataset, input, context) ; } // ---------------- Internal routines
@Override public boolean accept(Op op, DatasetGraph dsg, Context context) { if ( !( dsg instanceof DatasetGraphWrapper ) ) return false ; DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ; return QueryEngineRegistry.findFactory(op, dsg2, context).accept(op, dsg2, context) ; }
public Plan getPlan() { if ( plan == null ) { DatasetGraph dsg = prepareDataset(dataset, query, fileManager) ; Binding inputBinding = null ; if ( initialBinding != null ) inputBinding = BindingUtils.asBinding(initialBinding) ; if ( inputBinding == null ) inputBinding = BindingRoot.create() ; plan = qeFactory.create(query, dsg, inputBinding, getContext()) ; } return plan ; }
public Plan getPlan() { if ( plan == null ) { DatasetGraph dsg = prepareDataset(dataset, query, fileManager) ; Binding inputBinding = null ; if ( initialBinding != null ) { inputBinding = new BindingMap() ; BindingUtils.addToBinding(inputBinding, initialBinding) ; } if ( inputBinding == null ) inputBinding = BindingRoot.create() ; plan = qeFactory.create(query, dsg, inputBinding, getContext()) ; } return plan ; }
public static void printPlan(Query query, QueryExecution qe) { QueryEngineFactory f = QueryEngineRegistry.findFactory(query, qe.getDataset().asDatasetGraph(), ARQ.getContext()) ; if ( f == null ) System.err.println("printPlan: Unknown engine type: "+Utils.className(qe)) ; Plan plan = f.create(query, qe.getDataset().asDatasetGraph(), BindingRoot.create(), ARQ.getContext()) ; SerializationContext sCxt = new SerializationContext(query) ; IndentedWriter out = IndentedWriter.stdout ; plan.output(out, sCxt) ; out.flush(); }
public static void printPlan(Query query, QueryExecution qe) { QueryEngineFactory f = QueryEngineRegistry.findFactory(query, qe.getDataset().asDatasetGraph(), ARQ.getContext()) ; if ( f == null ) System.err.println("printPlan: Unknown engine type: "+Utils.className(qe)) ; Plan plan = f.create(query, qe.getDataset().asDatasetGraph(), BindingRoot.create(), ARQ.getContext()) ; SerializationContext sCxt = new SerializationContext(query) ; IndentedWriter out = IndentedWriter.stdout ; plan.output(out, sCxt) ; out.flush(); }
pattern.add(triple) ; Op op = new OpBGP(pattern) ; Plan plan = factory.create(op, getDataset(), BindingRoot.create(), null) ;
pattern.add(triple) ; Op op = new OpBGP(pattern) ; Plan plan = factory.create(op, getDataset(), BindingRoot.create(), null) ;
private QueryIterator nodesReifTriple(Node node, TripleMatch triple) { Binding b = BindingRoot.create() ; if ( node == Node.ANY ) node = null ; if ( node != null || triple != null ) { b = new BindingMap(b) ; if ( node != null ) bind(b, reifNodeVar, node) ; if ( triple != null ) { bind(b, varS, triple.getMatchSubject()) ; bind(b, varP, triple.getMatchPredicate()) ; bind(b, varO, triple.getMatchObject()) ; } } Plan plan = factory.create(op, ds, b, null) ; QueryIterator qIter = plan.iterator() ; return qIter ; }