0

We are trying to extend jena ARQ by adding a new operator. However, for now, we don't want to do this from the very beginning i.e., going through all steps from the query parse to query execution. We are thinking to rewrite the execution plan manually then let ARQ execute the rewritten plan. I did some search on the web, however, I couldn't find any information about edit execution plan manually. I was wondering if there is a way to write the plan to a file and edit the file manually then let ARQ read the file from disk and execute it. Is this even possible? Can anyone give me a hint on how to start this problem?

sgao
  • 131
  • 1
  • 5
  • This is rather vague for StackOverflow. Please make it more concrete e.g. what's the operator? What have you tried? – AndyS Feb 14 '16 at 16:24
  • If the operator is one that improves execution, then there is an extension point in `OpExt`. If the operators is something that can't be written in std SPARQL, you may also be able to add it there. However, just adding the operator properly, then modifying OpExecutor may be easier. That way, you can write SPARQL algebra and read it with with SSE functions, and execute see QueryExecUtils. These are internal classes and you should check the code. https://jena.apache.org/documentation/query/extension.html – AndyS Feb 14 '16 at 16:26
  • Thanks a lot for your advice, AndyS! Yes, the operator we are going to add cannot be written in std SPARQL. As I know, the query engine will generate a execution plan for a given algebra expression and execute it. So, by adding the new operator and modifying OpExecutor, do we need to touch the Plan class? – sgao Feb 16 '16 at 03:29
  • No need to touch Plan - it does not make decisions, it is just a holder for the execution op and the resulting iterator. (PlanBase add a small amount of checking and manages iterator close.) – AndyS Feb 17 '16 at 11:08

1 Answers1

1

A starting point is to look at reading and writing the algebra with SSE.parseOp and execute with QueryExecUtils.

OpExecutor is the mechanism for executing SPARQL algebra and if you add a new Op type, that's where to add the execution.

AndyS
  • 16,345
  • 17
  • 21