Oversight - I've just implemented it (it's not hard!). It wil be in
tonight's snapshot build of 2.7.5-SNAPSHOT (it builds at about 05:00 UTC)
https://repository.apache.org/content/repositories/snapshots/org/apache/jena/apache-jena/
By the way, you can execute algebra expressions directly:
DatasetGraph dsg = ...
QueryIterator qIter = Algebra.exec(op, dsg) ;
Not all algebra expressions can be turned into a query. If you are
manipulating the algebra, you can create forms OpAsQuery does not recognize.
Andy
On 26/10/12 22:24, John Liu wrote:
I use some Jena arq apis to modify the query for adding filter in runtime.
The query is
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX onto: <http://dbpedia.org/ontology/>
SELECT * WHERE {
?p a onto:Place .
?p geo:l* ?loc .
}
There is valid card in the line "?p geo:l* ?loc ."
The funcations I used are:
AlgebraGenerator ag = new AlgebraGenerator();
Op op = ag.compile(query);
op = OpFilter.filter(e, op);
Query query2 = OpAsQuery.asQuery(op);
This query causes an ARQNotImplemented exception thrown in the last function
call. The exception stack trace is:
com.hp.hpl.jena.sparql.ARQNotImplemented error occurred when handling the REST
data service.
Not implemented: OpPath
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.visit(OpAsQuery.java:224)
at com.hp.hpl.jena.sparql.algebra.op.OpPath.visit(OpPath.java:73)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.asElementGroup(OpAsQuery.java:97)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.asElement(OpAsQuery.java:88)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.visit(OpAsQuery.java:168)
at com.hp.hpl.jena.sparql.algebra.op.OpSequence.visit(OpSequence.java:75)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.visit(OpAsQuery.java:473)
at com.hp.hpl.jena.sparql.algebra.op.OpSlice.visit(OpSlice.java:50)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.asElementGroup(OpAsQuery.java:97)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.asElement(OpAsQuery.java:88)
at
com.hp.hpl.jena.sparql.algebra.OpAsQuery$Converter.visit(OpAsQuery.java:310)
at com.hp.hpl.jena.sparql.algebra.op.OpFilter.visit(OpFilter.java:110)
at com.hp.hpl.jena.sparql.algebra.OpAsQuery.asQuery(OpAsQuery.java:50)
The arq library I used is jena-arq-2.9.1 and the jean is jena-core-2.7.1
My question is if this is bug in the arq functions? I have tested these
functions without adding the filter(the third call), but it still throws the
exception.
If it isa bug, how can I file a defect to it?
If it is not, how can I fix my code to avoid this exception.
Thanks a lot for your help.
John