Hello Rob, Claude
Thanks for your answers. I'm in a bit of a problem, because I'm using a
library called Mediation [1], which in fact does the Transformation.
However this library relies on a earlier version of Jena, and it won't work
with the last version. And this earlier version doesn`t provide
Syntax.syntaxSPARQL_11, so I can't issue the queries anyway =/
I'm rendering back the query, implementing the OpAsQuery missing methods.
However I got another doubt, check the query below:
select ?p count( ?b ) { ?p a <http://marafo.com#Paciente>. ?a <
http://marafo.com#tem> ?b. LET ( ?marafo := ?b+1 ) } group by ?p
The generated algebra is:
(project (?p ?.1)
(assign ((?.1 ?.0))
(group (?p) ((?.0 (count ?b)))
(bgp
(triple ?p <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <
http://marafo.com#Paciente>)
(triple ?a <http://marafo.com#tem> ?b)
))))
I didn't get why is there this "(assign (?.1 ?.0) ) " thing... can someone
enlighten me?
Thanks again!
[1] https://github.com/correndo/mediation
--
diogo patrão
On Thu, Mar 21, 2013 at 3:52 AM, Claude Warren <[email protected]> wrote:
> Diogo,
>
> When I implemented similar functionality for Granatum I implemented a
> QueryEngine by extending QueryEngineMain and overriding modifyOp(Op). I
> was able to make extensive modifications to the query (including inserting
> service calls). It is not trivial but it is doable. I assume you are
> trying to do something like FedX or DARQ.
>
> Claude
>
> On Thu, Mar 21, 2013 at 1:45 AM, Diogo FC Patrao <[email protected]
> >wrote:
>
> > Hello
> >
> > I'm working on a sparql query "expander", that is, it add triples and
> > filters to a query in order to emulate some inference (say you have A ->
> B
> > AND C, and a query SELECT * { ?s rdfs:type A }, it would return SELECT *
> {
> > ?s rdfs:type B. ?s rdfs:type C}).
> >
> > I'm manipulating sparql queries on the algebra level (using Transformer),
> > and then I'm returning it as a query, using OpAsQuery. However, not all
> > algebras can be translated back, specifically, those using SERVICE.
> >
> > I found this link [1] and decided to execute the algebra directly.
> However,
> > the example code in the link has two issues (for what I want):
> >
> > a) it returns a QueryIterator, not a Resultset.
> >
> > b) it`s not clear how I specify a remote sparql endpoint.
> >
> > c) I feel like I would have to rewrite (or clone) some code
> >
> > So I thought that maybe the best thing for me would be to run my
> > transformation in the middle of the query execution pipeline.
> >
> > Is there a way to accomplish that? If not, what you feel as the best way
> > out (including implementing all stuff missing on OpAsQuery)?
> >
> > Thanks in advance!
> >
> >
> >
> > [1]:
> >
> >
> http://mail-archives.apache.org/mod_mbox/jena-users/201210.mbox/%[email protected]%3E
> >
> > --
> > diogo patrão
> >
>
>
>
> --
> I like: Like Like - The likeliest place on the web<
> http://like-like.xenei.com>
> Identity: https://www.identify.nu/[email protected]
> LinkedIn: http://www.linkedin.com/in/claudewarren
>