RDF.XSD.Datatype.elixir_mapping
elixir_mapping
, go back to RDF.XSD.Datatype module for more information.
Specs
elixir_mapping(any(), Keyword.t()) :: any() | {any(), uncanonical_lexical()}
A mapping from Elixir values into the value space of a RDF.XSD.Datatype
.
If the Elixir mapping for the given value can not be mapped into value space of
the XSD datatype an implementation should return @invalid_value
(which is just nil
at the moment, so nil
is never a valid value of a value space).
Otherwise a tuple {value, lexical}
with value
being the internal representation
of the mapped value from the value space and lexical
being the lexical representation
to be used for the Elixir value or nil
if init_valid_lexical/3
should be used
to determine the lexical form in general (i.e. also when initialized with a string
via the lexical_mapping/2
). Since the later case is most often what you want,
you can also return value
directly, as long as it is not a two element tuple.