On 04/06/15 07:31, Claude Warren wrote:
Charles,

There are several places the query can be extended. I think you may want to
look at modifyOp() and eval() in QueryEngine (I used QueryEngineMain and
over rode those methods).

The other piece of the puzzle is to create a QueryEngineFactory that will
create your QueryEngine instance on demand.  QueryEngineFactory has a
method accept() that you override to detect requests for your a queryengine
on your graph type.   You can register and unregister your factory with
calls to the static methods QueryEngineRegistry.addFactory() and
QueryEngineRegistry.unregister()

I think you will want to implement the Graph interface rather than the
dataset.

I hope this points you in the right direction

Claude

Charles,

Would I be right in assuming you don't want the ARQ implemnent of the SPARQL algebra, just the API integration? What Claude says is true though maybe you don't want all the alegbra execution framework, just the way to get QueryExecutionFactory to yield a MarkLogic-backed execution.

If so, it's the QueryEngineRegistry bit you want. TDB and SDB have live examples of wiring in (they don't cheat in any way!).

(If that is a remote call, then you don't need anything - use the remote SPARQL options).

DatasetGraph is the way to go. Dataset is just a level/abtraction mapping. You can implement if you want if you want


That is an example in this area:

https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/engine/MyQueryEngine.java

Just spot the MarkLogic implementation of DatasetGraph/Dataset (i.e. for the latter look at Dataset.asDatsetGraph()

Your CustomQueryExecutionFactory way also works but makes it hard mix simple usages (for testing for example) with MarkLogic backed data.

        Andy




On Thu, Jun 4, 2015 at 1:06 AM, Charles Greer <[email protected]>
wrote:

Hello Jenarators,

If I'm implementing a custom Dataset implemention (Hi, I'm implementing a
custom Dataset for MarkLogic), how would I expect
to create a QueryExecution instance?

It seems that QueryExecutionFactory.create(Query query, Dataset dataset)

should have some hope to create a specific implementation of
QueryExecution, but I don't see the hook into how that might
be done.

Do you think I need my own custom static factory method in order to
support a new kind of QueryExecution?

QueryExecution queryExecution = CustomQueryExecutionFactory.create(Query
query, Dataset dataset)

I really only want to make these if the Dataset in question is one of my
own.

Many thanks,

Charles




Charles Greer
Lead Engineer
MarkLogic Corporation
[email protected]
Cell:  +1 707 318 0442
@grechaw
www.marklogic.com





Reply via email to