RDFClosure.RestrictedDatatype.RestrictedDatatype

Package RDFClosure :: Module RestrictedDatatype :: Class RestrictedDatatype |
[hide private]
[frames] | no frames]

# Class RestrictedDatatype

source code

    RestrictedDatatypeCore --+
                             |
                            RestrictedDatatype

Implementation of a datatype with facets, ie, datatype with restrictions.

Instance Methods | [hide private]
__init__(self, type_uri, base_type, facets) | source code
boolean |
checkValue(self, value) Check whether the (python) value abides to the constraints defined by the current facets. | source code
boolean |
_check_min_exclusive(self, value) Check the (python) value against min exclusive facet. | source code
boolean |
_check_min_inclusive(self, value) Check the (python) value against min inclusive facet. | source code
boolean |
_check_max_exclusive(self, value) Check the (python) value against max exclusive facet. | source code
boolean |
_check_max_inclusive(self, value) Check the (python) value against max inclusive facet. | source code
boolean |
_check_min_length(self, value) Check the (python) value against minimum length facet. | source code
boolean |
_check_max_length(self, value) Check the (python) value against maximum length facet. | source code
boolean |
_check_length(self, value) Check the (python) value against exact length facet. | source code
boolean |
_check_pattern(self, value) Check the (python) value against array of regular expressions. | source code
boolean |
_check_lang_range(self, value) Check the (python) value against array of language ranges. | source code

Instance Variables | [hide private]
| base_type URI of the datatype that is restricted
| check_methods list of class methods that are relevant for the given `base_type`
| converter method to convert a literal of the base type to a Python value (drawn from DatatypeHandling.AltXSDToPYTHON)
| datatype the URI for this datatype
| langRange array of language ranges for the `rdf:langRange` facet, initialized to `[]` and set to the right value if a facet is around
| length value for the `xsd:length` facet, initialized to `None` and set to the right value if a facet is around
| maxExclusive value for the `xsd:maxExclusive` facet, initialized to `None` and set to the right value if a facet is around
| maxInclusive value for the `xsd:maxInclusive` facet, initialized to `None` and set to the right value if a facet is around
| maxLength value for the `xsd:maxLength` facet, initialized to `None` and set to the right value if a facet is around
| minExclusive value for the `xsd:minExclusive` facet, initialized to `None` and set to the right value if a facet is around
| minInclusive value for the `xsd:minInclusive` facet, initialized to `None` and set to the right value if a facet is around
| minLength value for the `xsd:minLength` facet, initialized to `None` and set to the right value if a facet is around
| pattern array of patterns for the `xsd:pattern` facet, initialized to `[]` and set to the right value if a facet is around
| toPython function to convert a Literal of the specified type to a Python value.
Inherited from `RestrictedDatatypeCore`: `type_uri`

Method Details | [hide private]

### __init__(self, type_uri, base_type, facets) (Constructor) | source code
Parameters: `type_uri` - URI of the datatype being defined `base_type` - URI of the base datatype, ie, the one being restricted `facets` - array of `(facetURI, value)` pairs Overrides: RestrictedDatatypeCore.__init__

### checkValue(self, value) | source code
Check whether the (python) value abides to the constraints defined by the current facets. Parameters: `value` - the value to be checked Returns: boolean Overrides: RestrictedDatatypeCore.checkValue

### _check_min_exclusive(self, value) | source code
Check the (python) value against min exclusive facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_min_inclusive(self, value) | source code
Check the (python) value against min inclusive facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_max_exclusive(self, value) | source code
Check the (python) value against max exclusive facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_max_inclusive(self, value) | source code
Check the (python) value against max inclusive facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_min_length(self, value) | source code
Check the (python) value against minimum length facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_max_length(self, value) | source code
Check the (python) value against maximum length facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_length(self, value) | source code
Check the (python) value against exact length facet. Parameters: `value` - the value to be checked Returns: boolean

### _check_pattern(self, value) | source code
Check the (python) value against array of regular expressions. Parameters: `value` - the value to be checked Returns: boolean

### _check_lang_range(self, value) | source code
Check the (python) value against array of language ranges. Parameters: `value` - the value to be checked Returns: boolean

Instance Variable Details | [hide private]

### toPython function to convert a Literal of the specified type to a Python value.