RDF.ex v0.7.0 RDF.Literal.Guards View Source

Guards for working with RDF.Literals.

These are useful for pattern matching on datatypes of literals, since Elixir doesn't allow function calls in pattern matching clauses, which means the qualified terms of a RDF.Vocabulary.Namespace can't be used.

Examples

defmodule M do
  import RDF.Literal.Guards

  def f(%RDF.Literal{datatype: datatype} = literal) when is_xsd_integer(datatype) do
    # ...
  end
end

Link to this section Summary

Functions

Returns true if the given datatype is rdf:langString; otherwise returns false.

Returns true if the given datatype is xsd:anyURI; otherwise returns false.

Returns true if the given datatype is xsd:boolean; otherwise returns false.

Returns true if the given datatype is xsd:date; otherwise returns false.

Returns true if the given datatype is xsd:dateTime; otherwise returns false.

Returns true if the given datatype is xsd:decimal; otherwise returns false.

Returns true if the given datatype is xsd:double; otherwise returns false.

Returns true if the given datatype is xsd:float; otherwise returns false.

Returns true if the given datatype is xsd:integer; otherwise returns false.

Returns true if the given datatype is xsd:string; otherwise returns false.

Returns true if the given datatype is xsd:time; otherwise returns false.

Link to this section Functions

Link to this macro

is_rdf_lang_string(datatype)

View Source (macro)

Returns true if the given datatype is rdf:langString; otherwise returns false.

Link to this macro

is_xsd_any_uri(datatype)

View Source (macro)

Returns true if the given datatype is xsd:anyURI; otherwise returns false.

Link to this macro

is_xsd_boolean(datatype)

View Source (macro)

Returns true if the given datatype is xsd:boolean; otherwise returns false.

Link to this macro

is_xsd_date(datatype)

View Source (macro)

Returns true if the given datatype is xsd:date; otherwise returns false.

Link to this macro

is_xsd_datetime(datatype)

View Source (macro)

Returns true if the given datatype is xsd:dateTime; otherwise returns false.

Link to this macro

is_xsd_decimal(datatype)

View Source (macro)

Returns true if the given datatype is xsd:decimal; otherwise returns false.

Link to this macro

is_xsd_double(datatype)

View Source (macro)

Returns true if the given datatype is xsd:double; otherwise returns false.

Link to this macro

is_xsd_float(datatype)

View Source (macro)

Returns true if the given datatype is xsd:float; otherwise returns false.

Link to this macro

is_xsd_integer(datatype)

View Source (macro)

Returns true if the given datatype is xsd:integer; otherwise returns false.

Link to this macro

is_xsd_string(datatype)

View Source (macro)

Returns true if the given datatype is xsd:string; otherwise returns false.

Link to this macro

is_xsd_time(datatype)

View Source (macro)

Returns true if the given datatype is xsd:time; otherwise returns false.