On 11/08/12 19:05, Dimitris Spanos wrote:
Hello all,
I have a ResultSetStream and I am using ResultSetFormatter to format
it. So far, I have used the asText() and toModel() methods to get it
as plain text or stored in a Model respectively. However, Bindings to
typed literals (with an xsd:integer datatype, to be precise) are
output as plain literals. Delving into the code a bit, I saw that
eventually, it is FmtUtils.stringForLiteral() which is responsible for
the formatting and apparently, it omits the datatype for xsd:integer,
xsd:decimal, xsd:double and xsd:boolean.
Is there any way to change this?
If I want to output the entire label of the literal (e.g.
10^^http://www.w3.org/2001/XMLSchema#integer) instead of just 10, do I
have to create from scratch a new utility class for the formatting of
my ResultSet?
Dimitris
Hi there,
The text form generated by asText() is supposed to be conveniently
readable - it used Turtle formatting. When asText() outputs
3
not
"3"^^xsd:integer
it does not change the fact that the data in the results really is a
types literal with lexical for "3" and datatype xsd:integer.
toModel encodes the result ste in RDF - the RDF term will be
"3"^^xsd:integer although if output in Turtle, it will appear as 3. try
N-Triples.
The text formatter does not configuration options. (Actually, the code
is ancient - it could probably do with a clean!)
If you want different text appearance, then simple take a copy of
TextOutput (I have just made getVarValueAsString protected not private
so if you use the build development from tonight, you can inherit the code).
Andy