You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@graphity.org> on 2013/04/03 18:21:26 UTC

QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

Hey all,

QueryEngineHTTP does not implement setInitialBindings() due to Jena's
implementation specifics, as I found out a while ago:
http://mail-archives.apache.org/mod_mbox/jena-users/201201.mbox/%3C4F11B03E.7040004@apache.org%3E

However, this lack of uniformity prevents generic code that depends on
QueryExecution. Usually implementations need the same behavior no
matter where the query is executed (locally or remotely). There was
recently such case within SPIN API:
https://groups.google.com/forum/?fromgroups=#!topic/topbraid-users/pMeMo-1U4_k

So I was wondering, wouldn't it be possible to implement
QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?
Now the code includes a notice related to this, but no implementation.

If that looks reasonable, I can make a new issue on JIRA.

Martynas
graphity.org

Re: QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

Posted by Rob Vesse <rv...@yarcdata.com>.
I think that injecting a VALUES clause is the best way to go for
QueryEngineHTTP but that requires some design and testing effort to do so
in a way that doesn't bork queries that themselves use VALUES


Please open a JIRA for this so we can track it as a feature request but as
with everything on an open source project when it gets done will depend on
when someone has spare time to look at the problem

Rob

On 4/3/13 10:23 AM, "Martynas Jusevičius" <ma...@graphity.org> wrote:

>Thanks for the explanation Rob.
>
>But what does this leave me with, if I want to
>- use the exact same query form (no SERVICE workaround) to work both
>locally and remotely
>- bind values to variables in that query
>at the same time?
>
>Martynas
>
>On Wed, Apr 3, 2013 at 7:43 PM, Rob Vesse <rv...@yarcdata.com> wrote:
>> Using ParameterizedSparqlString doesn't work for a couple of reasons:
>>
>>
>> 1 - As Holger points out it is using dumb string substitution (the
>>Javadoc
>> says as much) so doesn't necessarily substitute what you actually want
>> 2 - It only allows a single value per variable whereas initial bindings
>> allows many possible values per variable
>>
>> Holger's SERVICE workaround functions because internally ARQ substitutes
>> each possible binding once into the SERVICE clause so executes
>>potentially
>> many remote calls to appropriately fulfill the SERVICE portion of the
>> query.
>>
>> One possibility would be to inject a VALUES clause into the query though
>> there may be some issues with scoping and collision with existing VALUES
>> clauses
>>
>> Feel free to open a JIRA
>>
>> Rob
>>
>> On 4/3/13 9:21 AM, "Martynas Jusevičius" <ma...@graphity.org> wrote:
>>
>>>Hey all,
>>>
>>>QueryEngineHTTP does not implement setInitialBindings() due to Jena's
>>>implementation specifics, as I found out a while ago:
>>>http://mail-archives.apache.org/mod_mbox/jena-users/201201.mbox/%3C4F11B
>>>03
>>>E.7040004@apache.org%3E
>>>
>>>However, this lack of uniformity prevents generic code that depends on
>>>QueryExecution. Usually implementations need the same behavior no
>>>matter where the query is executed (locally or remotely). There was
>>>recently such case within SPIN API:
>>>https://groups.google.com/forum/?fromgroups=#!topic/topbraid-users/pMeMo
>>>-1
>>>U4_k
>>>
>>>So I was wondering, wouldn't it be possible to implement
>>>QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?
>>>Now the code includes a notice related to this, but no implementation.
>>>
>>>If that looks reasonable, I can make a new issue on JIRA.
>>>
>>>Martynas
>>>graphity.org
>>


Re: QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

Posted by Martynas Jusevičius <ma...@graphity.org>.
Thanks for the explanation Rob.

But what does this leave me with, if I want to
- use the exact same query form (no SERVICE workaround) to work both
locally and remotely
- bind values to variables in that query
at the same time?

Martynas

On Wed, Apr 3, 2013 at 7:43 PM, Rob Vesse <rv...@yarcdata.com> wrote:
> Using ParameterizedSparqlString doesn't work for a couple of reasons:
>
>
> 1 - As Holger points out it is using dumb string substitution (the Javadoc
> says as much) so doesn't necessarily substitute what you actually want
> 2 - It only allows a single value per variable whereas initial bindings
> allows many possible values per variable
>
> Holger's SERVICE workaround functions because internally ARQ substitutes
> each possible binding once into the SERVICE clause so executes potentially
> many remote calls to appropriately fulfill the SERVICE portion of the
> query.
>
> One possibility would be to inject a VALUES clause into the query though
> there may be some issues with scoping and collision with existing VALUES
> clauses
>
> Feel free to open a JIRA
>
> Rob
>
> On 4/3/13 9:21 AM, "Martynas Jusevičius" <ma...@graphity.org> wrote:
>
>>Hey all,
>>
>>QueryEngineHTTP does not implement setInitialBindings() due to Jena's
>>implementation specifics, as I found out a while ago:
>>http://mail-archives.apache.org/mod_mbox/jena-users/201201.mbox/%3C4F11B03
>>E.7040004@apache.org%3E
>>
>>However, this lack of uniformity prevents generic code that depends on
>>QueryExecution. Usually implementations need the same behavior no
>>matter where the query is executed (locally or remotely). There was
>>recently such case within SPIN API:
>>https://groups.google.com/forum/?fromgroups=#!topic/topbraid-users/pMeMo-1
>>U4_k
>>
>>So I was wondering, wouldn't it be possible to implement
>>QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?
>>Now the code includes a notice related to this, but no implementation.
>>
>>If that looks reasonable, I can make a new issue on JIRA.
>>
>>Martynas
>>graphity.org
>

Re: QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?

Posted by Rob Vesse <rv...@yarcdata.com>.
Using ParameterizedSparqlString doesn't work for a couple of reasons:


1 - As Holger points out it is using dumb string substitution (the Javadoc
says as much) so doesn't necessarily substitute what you actually want
2 - It only allows a single value per variable whereas initial bindings
allows many possible values per variable

Holger's SERVICE workaround functions because internally ARQ substitutes
each possible binding once into the SERVICE clause so executes potentially
many remote calls to appropriately fulfill the SERVICE portion of the
query.

One possibility would be to inject a VALUES clause into the query though
there may be some issues with scoping and collision with existing VALUES
clauses

Feel free to open a JIRA

Rob

On 4/3/13 9:21 AM, "Martynas Jusevičius" <ma...@graphity.org> wrote:

>Hey all,
>
>QueryEngineHTTP does not implement setInitialBindings() due to Jena's
>implementation specifics, as I found out a while ago:
>http://mail-archives.apache.org/mod_mbox/jena-users/201201.mbox/%3C4F11B03
>E.7040004@apache.org%3E
>
>However, this lack of uniformity prevents generic code that depends on
>QueryExecution. Usually implementations need the same behavior no
>matter where the query is executed (locally or remotely). There was
>recently such case within SPIN API:
>https://groups.google.com/forum/?fromgroups=#!topic/topbraid-users/pMeMo-1
>U4_k
>
>So I was wondering, wouldn't it be possible to implement
>QueryEngineHTTP.setInitialBinding() using ParameterizedSparqlString?
>Now the code includes a notice related to this, but no implementation.
>
>If that looks reasonable, I can make a new issue on JIRA.
>
>Martynas
>graphity.org