RDF.ex v0.7.1 RDF.Boolean View Source
RDF.Datatype for XSD boolean.
Link to this section Summary
Functions
Returns an Effective Boolean Value (EBV).
Alias for ebv/1.
Returns RDF.true if the effective boolean value of the given argument is RDF.false, or RDF.false if it is RDF.true.
Returns the logical AND of the effective boolean value of the given arguments.
Returns the logical OR of the effective boolean value of the given arguments.
Link to this section Types
Link to this section Functions
build_literal(value, lexical, opts)
View Sourcebuild_literal(RDF.Literal.literal_value() | nil, String.t() | nil, map()) :: RDF.Literal.t()
build_literal_by_value(value, opts)
View Sourcebuild_literal_by_value(any(), map()) :: RDF.Literal.t()
Returns an Effective Boolean Value (EBV).
The Effective Boolean Value is an algorithm to coerce values to a RDF.Boolean.
It is specified and used in the SPARQL query language and is based upon XPath's
fn:boolean. Other than specified in these specs any value which can not be
converted into a boolean results in nil.
see
effective(value)
View Sourceeffective(input() | any()) :: RDF.Literal.t() | nil
Alias for ebv/1.
Returns RDF.true if the effective boolean value of the given argument is RDF.false, or RDF.false if it is RDF.true.
Otherwise it returns nil.
Examples
iex> RDF.Boolean.fn_not(RDF.true)
RDF.false
iex> RDF.Boolean.fn_not(RDF.false)
RDF.true
iex> RDF.Boolean.fn_not(true)
RDF.false
iex> RDF.Boolean.fn_not(false)
RDF.true
iex> RDF.Boolean.fn_not(42)
RDF.false
iex> RDF.Boolean.fn_not("")
RDF.true
iex> RDF.Boolean.fn_not(nil)
nil
logical_and(left, right)
View Sourcelogical_and(input() | any(), input() | any()) :: RDF.Literal.t() | nil
Returns the logical AND of the effective boolean value of the given arguments.
It returns nil if only one argument is nil and the other argument is
RDF.true and RDF.false if the other argument is RDF.false.
Examples
iex> RDF.Boolean.logical_and(RDF.true, RDF.true)
RDF.true
iex> RDF.Boolean.logical_and(RDF.true, RDF.false)
RDF.false
iex> RDF.Boolean.logical_and(RDF.true, nil)
nil
iex> RDF.Boolean.logical_and(nil, RDF.false)
RDF.false
iex> RDF.Boolean.logical_and(nil, nil)
nil
logical_or(left, right)
View Sourcelogical_or(input() | any(), input() | any()) :: RDF.Literal.t() | nil
Returns the logical OR of the effective boolean value of the given arguments.
It returns nil if only one argument is nil and the other argument is
RDF.false and RDF.true if the other argument is RDF.true.
Examples
iex> RDF.Boolean.logical_or(RDF.true, RDF.false)
RDF.true
iex> RDF.Boolean.logical_or(RDF.false, RDF.false)
RDF.false
iex> RDF.Boolean.logical_or(RDF.true, nil)
RDF.true
iex> RDF.Boolean.logical_or(nil, RDF.false)
nil
iex> RDF.Boolean.logical_or(nil, nil)
nil
new(value, opts \\ %{})
View Sourcenew(any(), map() | keyword()) :: RDF.Literal.t()