You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Benson Margulies <bi...@gmail.com> on 2011/01/07 13:30:27 UTC
Typed integers and the query API
count(* as ?count) yields a typed integer from the query API.
1784^^http://www.w3.org/2001/XMLSchema#integer. tdbquery strips the
type. Is it just heuristicating, or is there and API in the query
system that tell me that a result variable will have type decorations?
Re: Typed integers and the query API
Posted by Benson Margulies <bi...@gmail.com>.
Yes.
On Fri, Jan 7, 2011 at 9:41 AM, Andy Seaborne
<an...@epimorphics.com> wrote:
> Will Literal.getLexicalForm() do what you want?
>
> Or Node.getLiteralLexicalForm if you like the Node way instead.
>
> (/me thinking the direct exposure of the Graph/Node/Triple A^hSPI would be
> good).
>
> Andy
>
> On 07/01/11 13:57, Benson Margulies wrote:
>>
>> To tell the truth, in this particular case, I *want* the behavior of
>> the simple command line (no types), but I'm not complaining that
>> RDFNode.toString does something else.
>>
>> On Fri, Jan 7, 2011 at 8:44 AM, Chris Dollin
>> <ch...@epimorphics.com> wrote:
>>>
>>> On Friday, January 07, 2011 01:15:07 pm Benson Margulies wrote:
>>>>
>>>> OK, I see, this is what I get for calling node.toString() on the node
>>>> from the get API of the QuerySolution instead of pondering the type
>>>> more carefully.
>>>
>>> If there were a way I could have arranged for (most) Jena objects to
>>> have a toString() which produced results in red, or in inverse video,
>>> or in the tongue of Mordor (which I shall not speak here), I would have
>>> done it.
>>>
>>> Chris
>>>
>>> --
>>> "There are questions, so many questions" /Script Switch
>>> Trigger/
>>>
>>> Epimorphics Ltd, http://www.epimorphics.com
>>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol
>>> BS20 6PT
>>> Epimorphics Ltd. is a limited company registered in England (number
>>> 7016688)
>>>
>
Re: Typed integers and the query API
Posted by Andy Seaborne <an...@epimorphics.com>.
Will Literal.getLexicalForm() do what you want?
Or Node.getLiteralLexicalForm if you like the Node way instead.
(/me thinking the direct exposure of the Graph/Node/Triple A^hSPI would
be good).
Andy
On 07/01/11 13:57, Benson Margulies wrote:
> To tell the truth, in this particular case, I *want* the behavior of
> the simple command line (no types), but I'm not complaining that
> RDFNode.toString does something else.
>
> On Fri, Jan 7, 2011 at 8:44 AM, Chris Dollin
> <ch...@epimorphics.com> wrote:
>> On Friday, January 07, 2011 01:15:07 pm Benson Margulies wrote:
>>> OK, I see, this is what I get for calling node.toString() on the node
>>> from the get API of the QuerySolution instead of pondering the type
>>> more carefully.
>>
>> If there were a way I could have arranged for (most) Jena objects to
>> have a toString() which produced results in red, or in inverse video,
>> or in the tongue of Mordor (which I shall not speak here), I would have
>> done it.
>>
>> Chris
>>
>> --
>> "There are questions, so many questions" /Script Switch Trigger/
>>
>> Epimorphics Ltd, http://www.epimorphics.com
>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
>> Epimorphics Ltd. is a limited company registered in England (number 7016688)
>>
Re: Typed integers and the query API
Posted by Benson Margulies <bi...@gmail.com>.
To tell the truth, in this particular case, I *want* the behavior of
the simple command line (no types), but I'm not complaining that
RDFNode.toString does something else.
On Fri, Jan 7, 2011 at 8:44 AM, Chris Dollin
<ch...@epimorphics.com> wrote:
> On Friday, January 07, 2011 01:15:07 pm Benson Margulies wrote:
>> OK, I see, this is what I get for calling node.toString() on the node
>> from the get API of the QuerySolution instead of pondering the type
>> more carefully.
>
> If there were a way I could have arranged for (most) Jena objects to
> have a toString() which produced results in red, or in inverse video,
> or in the tongue of Mordor (which I shall not speak here), I would have
> done it.
>
> Chris
>
> --
> "There are questions, so many questions" /Script Switch Trigger/
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
> Epimorphics Ltd. is a limited company registered in England (number 7016688)
>
Re: Typed integers and the query API
Posted by Chris Dollin <ch...@epimorphics.com>.
On Friday, January 07, 2011 01:15:07 pm Benson Margulies wrote:
> OK, I see, this is what I get for calling node.toString() on the node
> from the get API of the QuerySolution instead of pondering the type
> more carefully.
If there were a way I could have arranged for (most) Jena objects to
have a toString() which produced results in red, or in inverse video,
or in the tongue of Mordor (which I shall not speak here), I would have
done it.
Chris
--
"There are questions, so many questions" /Script Switch Trigger/
Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)
Re: Typed integers and the query API
Posted by Benson Margulies <bi...@gmail.com>.
OK, I see, this is what I get for calling node.toString() on the node
from the get API of the QuerySolution instead of pondering the type
more carefully.
Re: Typed integers and the query API
Posted by Andy Seaborne <an...@epimorphics.com>.
On 07/01/11 12:30, Benson Margulies wrote:
> count(* as ?count) yields a typed integer from the query API.
> 1784^^http://www.w3.org/2001/XMLSchema#integer. tdbquery strips the
> type. Is it just heuristicating, or is there and API in the query
> system that tell me that a result variable will have type decorations?
Example?
"1784"^^http://www.w3.org/2001/XMLSchema#integer can be printed in
Turtle as
1784
(NB no quotes -> not a string)
but it's still an integer and will be read back in as a xsd:integer.
Andy
Re: Typed integers and the query API
Posted by Andy Seaborne <an...@epimorphics.com>.
On 07/01/11 13:10, Damian Steer wrote:
>
> On 7 Jan 2011, at 12:30, Benson Margulies wrote:
>
>> count(* as ?count) yields a typed integer from the query API.
>> 1784^^http://www.w3.org/2001/XMLSchema#integer. tdbquery strips the
>> type. Is it just heuristicating, or is there and API in the query
>> system that tell me that a result variable will have type decorations?
>
> Hi Benson,
>
> I think you might be referring to the default command line output? IIRC this is a human readable table, and lossy (i.e. it drops the unreadable type bit).
>
> Pick another output format for the full story.
>
> Damian
In the text output, the cell entries are turtle syntax - unquoted
strings for numbers. Ian wanted numbers number aligned (right or '.'
aligned) but that's not done currently.
Andy
Re: Typed integers and the query API
Posted by Damian Steer <d....@bristol.ac.uk>.
On 7 Jan 2011, at 12:30, Benson Margulies wrote:
> count(* as ?count) yields a typed integer from the query API.
> 1784^^http://www.w3.org/2001/XMLSchema#integer. tdbquery strips the
> type. Is it just heuristicating, or is there and API in the query
> system that tell me that a result variable will have type decorations?
Hi Benson,
I think you might be referring to the default command line output? IIRC this is a human readable table, and lossy (i.e. it drops the unreadable type bit).
Pick another output format for the full story.
Damian