walidazizi / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

N3 should write integers without ^^<type> syntax #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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"^^<http://www.w3.org/2001/XMLSchema#integer>.

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.

Original issue reported on code.google.com by coryd...@gmail.com on 12 Jul 2009 at 6:44

Attachments:

GoogleCodeExporter commented 8 years ago
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. :-)

Original comment by coryd...@gmail.com on 14 Jul 2009 at 6:26

GoogleCodeExporter commented 8 years ago
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)..))

Original comment by lindstr...@gmail.com on 9 Sep 2009 at 12:23

GoogleCodeExporter commented 8 years ago

Original comment by eik...@gmail.com on 1 Feb 2010 at 8:23

GoogleCodeExporter commented 8 years ago
as lindstream said, fixed in r1708. 
I verified now. 

Original comment by gromgull on 2 Feb 2010 at 10:11

GoogleCodeExporter commented 8 years ago
For the record, as of r1781 the plain form of booleans (true/false) is also 
supported 
(since the new N3 parser also handles that).

Original comment by lindstr...@gmail.com on 3 Feb 2010 at 11:19