Home | Trees | Indices | Help |
---|
|
Most of the XSD datatypes are handled directly by RDFLib. However, in some cases, that is not good enough. There are two major reasons for this:
Some of these deficiencies are handled by this module. All the functions convert the lexical value into a python datatype (or return the original string if this is not possible) which will be used, eg, for comparisons (equalities). If the lexical value constraints are not met, exceptions are raised.
Requires: RDFLib, 4.0.0 and higher
License: This software is available for use under the W3C Software License
Organization: World Wide Web Consortium
Author: Ivan Herman
Contact: Ivan Herman, ivan@w3.org
|
|||
_namelessTZ (Nameless) timezone object. |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
datetime.datetime |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__author__ =
|
|||
__license__ =
|
|||
_hexc =
|
|||
_numb =
|
|||
_limits_unsignedByte =
|
|||
_limits_byte =
|
|||
_limits_unsignedInt =
|
|||
_limits_int =
|
|||
_limits_unsignedShort =
|
|||
_limits_short =
|
|||
_limits_unsignedLong =
|
|||
_limits_long =
|
|||
_limits_positiveInteger =
|
|||
_limits_nonPositiveInteger =
|
|||
_limits_nonNegativeInteger =
|
|||
_limits_negativeInteger =
|
|||
_re_language =
|
|||
_re_NMTOKEN =
|
|||
_re_Name_ex =
|
|||
_re_NCName =
|
|||
_re_NCName_ex =
|
|||
_re_token =
|
|||
AltXSDToPYTHON =
|
|||
__package__ =
|
Imports: ns_rdf, XSDToPython, Literal, _toPythonMapping, ns_xsd, datetime, time, re, Decimal
|
Almost all time/date related methods require the extraction of an optional time zone information.
|
The built-in conversion to boolean is way too lax. The xsd specification requires that only true, false, 1 or 0 should be used...
|
The built in datatype handling for RDFLib maps a decimal number to float, but the python version 2.4 and upwards also has a Decimal number. Better make use of that to use very high numbers. However, there is also a big difference between Python's decimal and XSD's decimal, because the latter does not allow for an exponential normal form (why???). This must be filtered out.
|
Rudimentary test for the AnyURI value. If it is a relative URI, then some tests are done to filter out mistakes. I am not sure this is the full implementation of the RFC, though, may have to be checked at some point later.
|
Rudimentary test for the base64Binary value. The problem is that the built-in b64 module functions ignore the fact that only a certain family of characters are allowed to appear in the lexical value, so this is checked first.
|
Test (and convert) a generic numerical type, with a check against a lower and upper limit.
|
Test and convert a double value into a Decimal or float. Raises an exception if the number is outside the permitted range, ie, 1.0E+310 and 1.0E-330. To be on the safe side (python does not have double!) Decimals are used if possible. Upper and lower values, as required by xsd, are checked (and these fixed values are the reasons why Decimal is used!)
|
Test and convert a float value into Decimal or (python) float. Raises an exception if the number is outside the permitted range, ie, 1.0E+40 and 1.0E-50. (And these fixed values are the reasons why Decimal is used!)
|
Test (and convert) hexa integer values. The number of characters should be even.
|
Test (and convert) datetime and date timestamp values.
|
Test (and convert) time values.
|
Test (and convert) date values.
|
Test gYearMonth value
|
Test gYear value
|
Test gYearMonth value
|
Test gYearMonth value
|
Test gYearMonth value
|
Test (and convert) XML Literal values.
|
Test (and convert) a generic string type, with a check against a regular expression.
|
Test (and convert) a string to a token.
|
Test (and convert) a plain literal
|
Registering the datatypes item for RDFLib, ie, bind the dictionary values. The 'bind' method of RDFLib adds extra datatypes to the registered ones in RDFLib, though the table used here (ie, AltXSDToPYTHON) actually overrides all of the default conversion routines. The method also add a Decimal entry to the PythonToXSD array of RDFLib. |
|
__license__
|
_hexc
|
_re_Name_ex
|
_re_NCName_ex
|
AltXSDToPYTHON
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Feb 7 15:00:18 2014 | http://epydoc.sourceforge.net |