You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Laurent Pellegrino <la...@gmail.com> on 2011/07/13 11:04:27 UTC

Translate the algebra to a SPARQL query string

Hi all,

I would like to rewrite a SPARQL query. My idea consists in compiling
the SPARQL query string to the algebra form. Then, I can edit the
algebra tree (prune it for example). However, I don't know how to
translate the algebra into a SPARQL query string. Is it possible to do
it from the algebra?

Kind Regards,

Laurent

Re: Translate the algebra to a SPARQL query string

Posted by Olivier Rossel <ol...@gmail.com>.
Licence = AGPL. Tss tss tss...

On Wed, Jul 13, 2011 at 4:25 PM, Rob Vesse <ra...@ecs.soton.ac.uk> wrote:
> Yes they provide an open source implementation which does both -
> http://topbraid.org/spin/api/
>
> Rob
>
> On Wed, 13 Jul 2011 16:24:21 +0200, Olivier Rossel
> <ol...@gmail.com> wrote:
>> [Off-Topic] does TopQuadrant (or other) provide a usable SPIN-to-SPARQL
>> lib?
>> and what about a SPARQL-to-SPIN lib?
>>
>>
>> On Wed, Jul 13, 2011 at 4:12 PM, Olivier Rossel
>> <ol...@gmail.com> wrote:
>>> nope. but that's a similar idea.
>>> thanks for the link.
>>>
>>> On Wed, Jul 13, 2011 at 4:04 PM, Damian Steer <d....@bristol.ac.uk>
>>> wrote:
>>>>
>>>> On 13 Jul 2011, at 14:55, Olivier Rossel wrote:
>>>>
>>>>> In Datao, we model the query in SPARQL-in-RDF, then generate the
>>>>> SPARQL query from this RDF model.
>>>>> It might be another option.
>>>>
>>>> That's a good point. I assume you're talking about [1]?
>>>>
>>>> Damian
>>>>
>>>> [1] <http://spinrdf.org/sp.html>
>>>>
>>>
>
> --
> PhD Student
> IAM Group
> Bay 20, Room 4027, Building 32
> Electronics & Computer Science
> University of Southampton
>

Re: Translate the algebra to a SPARQL query string

Posted by Rob Vesse <ra...@ecs.soton.ac.uk>.
Yes they provide an open source implementation which does both -
http://topbraid.org/spin/api/

Rob

On Wed, 13 Jul 2011 16:24:21 +0200, Olivier Rossel
<ol...@gmail.com> wrote:
> [Off-Topic] does TopQuadrant (or other) provide a usable SPIN-to-SPARQL
> lib?
> and what about a SPARQL-to-SPIN lib?
> 
> 
> On Wed, Jul 13, 2011 at 4:12 PM, Olivier Rossel
> <ol...@gmail.com> wrote:
>> nope. but that's a similar idea.
>> thanks for the link.
>>
>> On Wed, Jul 13, 2011 at 4:04 PM, Damian Steer <d....@bristol.ac.uk>
>> wrote:
>>>
>>> On 13 Jul 2011, at 14:55, Olivier Rossel wrote:
>>>
>>>> In Datao, we model the query in SPARQL-in-RDF, then generate the
>>>> SPARQL query from this RDF model.
>>>> It might be another option.
>>>
>>> That's a good point. I assume you're talking about [1]?
>>>
>>> Damian
>>>
>>> [1] <http://spinrdf.org/sp.html>
>>>
>>

-- 
PhD Student
IAM Group
Bay 20, Room 4027, Building 32
Electronics & Computer Science
University of Southampton

Re: Translate the algebra to a SPARQL query string

Posted by Olivier Rossel <ol...@gmail.com>.
[Off-Topic] does TopQuadrant (or other) provide a usable SPIN-to-SPARQL lib?
and what about a SPARQL-to-SPIN lib?


On Wed, Jul 13, 2011 at 4:12 PM, Olivier Rossel
<ol...@gmail.com> wrote:
> nope. but that's a similar idea.
> thanks for the link.
>
> On Wed, Jul 13, 2011 at 4:04 PM, Damian Steer <d....@bristol.ac.uk> wrote:
>>
>> On 13 Jul 2011, at 14:55, Olivier Rossel wrote:
>>
>>> In Datao, we model the query in SPARQL-in-RDF, then generate the
>>> SPARQL query from this RDF model.
>>> It might be another option.
>>
>> That's a good point. I assume you're talking about [1]?
>>
>> Damian
>>
>> [1] <http://spinrdf.org/sp.html>
>>
>

Re: Translate the algebra to a SPARQL query string

Posted by Olivier Rossel <ol...@gmail.com>.
nope. but that's a similar idea.
thanks for the link.

On Wed, Jul 13, 2011 at 4:04 PM, Damian Steer <d....@bristol.ac.uk> wrote:
>
> On 13 Jul 2011, at 14:55, Olivier Rossel wrote:
>
>> In Datao, we model the query in SPARQL-in-RDF, then generate the
>> SPARQL query from this RDF model.
>> It might be another option.
>
> That's a good point. I assume you're talking about [1]?
>
> Damian
>
> [1] <http://spinrdf.org/sp.html>
>

