owlapy.owl_literal ================== .. py:module:: owlapy.owl_literal .. autoapi-nested-parse:: OWL Literals Attributes ---------- .. autoapisummary:: owlapy.owl_literal.OWLTopObjectProperty owlapy.owl_literal.OWLBottomObjectProperty owlapy.owl_literal.OWLTopDataProperty owlapy.owl_literal.OWLBottomDataProperty owlapy.owl_literal.DoubleOWLDatatype owlapy.owl_literal.FloatOWLDatatype owlapy.owl_literal.DecimalOWLDatatype owlapy.owl_literal.IntegerOWLDatatype owlapy.owl_literal.NonNegativeIntegerOWLDatatype owlapy.owl_literal.NonPositiveIntegerOWLDatatype owlapy.owl_literal.NegativeIntegerOWLDatatype owlapy.owl_literal.PositiveIntegerOWLDatatype owlapy.owl_literal.BooleanOWLDatatype owlapy.owl_literal.StringOWLDatatype owlapy.owl_literal.DateOWLDatatype owlapy.owl_literal.TimeOWLDatatype owlapy.owl_literal.GYearMonthOWLDatatype owlapy.owl_literal.GMonthDayOWLDatatype owlapy.owl_literal.GYearOWLDatatype owlapy.owl_literal.GMonthOWLDatatype owlapy.owl_literal.GDayOWLDatatype owlapy.owl_literal.DateTimeOWLDatatype owlapy.owl_literal.DurationOWLDatatype owlapy.owl_literal.TopOWLDatatype owlapy.owl_literal.NUMERIC_DATATYPES owlapy.owl_literal.TIME_DATATYPES owlapy.owl_literal.Literals Classes ------- .. autoapisummary:: owlapy.owl_literal.FloatSpecialValue owlapy.owl_literal.OWLLiteral Module Contents --------------- .. py:data:: OWLTopObjectProperty :type: Final .. py:data:: OWLBottomObjectProperty :type: Final .. py:data:: OWLTopDataProperty :type: Final .. py:data:: OWLBottomDataProperty :type: Final .. py:data:: DoubleOWLDatatype :type: Final .. py:data:: FloatOWLDatatype :type: Final .. py:data:: DecimalOWLDatatype :type: Final .. py:data:: IntegerOWLDatatype :type: Final .. py:data:: NonNegativeIntegerOWLDatatype :type: Final .. py:data:: NonPositiveIntegerOWLDatatype :type: Final .. py:data:: NegativeIntegerOWLDatatype :type: Final .. py:data:: PositiveIntegerOWLDatatype :type: Final .. py:data:: BooleanOWLDatatype :type: Final .. py:data:: StringOWLDatatype :type: Final .. py:data:: DateOWLDatatype :type: Final .. py:data:: TimeOWLDatatype :type: Final .. py:data:: GYearMonthOWLDatatype :type: Final .. py:data:: GMonthDayOWLDatatype :type: Final .. py:data:: GYearOWLDatatype :type: Final .. py:data:: GMonthOWLDatatype :type: Final .. py:data:: GDayOWLDatatype :type: Final .. py:data:: DateTimeOWLDatatype :type: Final .. py:data:: DurationOWLDatatype :type: Final .. py:data:: TopOWLDatatype :type: Final .. py:data:: NUMERIC_DATATYPES :type: Final[Set[owlapy.owl_datatype.OWLDatatype]] .. py:data:: TIME_DATATYPES :type: Final[Set[owlapy.owl_datatype.OWLDatatype]] .. py:class:: FloatSpecialValue Bases: :py:obj:`enum.Enum` Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: NAN :value: 'Nan' .. py:attribute:: POS_INF :value: 'INF' .. py:attribute:: NEG_INF :value: '-INF' .. py:method:: __str__() .. py:data:: Literals .. py:class:: OWLLiteral Bases: :py:obj:`owlapy.owl_annotation.OWLAnnotationValue` Literals represent data values such as particular strings or integers. They are analogous to typed RDF literals and can also be understood as individuals denoting data values. Each literal consists of a lexical form, which is a string, and a datatype. (https://www.w3.org/TR/owl2-syntax/#Literals) .. py:attribute:: __slots__ :value: () .. py:attribute:: type_index :type: Final :value: 4008 .. py:method:: get_literal() -> str Gets the lexical value of this literal. Note that the language tag is not included. :returns: The lexical value of this literal. .. py:method:: is_boolean() -> bool Whether this literal is typed as boolean. .. py:method:: parse_boolean() -> bool Parses the lexical value of this literal into a bool. The lexical value of this literal should be in the lexical space of the boolean datatype ("http://www.w3.org/2001/XMLSchema#boolean"). :returns: A bool value that is represented by this literal. .. py:method:: is_double() -> bool Whether this literal is typed as double. .. py:method:: parse_double() -> float Parses the lexical value of this literal into a double. The lexical value of this literal should be in the lexical space of the double datatype ("https://www.w3.org/TR/owl2-syntax/#Floating-Point_Numbers"). :returns: A double value that is represented by this literal. .. py:method:: is_float() -> bool Whether this literal is typed as float. .. py:method:: parse_float() -> float Parses the lexical value of this literal into a float. The lexical value of this literal should be in the lexical space of the float datatype ("https://www.w3.org/TR/owl2-syntax/#Floating-Point_Numbers"). :returns: A float value that is represented by this literal. .. py:method:: is_decimal() -> bool Whether this literal is typed as decimal. .. py:method:: parse_decimal() -> decimal.Decimal Parses the lexical value of this literal into a decimal. The lexical value of this literal should be in the lexical space of the decimal datatype ("https://www.w3.org/TR/owl2-syntax/#Floating-Point_Numbers"). :returns: A decimal value that is represented by this literal. .. py:method:: is_integer() -> bool Whether this literal is typed as integer. .. py:method:: parse_integer() -> int Parses the lexical value of this literal into an integer. The lexical value of this literal should be in the lexical space of the integer datatype ("http://www.w3.org/2001/XMLSchema#integer"). :returns: An integer value that is represented by this literal. .. py:method:: is_string() -> bool Whether this literal is typed as string. .. py:method:: parse_string() -> str Parses the lexical value of this literal into a string. The lexical value of this literal should be in the lexical space of the string datatype ("http://www.w3.org/2001/XMLSchema#string"). :returns: A string value that is represented by this literal. .. py:method:: is_date() -> bool Whether this literal is typed as date. .. py:method:: parse_date() -> datetime.date Parses the lexical value of this literal into a date. The lexical value of this literal should be in the lexical space of the date datatype ("http://www.w3.org/2001/XMLSchema#date"). :returns: A date value that is represented by this literal. .. py:method:: is_datetime() -> bool Whether this literal is typed as dateTime. .. py:method:: parse_datetime() -> datetime.datetime Parses the lexical value of this literal into a datetime. The lexical value of this literal should be in the lexical space of the dateTime datatype ("http://www.w3.org/2001/XMLSchema#dateTime"). :returns: A datetime value that is represented by this literal. .. py:method:: is_duration() -> bool Whether this literal is typed as duration. .. py:method:: parse_duration() -> pandas.Timedelta Parses the lexical value of this literal into a Timedelta. The lexical value of this literal should be in the lexical space of the duration datatype ("http://www.w3.org/2001/XMLSchema#duration"). :returns: A Timedelta value that is represented by this literal. .. py:method:: is_time() -> bool Whether this literal is typed as time. .. py:method:: parse_time() -> datetime.time Parses the lexical value of this literal into time. The lexical value of this literal should be in the lexical space of the time datatype ("http://www.w3.org/2001/XMLSchema#time"). :returns: A time value that is represented by this literal. .. py:method:: is_gyearmonth() -> bool Whether this literal is typed as gYearMonth. .. py:method:: parse_gyearmonth() -> tuple Parses the lexical value of this literal into gYearMonth. :returns: A tuple value of length 2 that is represented by this literal. .. py:method:: is_gmonthday() -> bool Whether this literal is typed as gMonthDay. .. py:method:: parse_gmonthday() -> tuple Parses the lexical value of this literal into gMonthDay. :returns: A tuple value of length 2 that is represented by this literal. .. py:method:: is_gyear() -> bool Whether this literal is typed as gYear. .. py:method:: parse_gyear() -> tuple Parses the lexical value of this literal into gYear. :returns: A integer value that is represented by this literal. .. py:method:: is_gmonth() -> bool Whether this literal is typed as gMonth. .. py:method:: parse_gmonth() -> tuple Parses the lexical value of this literal into gMonth. :returns: A integer value that is represented by this literal. .. py:method:: is_gday() -> bool Whether this literal is typed as gDay. .. py:method:: parse_gday() -> tuple Parses the lexical value of this literal into gDay. :returns: A integer value that is represented by this literal. .. py:method:: has_float_special_value() -> bool Whether this literal is using a float special value i.e. v ∈ ["NaN", "INF", "-INF"], defined by and enumeration class (not pure string value). .. py:method:: is_literal() -> bool :returns: true if the annotation value is a literal .. py:method:: as_literal() -> OWLLiteral :returns: if the value is a literal, returns it. Return None otherwise .. py:method:: to_python() -> Literals .. py:method:: get_datatype() -> owlapy.owl_datatype.OWLDatatype :abstractmethod: Gets the OWLDatatype which types this literal. :returns: The OWLDatatype that types this literal.