term.py _NO_TOTAL_ORDER_TYPES now tests agasint native python types
@@ -812,8 +812,8 @@ class Literal(Identifier):
return self.language > other.language
if self.value != None and other.value != None:
- if dtself in _NO_TOTAL_ORDER_TYPES:
- comparator = _NO_TOTAL_ORDER_TYPES[dtself]
+ if type(self.value) in _NO_TOTAL_ORDER_TYPES:
+ comparator = _NO_TOTAL_ORDER_TYPES[type(self.value)]
return comparator(self.value) > comparator(other.value)
return self.value > other.value
@@ -1362,9 +1362,6 @@ _XSD_DATETIME = URIRef(_XSD_PFX + 'dateTime')
_XSD_DATE = URIRef(_XSD_PFX + 'date')
_XSD_TIME = URIRef(_XSD_PFX + 'time')
-_XSD_GYEARMONTH = URIRef(_XSD_PFX + 'gYearMonth')
-_XSD_GYEAR = URIRef(_XSD_PFX + 'gYear')
-
# TODO: duration, gYearMonth, gYear, gMonthDay, gDay, gMonth
_NUMERIC_LITERAL_TYPES = (
@@ -1407,11 +1404,8 @@ _NUMERIC_INF_NAN_LITERAL_TYPES = (
# to calculate a total order over all valid members of the type
# the function must partition the type into subtypes that do have total orders
_NO_TOTAL_ORDER_TYPES = {
- _XSD_DATETIME:lambda value:bool(value.tzinfo),
- #_XSD_DATE:lambda value:bool(value.tzinfo), # TODO: xsd spec allows tz
- _XSD_TIME:lambda value:bool(value.tzinfo),
- #_XSD_GYEARMONTH:lambda value:bool(value.tzinfo), # TODO: spec allows tz
- #_XSD_GYEAR:lambda value:bool(value.tzinfo), # TODO: spec allows tz
+ datetime:lambda value:bool(value.tzinfo),
+ time:lambda value:bool(value.tzinfo),
}
def _castPythonToLiteral(obj):
