ontocast.onto.xsd_lexical¶
Lexical forms of the XSD date, time and duration datatypes.
rdflib reads these datatypes with Python's ISO parsers, which also accept forms
XSD does not (2021-06-29 or 20210629 as xsd:dateTime, week dates,
a space for T, a date-time as xsd:date). A triple store treats such a
literal as ill-typed, so validity is decided here by the XSD 1.1 lexical
spaces instead, with the day checked against its month.
Attributes¶
CALENDAR_DATATYPES = frozenset({XSD.date, XSD.dateTime, XSD.dateTimeStamp, XSD.gYearMonth, XSD.gYear})
module-attribute
¶
TEMPORAL_DATATYPES = frozenset(_PATTERNS)
module-attribute
¶
__all__ = ['CALENDAR_DATATYPES', 'TEMPORAL_DATATYPES', 'is_valid_temporal_lexical']
module-attribute
¶
Functions:¶
is_valid_temporal_lexical(lexical, datatype)
¶
Whether lexical is in the XSD lexical space of datatype.
A day must exist in its month (2021-02-30 is not a date; --02-29
is a month-day).
Returns:
| Type | Description |
|---|---|
bool | None
|
|