You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@clerezza.apache.org by Minto van der Sluis <mi...@xup.nl> on 2013/03/18 22:19:43 UTC

extend ResultSet with ResultSetMetaData

Hi folks,

Is it feasible to extend the current sparqle ResultSet with an interface
to extract metadata without consuming the resultset. I was thinking of
something like java.sql.ResultSetMetaData.

Why?
I've created sort of a decorator to show some metadata of a ResultSet
and I had to consume the resultset to find out which columns were there.
However the current situation allows to consume the ResultSet only once.

It probably is feasible. The question is more like, if I create a patch
will it be accepted?

Regards,

Minto

-- 
ir. ing. Minto van der Sluis
Software innovator / renovator
Xup BV


Re: extend ResultSet with ResultSetMetaData

Posted by Reto Bachmann-Gmür <re...@apache.org>.
Sounds convincing. But maybe wait a few weeks till we have the
fastlane and sparql 1.1 stuff in place as.

Cheers,
Reto

On Tue, Mar 19, 2013 at 4:29 PM, Minto van der Sluis <mi...@xup.nl> wrote:
> Hi Reto,
>
> Let me put it differently. If Clerezza is complient with [1] or [2] what
> would the response look like if the query has no results? In particular
> the head [3] section.  IMO this section can not be constructed without
> meta data as there are no results to derive the information from.
> Looking at the code for ResultSetMessageBodyWriter I think it will even
> NPE in the method createVariable if a no entries ResultSet is supplied.
>
> On the other hand Apache Jena has a ResultSet with metadata. This class
> contains the following method.
>
>     public List<String> getResultVars() ;
>
> Regards,
>
> Minto
>
> [1] http://www.w3.org/TR/rdf-sparql-XMLres/
> [2] http://www.w3.org/TR/rdf-sparql-json-res/
> [3] http://www.w3.org/TR/rdf-sparql-XMLres/#head
>
> Op 19-3-2013 15:33, Reto Bachmann-Gmür schreef:
>> Hi Minto
>>
>> If I'm not mistaken the situation for SQL is a bit different as the
>> metadata of the result cannot be infered from the query. With Sparql I
>> don't see how this metadata would be dependent on the actual result.
>>
>> Maybe Hasan can tell more about this.
>>
>> Cheers,
>> Reto
>>
>> On Mon, Mar 18, 2013 at 10:19 PM, Minto van der Sluis <mi...@xup.nl> wrote:
>>
>>> Hi folks,
>>>
>>> Is it feasible to extend the current sparqle ResultSet with an interface
>>> to extract metadata without consuming the resultset. I was thinking of
>>> something like java.sql.ResultSetMetaData.
>>>
>>> Why?
>>> I've created sort of a decorator to show some metadata of a ResultSet
>>> and I had to consume the resultset to find out which columns were there.
>>> However the current situation allows to consume the ResultSet only once.
>>>
>>> It probably is feasible. The question is more like, if I create a patch
>>> will it be accepted?
>>>
>>> Regards,
>>>
>>> Minto
>>>
>>> --
>>> ir. ing. Minto van der Sluis
>>> Software innovator / renovator
>>> Xup BV
>>>
>>>
>
>
> --
> ir. ing. Minto van der Sluis
> Software innovator / renovator
> Xup BV
>
> Mobiel: +31 (0) 626 014541
>

Re: extend ResultSet with ResultSetMetaData

Posted by Minto van der Sluis <mi...@xup.nl>.
Hi Reto,

Let me put it differently. If Clerezza is complient with [1] or [2] what
would the response look like if the query has no results? In particular
the head [3] section.  IMO this section can not be constructed without
meta data as there are no results to derive the information from.
Looking at the code for ResultSetMessageBodyWriter I think it will even
NPE in the method createVariable if a no entries ResultSet is supplied.

On the other hand Apache Jena has a ResultSet with metadata. This class
contains the following method.

    public List<String> getResultVars() ;

Regards,

Minto

[1] http://www.w3.org/TR/rdf-sparql-XMLres/
[2] http://www.w3.org/TR/rdf-sparql-json-res/
[3] http://www.w3.org/TR/rdf-sparql-XMLres/#head

Op 19-3-2013 15:33, Reto Bachmann-Gmür schreef:
> Hi Minto
>
> If I'm not mistaken the situation for SQL is a bit different as the
> metadata of the result cannot be infered from the query. With Sparql I
> don't see how this metadata would be dependent on the actual result.
>
> Maybe Hasan can tell more about this.
>
> Cheers,
> Reto
>
> On Mon, Mar 18, 2013 at 10:19 PM, Minto van der Sluis <mi...@xup.nl> wrote:
>
>> Hi folks,
>>
>> Is it feasible to extend the current sparqle ResultSet with an interface
>> to extract metadata without consuming the resultset. I was thinking of
>> something like java.sql.ResultSetMetaData.
>>
>> Why?
>> I've created sort of a decorator to show some metadata of a ResultSet
>> and I had to consume the resultset to find out which columns were there.
>> However the current situation allows to consume the ResultSet only once.
>>
>> It probably is feasible. The question is more like, if I create a patch
>> will it be accepted?
>>
>> Regards,
>>
>> Minto
>>
>> --
>> ir. ing. Minto van der Sluis
>> Software innovator / renovator
>> Xup BV
>>
>>


-- 
ir. ing. Minto van der Sluis
Software innovator / renovator
Xup BV

Mobiel: +31 (0) 626 014541


Re: extend ResultSet with ResultSetMetaData

Posted by Reto Bachmann-Gmür <re...@apache.org>.
Hi Minto

If I'm not mistaken the situation for SQL is a bit different as the
metadata of the result cannot be infered from the query. With Sparql I
don't see how this metadata would be dependent on the actual result.

Maybe Hasan can tell more about this.

Cheers,
Reto

On Mon, Mar 18, 2013 at 10:19 PM, Minto van der Sluis <mi...@xup.nl> wrote:

> Hi folks,
>
> Is it feasible to extend the current sparqle ResultSet with an interface
> to extract metadata without consuming the resultset. I was thinking of
> something like java.sql.ResultSetMetaData.
>
> Why?
> I've created sort of a decorator to show some metadata of a ResultSet
> and I had to consume the resultset to find out which columns were there.
> However the current situation allows to consume the ResultSet only once.
>
> It probably is feasible. The question is more like, if I create a patch
> will it be accepted?
>
> Regards,
>
> Minto
>
> --
> ir. ing. Minto van der Sluis
> Software innovator / renovator
> Xup BV
>
>