View Source RDF.XSD.UnsignedShort (RDF.ex v2.0.0)

RDF.XSD.Datatype for xsd:unsignedShort.

See: https://www.w3.org/TR/xmlschema11-2/#unsignedShort

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.

Casts a datatype literal of one type into a datatype literal of another type.

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.

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.

Types

@type invalid_value() :: nil
@type t() :: %RDF.XSD.UnsignedShort{
  uncanonical_lexical: RDF.XSD.Datatype.uncanonical_lexical(),
  value: value()
}
@type valid_value() :: RDF.XSD.UnsignedInt.valid_value()
@type value() :: valid_value() | invalid_value()

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.

Link to this function

canonical_lexical(literal)

View Source

Returns the canonical lexical form of a RDF.Literal of this datatype.

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.

@spec compare(RDF.Literal.t() | any(), RDF.Literal.t() | any()) ::
  RDF.Literal.Datatype.comparison_result() | :indeterminate | nil

Compares two RDF.Literals.

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.

Link to this function

equal_value?(left, right)

View Source

Checks if two datatype literals are equal in terms of the values of their value space.

Non-RDF.Literals 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.

Link to this function

update(literal, fun, opts \\ [])

View Source

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.