Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructing a literal from another literal does not copy language or datatype tag #188

Closed
ghost opened this issue Feb 20, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2012

gromgull, 2012-01-15T18:20:03.000Z

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.

Comment 1 by gromgull
Fixed in r7a4d65400beb
@ghost ghost closed this as completed Feb 20, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants