RDFLib/rdflib — Issue #66: N3 should write integers without ^^<type> syntax
Author: gjhiggins
Created: 2012-02-20 08:31:50+00:00
State: open

coryd...@gmail.com, 2009-07-12T06:44:54.000Z

What steps will reproduce the problem?
1. Load the following graph, then serialize it:

:a :b 1.

What is the expected output? What do you see instead?

Expected: :a :b 1.
Actual output: :a :b "1"^^.

The attached 6-line patch fixes this. I will commit this to 2.4.x branch
if nobody has any objections. Please let me know.

Comment 1 by coryd...@gmail.com
Could someone please comment? I'm not sure whether the change I'm proposing is
backward-compatible. Also, I don't know how to run the unit tests to make sure I
didn't break anything. :-)

Comment 2 by lindstr...@gmail.com
This behaviour is the default now in trunk (r1708).

(The difference between xsd:decimal, xsd:float and xsd:double may be problematic for plain literal serializations
though, so that feature may need some verification before plain literals are positively fixed. (See also the boolean
in n3 comments in term.py#Literal (should be correlated with the n3 parser)..))

Comment 3 by eik...@gmail.com

Comment 4 by gromgull
as lindstream said, fixed in r1708.
I verified now.

Comment 5 by lindstr...@gmail.com
For the record, as of r1781 the plain form of booleans (true/false) is also supported
(since the new N3 parser also handles that).