Re: Translate the algebra to a SPARQL query string

Posted by Damian Steer <d....@bristol.ac.uk>.
On 13 Jul 2011, at 14:55, Olivier Rossel wrote:

> In Datao, we model the query in SPARQL-in-RDF, then generate the
> SPARQL query from this RDF model.
> It might be another option.

That's a good point. I assume you're talking about [1]?

Damian

[1] <http://spinrdf.org/sp.html>

Re: Translate the algebra to a SPARQL query string

Posted by Olivier Rossel <ol...@gmail.com>.
In Datao, we model the query in SPARQL-in-RDF, then generate the
SPARQL query from this RDF model.
It might be another option.


On Wed, Jul 13, 2011 at 3:20 PM, Laurent Pellegrino
<la...@gmail.com> wrote:
> Thanks for your answers.
>
> Laurent
>
> On Wed, Jul 13, 2011 at 11:45 AM, Damian Steer <d....@bristol.ac.uk> wrote:
>>
>> On 13 Jul 2011, at 10:24, Andy Seaborne wrote:
>>
>>>
>>>
>>> On 13/07/11 10:04, Laurent Pellegrino wrote:
>>>> Hi all,
>>>>
>>>> I would like to rewrite a SPARQL query. My idea consists in compiling
>>>> the SPARQL query string to the algebra form. Then, I can edit the
>>>> algebra tree (prune it for example). However, I don't know how to
>>>> translate the algebra into a SPARQL query string. Is it possible to do
>>>> it from the algebra?
>>>>
>>>> Kind Regards,
>>>>
>>>> Laurent
>>>
>>> See
>>> OpAsQuery.asQuery(Op)
>>>
>>> It's not perfect.
>>
>> We were using this quite extensively in a recent project, and while not perfect we certainly battle tested a decent part of it, including SPARQL 1.1 group and count. Related: [1].
>>
>> Damian
>>
>> [1] <http://openjena.org/wiki/ARQ/Manipulating_SPARQL_using_ARQ>
>

Re: Translate the algebra to a SPARQL query string

Posted by Laurent Pellegrino <la...@gmail.com>.
Thanks for your answers.

Laurent

On Wed, Jul 13, 2011 at 11:45 AM, Damian Steer <d....@bristol.ac.uk> wrote:
>
> On 13 Jul 2011, at 10:24, Andy Seaborne wrote:
>
>>
>>
>> On 13/07/11 10:04, Laurent Pellegrino wrote:
>>> Hi all,
>>>
>>> I would like to rewrite a SPARQL query. My idea consists in compiling
>>> the SPARQL query string to the algebra form. Then, I can edit the
>>> algebra tree (prune it for example). However, I don't know how to
>>> translate the algebra into a SPARQL query string. Is it possible to do
>>> it from the algebra?
>>>
>>> Kind Regards,
>>>
>>> Laurent
>>
>> See
>> OpAsQuery.asQuery(Op)
>>
>> It's not perfect.
>
> We were using this quite extensively in a recent project, and while not perfect we certainly battle tested a decent part of it, including SPARQL 1.1 group and count. Related: [1].
>
> Damian
>
> [1] <http://openjena.org/wiki/ARQ/Manipulating_SPARQL_using_ARQ>

Re: Translate the algebra to a SPARQL query string

Posted by Damian Steer <d....@bristol.ac.uk>.
On 13 Jul 2011, at 10:24, Andy Seaborne wrote:

> 
> 
> On 13/07/11 10:04, Laurent Pellegrino wrote:
>> Hi all,
>> 
>> I would like to rewrite a SPARQL query. My idea consists in compiling
>> the SPARQL query string to the algebra form. Then, I can edit the
>> algebra tree (prune it for example). However, I don't know how to
>> translate the algebra into a SPARQL query string. Is it possible to do
>> it from the algebra?
>> 
>> Kind Regards,
>> 
>> Laurent
> 
> See
> OpAsQuery.asQuery(Op)
> 
> It's not perfect.

We were using this quite extensively in a recent project, and while not perfect we certainly battle tested a decent part of it, including SPARQL 1.1 group and count. Related: [1].

Damian

[1] <http://openjena.org/wiki/ARQ/Manipulating_SPARQL_using_ARQ>

Re: Translate the algebra to a SPARQL query string

Posted by Andy Seaborne <an...@epimorphics.com>.

On 13/07/11 10:04, Laurent Pellegrino wrote:
> Hi all,
>
> I would like to rewrite a SPARQL query. My idea consists in compiling
> the SPARQL query string to the algebra form. Then, I can edit the
> algebra tree (prune it for example). However, I don't know how to
> translate the algebra into a SPARQL query string. Is it possible to do
> it from the algebra?
>
> Kind Regards,
>
> Laurent

See
OpAsQuery.asQuery(Op)

It's not perfect.

It is used for SERVICE.

	Andy