On 13/03/15 11:30, Carmen Manzulli wrote:
Hi all,
I'm Carmen and i would like to modify the execution of some operation in
jena so i've red the documentations (
https://jena.apache.org/documentation/query/arq-query-eval.html) and i've
understood that i have to override the OpExecutor....what is not clear for
me is 1. where i've to define and set my factory and, in general,2. where i
could find other examples, informations about this....

thanks in advance,
Carmen.


Hi there,

There is more flexibility than there needs to be due to the historical evolution of the code.

The easiest way is to set the OpExecutorFactory in the context.

    QC.setFactory(Context, OpExecutorFactory) ;

The Context can be a specific QueryExecution (one time setting), to the DatasetGraph (used for this DatasetGraph every time) or globally ARQ.getContext() (all query execution).

    QC.setFactory(dsg.getContext(), yourOpExecutorFactory) ;

If you need to need to hook into execution before the execution propser starts, that's done with a custom QueryEngine. See how TDB sets things up:

https://github.com/apache/jena/blob/master/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/solver/QueryEngineTDB.java

It needs to do stuff for union graph and dynamic datasets before algebra execution starts off.

TDB uses QC.setFactory to direct execution to OpExecutorTDB1 by calling QC.setFactory on DatasetGraphTDB as they are built.

        Hope that helps,
        Andy

Reply via email to