owlapy.owl_literal
OWL Literals
Attributes
Classes
Generic enumeration. |
|
Literals represent data values such as particular strings or integers. They are analogous to typed RDF |
Module Contents
- owlapy.owl_literal.OWLTopObjectProperty: Final
- owlapy.owl_literal.OWLBottomObjectProperty: Final
- owlapy.owl_literal.OWLTopDataProperty: Final
- owlapy.owl_literal.OWLBottomDataProperty: Final
- owlapy.owl_literal.DoubleOWLDatatype: Final
- owlapy.owl_literal.FloatOWLDatatype: Final
- owlapy.owl_literal.DecimalOWLDatatype: Final
- owlapy.owl_literal.IntegerOWLDatatype: Final
- owlapy.owl_literal.NonNegativeIntegerOWLDatatype: Final
- owlapy.owl_literal.NonPositiveIntegerOWLDatatype: Final
- owlapy.owl_literal.NegativeIntegerOWLDatatype: Final
- owlapy.owl_literal.PositiveIntegerOWLDatatype: Final
- owlapy.owl_literal.BooleanOWLDatatype: Final
- owlapy.owl_literal.StringOWLDatatype: Final
- owlapy.owl_literal.DateOWLDatatype: Final
- owlapy.owl_literal.TimeOWLDatatype: Final
- owlapy.owl_literal.GYearMonthOWLDatatype: Final
- owlapy.owl_literal.GMonthDayOWLDatatype: Final
- owlapy.owl_literal.GYearOWLDatatype: Final
- owlapy.owl_literal.GMonthOWLDatatype: Final
- owlapy.owl_literal.GDayOWLDatatype: Final
- owlapy.owl_literal.DateTimeOWLDatatype: Final
- owlapy.owl_literal.DurationOWLDatatype: Final
- owlapy.owl_literal.TopOWLDatatype: Final
- owlapy.owl_literal.NUMERIC_DATATYPES: Final[Set[owlapy.owl_datatype.OWLDatatype]]
- owlapy.owl_literal.TIME_DATATYPES: Final[Set[owlapy.owl_datatype.OWLDatatype]]
- class owlapy.owl_literal.FloatSpecialValue[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- NAN = 'Nan'
- POS_INF = 'INF'
- NEG_INF = '-INF'
- owlapy.owl_literal.Literals
- class owlapy.owl_literal.OWLLiteral[source]
Bases:
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.
- __slots__ = ()
- type_index: Final = 4008
- get_literal() str [source]
Gets the lexical value of this literal. Note that the language tag is not included.
- Returns:
The lexical value of this literal.
- parse_boolean() bool [source]
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.
- parse_double() float [source]
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.
- parse_float() float [source]
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.
- parse_decimal() decimal.Decimal [source]
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.
- parse_integer() int [source]
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.
- parse_string() str [source]
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.
- parse_date() datetime.date [source]
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.
- parse_datetime() datetime.datetime [source]
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.
- parse_duration() pandas.Timedelta [source]
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.
- parse_time() datetime.time [source]
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.
- parse_gyearmonth() tuple [source]
Parses the lexical value of this literal into gYearMonth.
- Returns:
A tuple value of length 2 that is represented by this literal.
- parse_gmonthday() tuple [source]
Parses the lexical value of this literal into gMonthDay.
- Returns:
A tuple value of length 2 that is represented by this literal.
- parse_gyear() tuple [source]
Parses the lexical value of this literal into gYear.
- Returns:
A integer value that is represented by this literal.
- parse_gmonth() tuple [source]
Parses the lexical value of this literal into gMonth.
- Returns:
A integer value that is represented by this literal.
- parse_gday() tuple [source]
Parses the lexical value of this literal into gDay.
- Returns:
A integer value that is represented by this literal.
- has_float_special_value() bool [source]
Whether this literal is using a float special value i.e. v ∈ [“NaN”, “INF”, “-INF”], defined by and enumeration class (not pure string value).
- as_literal() OWLLiteral [source]
- Returns:
if the value is a literal, returns it. Return None otherwise
- abstract get_datatype() owlapy.owl_datatype.OWLDatatype [source]
Gets the OWLDatatype which types this literal.
- Returns:
The OWLDatatype that types this literal.