term.py sort Literals with no total order
term.py sort Literals with no total order

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:
https://github.com/RDFLib/rdflib/issues/648,
https://github.com/RDFLib/rdflib/issues/630, and
https://github.com/RDFLib/rdflib/issues/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.

RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib