-
Notifications
You must be signed in to change notification settings - Fork 555
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
date serialization failure #648
Labels
bug
Something isn't working
help wanted
Extra attention is needed
serialization
Related to serialization.
Milestone
Comments
joernhees
added
bug
Something isn't working
serialization
Related to serialization.
help wanted
Extra attention is needed
labels
Oct 15, 2016
I agree that not being able to serialise this things is very bad, but this fix introduces weird unexpected behaviour for everyone who wants semantically meaningful comparisons of literals (i.e. SPARQL) A fix must be to pass a custom comparator into the sort call inside the serialiser, and do the fall back there. |
same issue: #613 |
This was referenced Mar 16, 2017
tgbugs
added a commit
to tgbugs/rdflib
that referenced
this issue
Nov 30, 2017
This commit provides basic infrastructure for sorting Literals by value where the underlying type has no total ordering. This provides a more consistent solution to issues like: RDFLib#648, RDFLib#630, and RDFLib#613. Where workarounds are implemented in the serializer. This leads to massively increased code complexity in the serializers to compensate for the fact that Literal do not support a total ordering because of some of the underlying python datatypes do not. The only datatype that I know of that causes this issue at the moment is datetime, and I have implemented a fix for that. If other types are found to have this issue the solution is to add an entry to _NO_TOTAL_ORDER_TYPES that includes a function that partitions the type into subtypes that do have total orders.
tgbugs
added a commit
to tgbugs/rdflib
that referenced
this issue
Nov 30, 2017
This commit provides basic infrastructure for sorting Literals by value where the underlying type has no total ordering. This provides a more consistent solution to issues like: RDFLib#648, RDFLib#630, and RDFLib#613. Where workarounds are implemented in the serializer. This leads to massively increased code complexity in the serializers to compensate for the fact that Literal do not support a total ordering because of some of the underlying python datatypes do not. The only datatype that I know of that causes this issue at the moment is datetime, and I have implemented a fix for that. If other types are found to have this issue the solution is to add an entry to _NO_TOTAL_ORDER_TYPES that includes a function that partitions the type into subtypes that do have total orders.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
help wanted
Extra attention is needed
serialization
Related to serialization.
The following code:
Causes an error:
This is because the serializer is trying to sort the output tuples and the two different forms of date/time can't be compared.
Recommend the following change - line 822, term.py
The idea being that, if the native comparison doesn't work, fall back on the string comparison.
The text was updated successfully, but these errors were encountered: