View Source RDF.LangString (RDF.ex v2.0.1)
RDF.Literal.Datatype
for rdf:langString
s.
Summary
Functions
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 this datatype.
Checks if two datatype literals are equal in terms of the values of their value space.
Checks if a language tagged string literal or language tag matches a language range.
Creates a new RDF.Literal
with this datatype and the given value
and language
.
Updates the value of a RDF.Literal
without changing everything else.
Types
Functions
Returns the canonical lexical form of a RDF.Literal
of this datatype.
@spec 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.
@spec compare(RDF.Literal.t() | any(), RDF.Literal.t() | any()) :: RDF.Literal.Datatype.comparison_result() | :indeterminate | nil
Checks if the given literal has this datatype.
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.
@spec match_language?(RDF.Literal.t() | t() | String.t(), String.t()) :: boolean()
Checks if a language tagged string literal or language tag matches a language range.
The check is performed per the basic filtering scheme defined in
RFC4647 section 3.3.1.
A language range is a basic language range per Matching of Language Tags in
RFC4647 section 2.1.
A language range of "*"
matches any non-empty language-tag string.
@spec new(any(), String.t() | atom() | keyword()) :: RDF.Literal.t()
Creates a new RDF.Literal
with this datatype and the given value
and language
.
Updates the value of a RDF.Literal
without changing everything else.