You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@apache.org> on 2012/09/26 20:57:43 UTC

Boolean TSV, CSv results.

Rob,

Could you say a little more about this?


In legal TSV the header line is required so only a header line is a bit 
confusing.

In CSV, while header lines are not required, it is by SPARQL.

The SPARQL result set formats don't define boolean results so maybe it's 
better to fit as a magically understood result set.  The current format 
would be read as a result of zero rows and one column.  Instead what do 
you think about:

TSV:
----------
?_askResult
true
----------

CSV:
----------
_askResult
false
----------

then it will work for Fuseki, say, serving results to a general purpose 
SPARQL results parser using content negotiation.

And IIRC it's what 4store does.

	Andy


On 25/09/12 19:21, rvesse@apache.org wrote:
> Author: rvesse
> Date: Tue Sep 25 18:21:14 2012
> New Revision: 1390037
>
> URL: http://svn.apache.org/viewvc?rev=1390037&view=rev
> Log:
> Adds support for parsing boolean results from TSV and CSV formats, updates QueryEngineHttp.execAsk() to use actual content type to choose parser and allow for TSV and CSV content type to be returned
>
> Modified:
>      jena/trunk/jena-arq/ReleaseNotes.txt
>      jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/QueryEngineHTTP.java
>      jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/CSVInput.java
>      jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/TSVInput.java
>      jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/serializer/Serializer.java
>      jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/resultset/TestResultSetFormat2.java


Re: Boolean TSV, CSV results.

Posted by Andy Seaborne <an...@apache.org>.
On 27/09/12 17:02, Rob Vesse wrote:
> Yes I'm aware the specification doesn't cover this
>
> What I put in was simply parsing for what TSVOutput and CSVOutput
> currently produce so it can be round tripped
>
> Some magic variable name in the header row might be preferable

Ah - looking at the history on TSVOutput and CSVOutput, it looks like 
some code was needed to fulfil the interface contract.

	Andy

>
> Rob
>
>
>
> On 9/26/12 11:57 AM, "Andy Seaborne" <an...@apache.org> wrote:
>
>> Rob,
>>
>> Could you say a little more about this?
>>
>>
>> In legal TSV the header line is required so only a header line is a bit
>> confusing.
>>
>> In CSV, while header lines are not required, it is by SPARQL.
>>
>> The SPARQL result set formats don't define boolean results so maybe it's
>> better to fit as a magically understood result set.  The current format
>> would be read as a result of zero rows and one column.  Instead what do
>> you think about:
>>
>> TSV:
>> ----------
>> ?_askResult
>> true
>> ----------
>>
>> CSV:
>> ----------
>> _askResult
>> false
>> ----------
>>
>> then it will work for Fuseki, say, serving results to a general purpose
>> SPARQL results parser using content negotiation.
>>
>> And IIRC it's what 4store does.
>>
>> 	Andy
>>
>>
>> On 25/09/12 19:21, rvesse@apache.org wrote:
>>> Author: rvesse
>>> Date: Tue Sep 25 18:21:14 2012
>>> New Revision: 1390037
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1390037&view=rev
>>> Log:
>>> Adds support for parsing boolean results from TSV and CSV formats,
>>> updates QueryEngineHttp.execAsk() to use actual content type to choose
>>> parser and allow for TSV and CSV content type to be returned
>>>
>>> Modified:
>>>       jena/trunk/jena-arq/ReleaseNotes.txt
>>>
>>> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/Quer
>>> yEngineHTTP.java
>>>
>>> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/CSVInp
>>> ut.java
>>>
>>> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/TSVInp
>>> ut.java
>>>
>>> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/serializer/Seria
>>> lizer.java
>>>
>>> jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/resultset/TestRe
>>> sultSetFormat2.java
>>
>


Re: Boolean TSV, CSv results.

Posted by Rob Vesse <rv...@yarcdata.com>.
Yes I'm aware the specification doesn't cover this

What I put in was simply parsing for what TSVOutput and CSVOutput
currently produce so it can be round tripped

Some magic variable name in the header row might be preferable

Rob



On 9/26/12 11:57 AM, "Andy Seaborne" <an...@apache.org> wrote:

>Rob,
>
>Could you say a little more about this?
>
>
>In legal TSV the header line is required so only a header line is a bit
>confusing.
>
>In CSV, while header lines are not required, it is by SPARQL.
>
>The SPARQL result set formats don't define boolean results so maybe it's
>better to fit as a magically understood result set.  The current format
>would be read as a result of zero rows and one column.  Instead what do
>you think about:
>
>TSV:
>----------
>?_askResult
>true
>----------
>
>CSV:
>----------
>_askResult
>false
>----------
>
>then it will work for Fuseki, say, serving results to a general purpose
>SPARQL results parser using content negotiation.
>
>And IIRC it's what 4store does.
>
>	Andy
>
>
>On 25/09/12 19:21, rvesse@apache.org wrote:
>> Author: rvesse
>> Date: Tue Sep 25 18:21:14 2012
>> New Revision: 1390037
>>
>> URL: http://svn.apache.org/viewvc?rev=1390037&view=rev
>> Log:
>> Adds support for parsing boolean results from TSV and CSV formats,
>>updates QueryEngineHttp.execAsk() to use actual content type to choose
>>parser and allow for TSV and CSV content type to be returned
>>
>> Modified:
>>      jena/trunk/jena-arq/ReleaseNotes.txt
>>      
>>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/Quer
>>yEngineHTTP.java
>>      
>>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/CSVInp
>>ut.java
>>      
>>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/resultset/TSVInp
>>ut.java
>>      
>>jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/serializer/Seria
>>lizer.java
>>      
>>jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/resultset/TestRe
>>sultSetFormat2.java
>