Issue 203 in rdflib: Constructing a literal from another literal does not copy language or datatype tag

9 views
Skip to first unread message

rdf...@googlecode.com

unread,
Jan 15, 2012, 1:20:51 PM1/15/12
to rdfli...@googlegroups.com
Status: Accepted
Owner: gromgull
Labels: Type-Defect Component-rdf

New issue 203 by gromgull: Constructing a literal from another literal does
not copy language or datatype tag
http://code.google.com/p/rdflib/issues/detail?id=203

In [15]: b=rdflib.Literal("2", datatype=rdflib.XSD.integer)

In [16]: b
Out[16]: rdflib.term.Literal(u'2',
datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#integer'))

In [17]: rdflib.Literal(b)==b
Out[17]: False

In [18]: rdflib.Literal(b)
Out[18]: rdflib.term.Literal(u'2')

----

In [9]: a=rdflib.Literal("cake",lang="en")

In [10]: a
Out[10]: rdflib.term.Literal(u'cake', lang='en')

In [11]: rdflib.Literal(a)==a
Out[11]: False

In [14]: rdflib.Literal(a)
Out[14]: rdflib.term.Literal(u'cake')

The constructor thinks it's just a string - we should probably check for
literals and copy it completely.

rdf...@googlecode.com

unread,
Feb 15, 2012, 9:21:15 AM2/15/12
to rdfli...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 203 by gromgull: Constructing a literal from another

literal does not copy language or datatype tag
http://code.google.com/p/rdflib/issues/detail?id=203

Fixed in r7a4d65400beb

Reply all
Reply to author
Forward
0 new messages