-
Notifications
You must be signed in to change notification settings - Fork 572
Literal reworking
gromgull edited this page Mar 8, 2013
·
9 revisions
Between version 3.4.0 and 4.0, a backwards incompatible change was made in RDFLib to how datatyped literals are handled.
Hopefully, the changes will not affect very many users of RDFLib, but this page outlines what was changed and collects any changes required in code using RDFLib.
The by far biggest problem was that in the pre 4.0 handling of Datatyped Literals, __hash__
and __eq___
were not consistent, i.e.
i.e.
>>> Literal(2, datatype=XSD.int) == Literal(2, datatype=XSD.float)
False
But a new method eq
on all Nodes has been introduced, which does semantic equality checking, i.e.:
>>> Literal(2, datatype=XSD.int).eq(Literal(2, datatype=XSD.float))
True