RDF.XSD.Time (RDF.ex v0.9.2) View Source
RDF.XSD.Datatype
for XSD times.
Options:
tz
: this allows to specify a timezone which is not supported by Elixir'sTime
struct; note, that it will also overwrite an eventually already present timezone in an input lexical
Link to this section Summary
Functions
Produces the canonical representation of a RDF.Literal
of this datatype.
Determines if the lexical form of a RDF.Literal
of this datatype is the canonical form.
Returns the canonical lexical form of a RDF.Literal
of this datatype.
Converts a time literal to a canonical string, preserving the zone information.
Casts a datatype literal of one type into a datatype literal of another type.
Compares two RDF.Literal
s.
Checks if the given literal has datatype this or a datatype that is derived of it.
Checks if two datatype literals are equal in terms of the values of their value space.
Returns the lexical form of a RDF.Literal
of this datatype.
Creates a new RDF.Literal
with this datatype and the given value
.
Creates a new RDF.Literal
with this datatype and the given value
or fails when it is not valid.
Extracts the timezone string from a RDF.XSD.Time
value.
Updates the value of a RDF.Literal
without changing everything else.
Determines if a RDF.Literal
of this or a derived datatype has a proper value of its value space.
Returns the value of a RDF.Literal
of this or a derived datatype.
Link to this section Types
Specs
invalid_value() :: nil
Specs
t() :: %RDF.XSD.Time{ uncanonical_lexical: RDF.XSD.Datatype.uncanonical_lexical(), value: value() }
Specs
Specs
value() :: valid_value() | invalid_value()
Link to this section Functions
Produces the canonical representation of a RDF.Literal
of this datatype.
Determines if the lexical form of a RDF.Literal
of this datatype is the canonical form.
Returns the canonical lexical form of a RDF.Literal
of this datatype.
Specs
canonical_lexical_with_zone(RDF.Literal.t() | t()) :: String.t() | nil
Converts a time literal to a canonical string, preserving the zone information.
Specs
cast(RDF.Literal.Datatype.literal() | RDF.Term.t()) :: RDF.Literal.t() | nil
Casts a datatype literal of one type into a datatype literal of another type.
Returns nil
when the given arguments are not castable into this datatype or when the given argument is an
invalid literal.
Implementations define the casting for a given value with the RDF.Literal.Datatype.do_cast/1
callback.
Specs
compare(RDF.Literal.t() | any(), RDF.Literal.t() | any()) :: RDF.Literal.Datatype.comparison_result() | :indeterminate | nil
Compares two RDF.Literal
s.
If the first literal is greater than the second :gt
is returned, if less than :lt
is returned.
If both literal are equal :eq
is returned.
If the literals can not be compared either nil
is returned, when they generally can be compared
due to their datatype, or :indeterminate
is returned, when the order of the given values is
not defined on only partially ordered datatypes.
Checks if the given literal has datatype this or a datatype that is derived of it.
Checks if two datatype literals are equal in terms of the values of their value space.
Non-RDF.Literal
s are tried to be coerced via RDF.Literal.coerce/1
before comparison.
Returns nil
when the given arguments are not comparable as literals of this
datatype.
Invalid literals are only considered equal in this relation when both have the exact same datatype and the same attributes (lexical form, language etc.).
Implementations can customize this equivalence relation via the RDF.Literal.Datatype.do_equal_value_different_datatypes?/2
and RDF.Literal.Datatype.do_equal_value_different_datatypes?/2
callbacks.
Returns the lexical form of a RDF.Literal
of this datatype.
Creates a new RDF.Literal
with this datatype and the given value
.
Creates a new RDF.Literal
with this datatype and the given value
or fails when it is not valid.
Extracts the timezone string from a RDF.XSD.Time
value.
Updates the value of a RDF.Literal
without changing everything else.
Determines if a RDF.Literal
of this or a derived datatype has a proper value of its value space.
Returns the value of a RDF.Literal
of this or a derived datatype.